Skip to content

Commit a4c692b

Browse files
author
Veijo Pesonen
committed
Fix VTOR bug when using bootloader on STM32WB
The address of the vector table is hardcoded to the start of flash in many, if not all, ST targets. This causes a crash in applications that are using a bootloader. This patch updates the board STM32WB55 so it properly handle updating the VTOR with a bootloader. Solution has been copied from the PR #3798.
1 parent a707fd1 commit a4c692b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

targets/TARGET_STM/TARGET_STM32WB/STM32Cube_FW/system_stm32wbxx.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,8 @@ void SystemInit(void)
196196
/* program in SRAMx */
197197
SCB->VTOR = VECT_TAB_BASE_ADDRESS | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAMx for CPU1 */
198198
#else /* program in FLASH */
199-
SCB->VTOR = VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH */
199+
#include "nvic_addr.h" // MBED
200+
SCB->VTOR = NVIC_FLASH_VECTOR_ADDRESS; // MBED
200201
#endif
201202

202203
/* FPU settings ------------------------------------------------------------*/

0 commit comments

Comments
 (0)