Skip to content

Commit a8f390e

Browse files
author
Cruz Monrreal
authored
Merge pull request #7798 from simosillankorva/NUCLEO_F303RE_bootloader_support
Add bootloader support for target NUCLEO_F303RE
2 parents 0d0402d + c6acfd3 commit a8f390e

File tree

5 files changed

+28
-20
lines changed

5 files changed

+28
-20
lines changed

targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303xE/TARGET_NUCLEO_F303RE/system_clock.c

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,6 @@
3333
#include "stm32f3xx.h"
3434
#include "mbed_error.h"
3535

36-
/*!< Uncomment the following line if you need to relocate your vector Table in
37-
Internal SRAM. */
38-
/* #define VECT_TAB_SRAM */
39-
#define VECT_TAB_OFFSET 0x0 /*!< Vector Table base offset field.
40-
This value must be a multiple of 0x200. */
41-
4236
// clock source is selected with CLOCK_SOURCE in json config
4337
#define USE_PLL_HSE_EXTC 0x8 // Use external clock (ST Link MCO)
4438
#define USE_PLL_HSE_XTAL 0x4 // Use external xtal (X3 on board - not provided by default)
@@ -89,13 +83,6 @@ void SystemInit(void)
8983

9084
/* Disable all interrupts */
9185
RCC->CIR = 0x00000000U;
92-
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-
9986
}
10087

10188

targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303xE/device/TOOLCHAIN_ARM_STD/stm32f303xe.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
; STM32F303RE: 512KB FLASH (0x80000) + 64KB SRAM (0x10000)
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_STM32F3/TARGET_STM32F303xE/device/TOOLCHAIN_GCC_ARM/STM32F303XE.ld

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
/* Linker script to configure memory regions. */
2+
#ifndef MBED_APP_START
3+
#define MBED_APP_START 0x08000000
4+
#endif
5+
6+
#ifndef MBED_APP_SIZE
7+
#define MBED_APP_SIZE 512K
8+
#endif
9+
210
MEMORY
311
{
4-
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 512K
12+
FLASH (rx) : ORIGIN = MBED_APP_START, LENGTH = MBED_APP_SIZE
513
CCM (rwx) : ORIGIN = 0x10000000, LENGTH = 16K
614
RAM (rwx) : ORIGIN = 0x20000194, LENGTH = 64K - 0x194
715
}

targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303xE/device/TOOLCHAIN_IAR/stm32f303xe.icf

Lines changed: 7 additions & 4 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
define symbol __region_CCMRAM_start__ = 0x10000000;
710
define symbol __region_CCMRAM_end__ = 0x10003FFF;
@@ -21,7 +24,7 @@ define region CCMRAM_region = mem:[from __region_CCMRAM_start__ to __region_CCMR
2124
/* Stack and Heap */
2225
/*Heap 1/4 of ram and stack 1/8*/
2326
define symbol __size_cstack__ = 0x2000;
24-
define symbol __size_heap__ = 0x4000;
27+
define symbol __size_heap__ = 0x5000;
2528
define block CSTACK with alignment = 8, size = __size_cstack__ { };
2629
define block HEAP with alignment = 8, size = __size_heap__ { };
2730
define block STACKHEAP with fixed order { block HEAP, block CSTACK };

targets/targets.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,6 +1020,7 @@
10201020
"detect_code": ["0745"],
10211021
"device_has_add": ["ANALOGOUT", "CAN", "CRC", "SERIAL_ASYNCH", "SERIAL_FC", "FLASH"],
10221022
"release_versions": ["2", "5"],
1023+
"bootloader_supported": true,
10231024
"device_name": "STM32F303RE"
10241025
},
10251026
"NUCLEO_F303ZE": {

0 commit comments

Comments
 (0)