Skip to content

Commit db99b1d

Browse files
committed
OLIMEX_STM32E407_F407ZG: bootloader support
This commit modifies the Vector Table Offset Register in the startup file, so it uses address coming from the user application instead of a fixed one pointing to the bootloader. This change has been already proposed for another STM32F4 board [1] to fix bootloader issues. 1. #1666 (comment)
1 parent faf2c54 commit db99b1d

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F407xG/TARGET_OLIMEX_STM32E407_F407ZG/system_clock.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131

3232
#include "stm32f4xx.h"
3333
#include "mbed_error.h"
34+
#include "nvic_addr.h"
3435

3536
/*!< Uncomment the following line if you need to relocate your vector Table in
3637
Internal SRAM. */
@@ -94,7 +95,7 @@ void SystemInit(void)
9495
#ifdef VECT_TAB_SRAM
9596
SCB->VTOR = SRAM_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */
9697
#else
97-
SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH */
98+
SCB->VTOR = NVIC_FLASH_VECTOR_ADDRESS; /* Vector Table Relocation in Internal FLASH */
9899
#endif
99100

100101
}

targets/targets.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4092,7 +4092,8 @@
40924092
"USBDEVICE"
40934093
],
40944094
"release_versions": ["5"],
4095-
"device_name": "STM32F407ZG"
4095+
"device_name": "STM32F407ZG",
4096+
"bootloader_supported": true
40964097
},
40974098
"DISCO_F429ZI": {
40984099
"inherits": ["FAMILY_STM32"],

0 commit comments

Comments
 (0)