Skip to content

Commit ff4b567

Browse files
author
micgur01
committed
Update linker scripts for bootloader for L496GZ
1 parent ba23fef commit ff4b567

File tree

5 files changed

+35
-9
lines changed

5 files changed

+35
-9
lines changed

targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L496xG/device/TOOLCHAIN_ARM_MICRO/stm32l496xx.sct

100644100755
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 0x100000
36+
#endif
37+
3038
; 1MB FLASH (0x100000) + 320KB SRAM (0x50000)
31-
LR_IROM1 0x08000000 0x100000 { ; load region size_region
39+
LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
3240

33-
ER_IROM1 0x08000000 0x100000 { ; 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_STM32L4/TARGET_STM32L496xG/device/TOOLCHAIN_ARM_STD/stm32l496xx.sct

100644100755
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 0x100000
36+
#endif
37+
3038
; 1MB FLASH (0x100000) + 320KB SRAM (0x50000)
31-
LR_IROM1 0x08000000 0x100000 { ; load region size_region
39+
LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
3240

33-
ER_IROM1 0x08000000 0x100000 { ; 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_STM32L4/TARGET_STM32L496xG/device/TOOLCHAIN_GCC_ARM/STM32L496XX.ld

100644100755
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
/* Linker script to configure memory regions. */
22
/* 0x1AC resevered for vectors; 8-byte aligned = 0x1B0 (0x1AC + 0x4)*/
3+
#if !defined(MBED_APP_START)
4+
#define MBED_APP_START 0x08000000
5+
#endif
6+
#if !defined(MBED_APP_SIZE)
7+
#define MBED_APP_SIZE 1024k
8+
#endif
39
MEMORY
410
{
5-
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K
11+
FLASH (rx) : ORIGIN = MBED_APP_START, LENGTH = MBED_APP_SIZE
612
SRAM1 (rwx) : ORIGIN = 0x200001B0, LENGTH = 320k - (0x1AC +0x4)
713
}
814

targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L496xG/device/TOOLCHAIN_IAR/stm32l496xx.icf

100644100755
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 = 1024kb = 0x100000] */
2-
define symbol __intvec_start__ = 0x08000000;
3-
define symbol __region_ROM_start__ = 0x08000000;
4-
define symbol __region_ROM_end__ = 0x08000000 + 0x100000 - 1;
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 = 0x50000] */
710
/* Vector table dynamic copy: Total: 107 vectors * 4 = 428 bytes (0x1AC) to be reserved in RAM */

targets/targets.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4282,7 +4282,8 @@
42824282
"detect_code": ["0823"],
42834283
"device_has_add": ["ANALOGOUT", "CAN", "CRC", "SERIAL_ASYNCH", "SERIAL_FC", "TRNG", "FLASH"],
42844284
"release_versions": ["2", "5"],
4285-
"device_name": "STM32L496ZG"
4285+
"device_name": "STM32L496ZG",
4286+
"bootloader_supported": true
42864287
},
42874288
"NUCLEO_L496ZG_P": {
42884289
"inherits": ["NUCLEO_L496ZG"],

0 commit comments

Comments
 (0)