Skip to content

Commit 44bc123

Browse files
committed
Add bootlader support for NUCLEO_L073RZ on GCC
1 parent f61dee1 commit 44bc123

File tree

3 files changed

+28
-15
lines changed

3 files changed

+28
-15
lines changed

targets/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L073RZ/device/TOOLCHAIN_GCC_ARM/STM32L073XZ.ld

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,3 @@
1-
/* Linker script to configure memory regions. */
2-
3-
#if !defined(MBED_BOOT_STACK_SIZE)
4-
#define MBED_BOOT_STACK_SIZE 0x400
5-
#endif
6-
7-
STACK_SIZE = MBED_BOOT_STACK_SIZE;
8-
9-
MEMORY
10-
{
11-
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 192k
12-
RAM (rwx) : ORIGIN = 0x200000C0, LENGTH = 20K - 0xC0
13-
}
14-
151
/* Linker script to place sections and symbol values. Should be used together
162
* with other linker script that defines memory regions FLASH and RAM.
173
* It references following symbols, which must be defined in code:
@@ -39,6 +25,28 @@ MEMORY
3925
* __stack
4026
* _estack
4127
*/
28+
29+
#if !defined(MBED_APP_START)
30+
#define MBED_APP_START 0x08000000
31+
#endif
32+
33+
#if !defined(MBED_APP_SIZE)
34+
#define MBED_APP_SIZE 0x2EE00
35+
#endif
36+
37+
#if !defined(MBED_BOOT_STACK_SIZE)
38+
#define MBED_BOOT_STACK_SIZE 0x400
39+
#endif
40+
41+
STACK_SIZE = MBED_BOOT_STACK_SIZE;
42+
43+
/* Linker script to configure memory regions. */
44+
MEMORY
45+
{
46+
FLASH (rx) : ORIGIN = MBED_APP_START, LENGTH = MBED_APP_SIZE
47+
RAM (rwx) : ORIGIN = 0x200000C0, LENGTH = 20K - 0xC0
48+
}
49+
4250
ENTRY(Reset_Handler)
4351

4452
SECTIONS

targets/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L073RZ/device/system_clock.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,12 @@ void SystemInit (void)
8282
#ifdef VECT_TAB_SRAM
8383
SCB->VTOR = SRAM_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */
8484
#else
85+
#ifdef APPLICATION_ADDR
86+
SCB->VTOR = APPLICATION_ADDR; /* Vector Table Relocation in Internal FLASH to offset application*/
87+
#else
8588
SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH */
86-
#endif
89+
#endif // end APPLICATION_ADDR
90+
#endif // end VECT_TAB_SRAM
8791

8892
}
8993

targets/targets.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3142,6 +3142,7 @@
31423142
"MPU"
31433143
],
31443144
"release_versions": ["2", "5"],
3145+
"bootloader_supported": true,
31453146
"device_name": "STM32L073RZ"
31463147
},
31473148
"NUCLEO_L152RE": {

0 commit comments

Comments
 (0)