Skip to content

Commit f8f5483

Browse files
committed
Linker update for bootloader support
1 parent a08fc2b commit f8f5483

File tree

4 files changed

+34
-8
lines changed

4 files changed

+34
-8
lines changed

targets/TARGET_NXP/TARGET_LPC176X/device/TOOLCHAIN_ARM_MICRO/LPC1768.sct

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
1+
#! armcc -E
12

2-
LR_IROM1 0x00000000 0x80000 { ; load region size_region
3-
ER_IROM1 0x00000000 0x80000 { ; load address = execution address
3+
#if !defined(MBED_APP_START)
4+
#define MBED_APP_START 0x00000000
5+
#endif
6+
7+
#if !defined(MBED_APP_SIZE)
8+
#define MBED_APP_SIZE 0x80000
9+
#endif
10+
11+
LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
12+
ER_IROM1 MBED_APP_START MBED_APP_SIZE { ; load address = execution address
413
*.o (RESET, +First)
514
*(InRoot$$Sections)
615
.ANY (+RO)

targets/TARGET_NXP/TARGET_LPC176X/device/TOOLCHAIN_ARM_STD/LPC1768.sct

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
1+
#! armcc -E
12

2-
LR_IROM1 0x00000000 0x80000 { ; load region size_region
3-
ER_IROM1 0x00000000 0x80000 { ; load address = execution address
3+
#if !defined(MBED_APP_START)
4+
#define MBED_APP_START 0x00000000
5+
#endif
6+
7+
#if !defined(MBED_APP_SIZE)
8+
#define MBED_APP_SIZE 0x80000
9+
#endif
10+
11+
LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
12+
ER_IROM1 MBED_APP_START MBED_APP_SIZE { ; load address = execution address
413
*.o (RESET, +First)
514
*(InRoot$$Sections)
615
.ANY (+RO)

targets/TARGET_NXP/TARGET_LPC176X/device/TOOLCHAIN_GCC_ARM/LPC1768.ld

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
/* Linker script for mbed LPC1768 */
2+
#if !defined(MBED_APP_START)
3+
#define MBED_APP_START 0x00000000
4+
#endif
25

6+
#if !defined(MBED_APP_SIZE)
7+
#define MBED_APP_SIZE 512K
8+
#endif
39
/* Linker script to configure memory regions. */
410
MEMORY
511
{
6-
FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 512K
12+
FLASH (rx) : ORIGIN = MBED_APP_START, LENGTH = MBED_APP_SIZE
713
RAM (rwx) : ORIGIN = 0x100000C8, LENGTH = (32K - 0xC8 - 32) /* topmost 32 bytes used by IAP functions */
814

915
USB_RAM(rwx) : ORIGIN = 0x2007C000, LENGTH = 16K

targets/TARGET_NXP/TARGET_LPC176X/device/TOOLCHAIN_IAR/LPC17xx.icf

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1+
if (!isdefinedsymbol(MBED_APP_START)) { define symbol MBED_APP_START = 0x00000000; }
2+
if (!isdefinedsymbol(MBED_APP_SIZE)) { define symbol MBED_APP_SIZE = 0x80000; }
13
/*###ICF### Section handled by ICF editor, don't touch! ****/
24
/*-Editor annotation file-*/
35
/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
46
/*-Specials-*/
5-
define symbol __ICFEDIT_intvec_start__ = 0x00000000;
7+
define symbol __ICFEDIT_intvec_start__ = MBED_APP_START;
68
/*-Memory Regions-*/
7-
define symbol __ICFEDIT_region_ROM_start__ = 0x00000000;
8-
define symbol __ICFEDIT_region_ROM_end__ = 0x0007FFFF;
9+
define symbol __ICFEDIT_region_ROM_start__ = MBED_APP_START;
10+
define symbol __ICFEDIT_region_ROM_end__ = MBED_APP_START + MBED_APP_SIZE - 1;
911
define symbol __ICFEDIT_region_NVIC_start__ = 0x10000000;
1012
define symbol __ICFEDIT_region_NVIC_end__ = 0x100000C7;
1113
define symbol __ICFEDIT_region_RAM_start__ = 0x100000C8;

0 commit comments

Comments
 (0)