Skip to content

Commit e54073b

Browse files
committed
feat(swan_r5):bootloader build (UF2_BOOTLOADER=2) does not set the ISR vector table.
1 parent 1c1eb49 commit e54073b

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

ports/stm/boards/system_stm32l4xx.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,10 +221,6 @@ const uint32_t MSIRangeTable[12] = {100000U, 200000U, 400000U, 800000U, 1
221221
*/
222222

223223
void SystemInit(void) {
224-
#if defined(USER_VECT_TAB_ADDRESS)
225-
/* Configure the Vector Table location -------------------------------------*/
226-
SCB->VTOR = VECT_TAB_BASE_ADDRESS | VECT_TAB_OFFSET;
227-
#endif
228224

229225
/* FPU settings ------------------------------------------------------------*/
230226
#if (__FPU_PRESENT == 1) && (__FPU_USED == 1)
@@ -249,6 +245,13 @@ void SystemInit(void) {
249245

250246
/* Disable all interrupts */
251247
RCC->CIER = 0x00000000U;
248+
249+
#if !(BOARD_VTOR_DEFER) // only set VTOR if the bootloader hasn't already
250+
#if defined(USER_VECT_TAB_ADDRESS)
251+
/* Configure the Vector Table location -------------------------------------*/
252+
SCB->VTOR = VECT_TAB_BASE_ADDRESS | VECT_TAB_OFFSET;
253+
#endif
254+
#endif
252255
}
253256

254257
/**

0 commit comments

Comments
 (0)