summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ports/stm32/mboot/main.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ports/stm32/mboot/main.c b/ports/stm32/mboot/main.c
index b3af49526..b3e63ccc2 100644
--- a/ports/stm32/mboot/main.c
+++ b/ports/stm32/mboot/main.c
@@ -1285,6 +1285,9 @@ void stm32_main(int initial_r0) {
RCC->D3CCIPR = 0x00000000;
#endif
+ // Make sure IRQ vector table points to flash where this bootloader lives.
+ SCB->VTOR = FLASH_BASE;
+
// Enable 8-byte stack alignment for IRQ handlers, in accord with EABI
SCB->CCR |= SCB_CCR_STKALIGN_Msk;