Skip to content

Commit 3b09b82

Browse files
authored
Merge pull request hathach#1272 from EmergReanimator/cortex-m33
Enable breakpoints for ARM8M (e.g. cortex-m33)
2 parents 77b4234 + 44406a8 commit 3b09b82

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/common/tusb_verify.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,31 +37,31 @@
3737
* manipulation that you are told to stay away.
3838
*
3939
* This contains macros for both VERIFY and ASSERT:
40-
*
40+
*
4141
* VERIFY: Used when there is an error condition which is not the
4242
* fault of the MCU. For example, bounds checking on data
4343
* sent to the micro over USB should use this function.
4444
* Another example is checking for buffer overflows, where
4545
* returning from the active function causes a NAK.
46-
*
46+
*
4747
* ASSERT: Used for error conditions that are caused by MCU firmware
4848
* bugs. This is used to discover bugs in the code more
4949
* quickly. One example would be adding assertions in library
5050
* function calls to confirm a function's (untainted)
5151
* parameters are valid.
52-
*
52+
*
5353
* The difference in behavior is that ASSERT triggers a breakpoint while
5454
* verify does not.
5555
*
5656
* #define TU_VERIFY(cond) if(cond) return false;
5757
* #define TU_VERIFY(cond,ret) if(cond) return ret;
58-
*
58+
*
5959
* #define TU_VERIFY_HDLR(cond,handler) if(cond) {handler; return false;}
6060
* #define TU_VERIFY_HDLR(cond,ret,handler) if(cond) {handler; return ret;}
6161
*
6262
* #define TU_ASSERT(cond) if(cond) {_MESS_FAILED(); TU_BREAKPOINT(), return false;}
6363
* #define TU_ASSERT(cond,ret) if(cond) {_MESS_FAILED(); TU_BREAKPOINT(), return ret;}
64-
*
64+
*
6565
*------------------------------------------------------------------*/
6666

6767
#ifdef __cplusplus
@@ -81,8 +81,8 @@
8181
#define _MESS_FAILED() do {} while (0)
8282
#endif
8383

84-
// Halt CPU (breakpoint) when hitting error, only apply for Cortex M3, M4, M7
85-
#if defined(__ARM_ARCH_7M__) || defined (__ARM_ARCH_7EM__)
84+
// Halt CPU (breakpoint) when hitting error, only apply for Cortex M3, M4, M7, M33
85+
#if defined(__ARM_ARCH_7M__) || defined (__ARM_ARCH_7EM__) || defined(__ARM_ARCH_8M_MAIN__)
8686
#define TU_BREAKPOINT() do \
8787
{ \
8888
volatile uint32_t* ARM_CM_DHCSR = ((volatile uint32_t*) 0xE000EDF0UL); /* Cortex M CoreDebug->DHCSR */ \

0 commit comments

Comments
 (0)