Skip to content

Commit 45b3fff

Browse files
authored
Merge pull request #6729 from JammuKekkonen/f411re_add_bootloader_support
Add bootloader support for NUCLEO_F411RE target
2 parents f09ab67 + d2cf341 commit 45b3fff

File tree

5 files changed

+29
-23
lines changed

5 files changed

+29
-23
lines changed

targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F411xE/TARGET_NUCLEO_F411RE/system_clock.c

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,6 @@
3232
#include "stm32f4xx.h"
3333
#include "mbed_assert.h"
3434

35-
/*!< Uncomment the following line if you need to relocate your vector Table in
36-
Internal SRAM. */
37-
/* #define VECT_TAB_SRAM */
38-
#define VECT_TAB_OFFSET 0x00 /*!< Vector Table base offset field.
39-
This value must be a multiple of 0x200. */
40-
41-
4235
// clock source is selected with CLOCK_SOURCE in json config
4336
#define USE_PLL_HSE_EXTC 0x8 // Use external clock (ST Link MCO)
4437
#define USE_PLL_HSE_XTAL 0x4 // Use external xtal (X3 on board - not provided by default)
@@ -88,14 +81,6 @@ void SystemInit(void)
8881
#if defined (DATA_IN_ExtSRAM) || defined (DATA_IN_ExtSDRAM)
8982
SystemInit_ExtMemCtl();
9083
#endif /* DATA_IN_ExtSRAM || DATA_IN_ExtSDRAM */
91-
92-
/* Configure the Vector Table location add offset address ------------------*/
93-
#ifdef VECT_TAB_SRAM
94-
SCB->VTOR = SRAM_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */
95-
#else
96-
SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH */
97-
#endif
98-
9984
}
10085

10186

targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F411xE/device/TOOLCHAIN_ARM_STD/stm32f411re.sct

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#! armcc -E
12
; Scatter-Loading Description File
23
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
34
; Copyright (c) 2014, STMicroelectronics
@@ -27,10 +28,18 @@
2728
; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2829
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2930

31+
#if !defined(MBED_APP_START)
32+
#define MBED_APP_START 0x08000000
33+
#endif
34+
35+
#if !defined(MBED_APP_SIZE)
36+
#define MBED_APP_SIZE 0x80000
37+
#endif
38+
3039
; STM32F411RE: 512 KB FLASH (0x80000) + 128 KB SRAM (0x20000)
31-
LR_IROM1 0x08000000 0x80000 { ; load region size_region
40+
LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
3241

33-
ER_IROM1 0x08000000 0x80000 { ; load address = execution address
42+
ER_IROM1 MBED_APP_START MBED_APP_SIZE { ; load address = execution address
3443
*.o (RESET, +First)
3544
*(InRoot$$Sections)
3645
.ANY (+RO)

targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F411xE/device/TOOLCHAIN_GCC_ARM/STM32F411XE.ld

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
1+
#if !defined(MBED_APP_START)
2+
#define MBED_APP_START 0x08000000
3+
#endif
4+
5+
#if !defined(MBED_APP_SIZE)
6+
#define MBED_APP_SIZE 512K
7+
#endif
8+
19
/* Linker script to configure memory regions. */
210
MEMORY
3-
{
4-
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 512K
11+
{
12+
FLASH (rx) : ORIGIN = MBED_APP_START, LENGTH = MBED_APP_SIZE
513
RAM (rwx) : ORIGIN = 0x20000198, LENGTH = 128k - 0x198
614
}
715

targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F411xE/device/TOOLCHAIN_IAR/stm32f411xe.icf

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1+
if (!isdefinedsymbol(MBED_APP_START)) { define symbol MBED_APP_START = 0x08000000; }
2+
if (!isdefinedsymbol(MBED_APP_SIZE)) { define symbol MBED_APP_SIZE = 0x80000; }
3+
14
/* [ROM = 512kb = 0x80000] */
2-
define symbol __intvec_start__ = 0x08000000;
3-
define symbol __region_ROM_start__ = 0x08000000;
4-
define symbol __region_ROM_end__ = 0x0807FFFF;
5+
define symbol __intvec_start__ = MBED_APP_START;
6+
define symbol __region_ROM_start__ = MBED_APP_START;
7+
define symbol __region_ROM_end__ = MBED_APP_START + MBED_APP_SIZE - 1;
58

69
/* [RAM = 128kb = 0x20000] Vector table dynamic copy: 102 vectors = 408 bytes (0x198) to be reserved in RAM */
710
define symbol __NVIC_start__ = 0x20000000;

targets/targets.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1099,7 +1099,8 @@
10991099
"macros_add": ["USB_STM_HAL", "USBHOST_OTHER"],
11001100
"device_has_add": ["LOWPOWERTIMER", "SERIAL_ASYNCH", "SERIAL_FC", "FLASH"],
11011101
"release_versions": ["2", "5"],
1102-
"device_name": "STM32F411RE"
1102+
"device_name": "STM32F411RE",
1103+
"bootloader_supported": true
11031104
},
11041105
"NUCLEO_F412ZG": {
11051106
"inherits": ["FAMILY_STM32"],

0 commit comments

Comments
 (0)