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.
pull/12958/head
Veijo Pesonen 2020-05-11 16:31:10 +03:00
parent a707fd133e
commit a4c692bd41
1 changed files with 2 additions and 1 deletions

View File

@ -196,7 +196,8 @@ void SystemInit(void)
/* program in SRAMx */
SCB->VTOR = VECT_TAB_BASE_ADDRESS | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAMx for CPU1 */
#else /* program in FLASH */
SCB->VTOR = VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH */
#include "nvic_addr.h" // MBED
SCB->VTOR = NVIC_FLASH_VECTOR_ADDRESS; // MBED
#endif
/* FPU settings ------------------------------------------------------------*/