Skip to content

Commit 22abea3

Browse files
committed
Modify linker scripts for IAR and ARM compilers to support bootloader on NUCLEO_L073RZ
1 parent 44bc123 commit 22abea3

File tree

4 files changed

+32
-9
lines changed

4 files changed

+32
-9
lines changed

targets/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L073RZ/device/TOOLCHAIN_ARM_MICRO/stm32l073xz.sct

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,18 @@
2727
; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2828
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2929

30+
#if !defined(MBED_APP_START)
31+
#define MBED_APP_START 0x08000000
32+
#endif
33+
34+
#if !defined(MBED_APP_SIZE)
35+
#define MBED_APP_SIZE 0x30000
36+
#endif
37+
3038
; STM32L073RZ: 192KB FLASH (0x30000) + 20KB RAM (0x5000)
31-
LR_IROM1 0x08000000 0x30000 { ; load region size_region
39+
LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
3240

33-
ER_IROM1 0x08000000 0x30000 { ; load address = execution address
41+
ER_IROM1 MBED_APP_START MBED_APP_SIZE { ; load address = execution address
3442
*.o (RESET, +First)
3543
*(InRoot$$Sections)
3644
.ANY (+RO)

targets/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L073RZ/device/TOOLCHAIN_ARM_STD/stm32l073xz.sct

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,20 @@
3232
#define MBED_BOOT_STACK_SIZE 0x400
3333
#endif
3434

35+
#if !defined(MBED_APP_START)
36+
#define MBED_APP_START 0x08000000
37+
#endif
38+
39+
#if !defined(MBED_APP_SIZE)
40+
#define MBED_APP_SIZE 0x30000
41+
#endif
42+
3543
#define Stack_Size MBED_BOOT_STACK_SIZE
3644

3745
; STM32L073RZ: 192KB FLASH (0x30000) + 20KB RAM (0x5000)
38-
LR_IROM1 0x08000000 0x30000 { ; load region size_region
46+
LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
3947

40-
ER_IROM1 0x08000000 0x30000 { ; load address = execution address
48+
ER_IROM1 MBED_APP_START MBED_APP_SIZE { ; load address = execution address
4149
*.o (RESET, +First)
4250
*(InRoot$$Sections)
4351
.ANY (+RO)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#endif
3232

3333
#if !defined(MBED_APP_SIZE)
34-
#define MBED_APP_SIZE 0x2EE00
34+
#define MBED_APP_SIZE 0x30000
3535
#endif
3636

3737
#if !defined(MBED_BOOT_STACK_SIZE)

targets/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L073RZ/device/TOOLCHAIN_IAR/stm32l073xx.icf

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

613
/* [RAM = 20kb = 0x5000] Vector table dynamic copy: 48 vectors = 192 bytes (0xC0) to be reserved in RAM */
714
define symbol __NVIC_start__ = 0x20000000;

0 commit comments

Comments
 (0)