File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,8 @@ static void powerdown_nvic()
49
49
int j ;
50
50
51
51
#if defined(__CORTEX_M23 )
52
- isr_groups_32 = 16 ;
52
+ // M23 doesn't support ICTR and supports up to 240 external interrupts.
53
+ isr_groups_32 = 8 ;
53
54
#else
54
55
isr_groups_32 = ((SCnSCB -> ICTR & SCnSCB_ICTR_INTLINESNUM_Msk ) >> SCnSCB_ICTR_INTLINESNUM_Pos ) + 1 ;
55
56
#endif
@@ -76,13 +77,19 @@ static void powerdown_scb(uint32_t vtor)
76
77
SCB -> AIRCR = 0x05FA | 0x0000 ;
77
78
SCB -> SCR = 0x00000000 ;
78
79
// SCB->CCR - Implementation defined value
80
+ #if defined(__CORTEX_M23 )
81
+ for (i = 0 ; i < 2 ; i ++ ) {
82
+ SCB -> SHPR [i ] = 0x00 ;
83
+ }
84
+ #else
79
85
for (i = 0 ; i < 12 ; i ++ ) {
80
- #if defined(__CORTEX_M7 ) || defined( __CORTEX_M23 )
86
+ #if defined(__CORTEX_M7 )
81
87
SCB -> SHPR [i ] = 0x00 ;
82
88
#else
83
89
SCB -> SHP [i ] = 0x00 ;
84
90
#endif
85
91
}
92
+ #endif
86
93
SCB -> SHCSR = 0x00000000 ;
87
94
#if defined(__CORTEX_M23 )
88
95
#else
@@ -118,12 +125,8 @@ __asm static void start_new_application(void *sp, void *pc)
118
125
void start_new_application (void * sp , void * pc )
119
126
{
120
127
__asm volatile (
121
- #if defined(__CORTEX_M23 )
122
- "movw r2, #0 \n"
128
+ "movw r2, #0 \n" // Fail to compile "mov r2, #0" with ARMC6. Replace with movw/movt.
123
129
"movt r2, #0 \n"
124
- #else
125
- "mov r2, #0 \n"
126
- #endif
127
130
"msr control, r2 \n" // Switch to main stack
128
131
"mov sp, %0 \n"
129
132
"msr primask, r2 \n" // Enable interrupts
You can’t perform that action at this time.
0 commit comments