Skip to content

Commit 10076bd

Browse files
authored
Merge pull request #5691 from dlfryar/nrf52_linker
Nordic add app_start config system support for NRF52840 for bootloader
2 parents b8de0f2 + 30e1e0a commit 10076bd

File tree

5 files changed

+50
-20
lines changed

5 files changed

+50
-20
lines changed

targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/device/TOOLCHAIN_ARM_STD/nRF52832.sct

Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#! armcc -E
2+
3+
#if !defined(MBED_APP_START)
4+
#define MBED_APP_START 0x21000
5+
#endif
6+
7+
#if !defined(MBED_APP_SIZE)
8+
#define MBED_APP_SIZE 0xDF000
9+
#endif
10+
11+
LR_IROM1 MBED_APP_START MBED_APP_SIZE {
12+
ER_IROM1 MBED_APP_START MBED_APP_SIZE {
13+
*.o (RESET, +First)
14+
*(InRoot$$Sections)
15+
.ANY (+RO)
16+
}
17+
RW_IRAM0 0x20003288 UNINIT 0x000000F8 { ;no init section
18+
*(*noinit)
19+
}
20+
RW_IRAM1 0x20003380 0x0003cc80 {
21+
.ANY (+RW +ZI)
22+
}
23+
}

targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/device/TOOLCHAIN_GCC_ARM/NRF52840.ld

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,17 @@
1616

1717
/* Linker script to configure memory regions. */
1818

19+
#if !defined(MBED_APP_START)
20+
#define MBED_APP_START 0x21000
21+
#endif
22+
23+
#if !defined(MBED_APP_SIZE)
24+
#define MBED_APP_SIZE 0xDF000
25+
#endif
26+
1927
MEMORY
2028
{
21-
FLASH (rx) : ORIGIN = 0x21000, LENGTH = 0xDF000
29+
FLASH (rx) : ORIGIN = MBED_APP_START, LENGTH = MBED_APP_SIZE
2230
RAM (rwx) : ORIGIN = 0x20003288, LENGTH = 0x3cd78
2331
}
2432

@@ -130,7 +138,7 @@ SECTIONS
130138
PROVIDE(__start_fs_data = .);
131139
KEEP(*(.fs_data))
132140
PROVIDE(__stop_fs_data = .);
133-
141+
134142
*(.jcr)
135143
. = ALIGN(4);
136144
/* All data end */
@@ -146,7 +154,7 @@ SECTIONS
146154
KEEP(*(.noinit))
147155
PROVIDE(__stop_noinit = .);
148156
} > RAM
149-
157+
150158
.bss :
151159
{
152160
. = ALIGN(4);

targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/device/TOOLCHAIN_IAR/nRF52832.icf renamed to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/device/TOOLCHAIN_IAR/nRF52840.icf

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,26 @@
11
/*###ICF### Section handled by ICF editor, don't touch! ****/
22
/*-Editor annotation file-*/
33
/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
4+
5+
if (!isdefinedsymbol(MBED_APP_START)) {
6+
define symbol MBED_APP_START = 0x21000;
7+
}
8+
9+
if (!isdefinedsymbol(MBED_APP_SIZE)) {
10+
define symbol MBED_APP_SIZE = 0xDF000;
11+
}
12+
413
/*-Specials-*/
5-
define symbol __ICFEDIT_intvec_start__ = 0x21000;
14+
define symbol __ICFEDIT_intvec_start__ = MBED_APP_START;
15+
616
/*-Memory Regions-*/
7-
define symbol __ICFEDIT_region_ROM_start__ = 0x21000;
8-
define symbol __ICFEDIT_region_ROM_end__ = 0xfffff;
17+
define symbol __ICFEDIT_region_ROM_start__ = MBED_APP_START;
18+
define symbol __ICFEDIT_region_ROM_end__ = MBED_APP_START + MBED_APP_SIZE - 1;
919
define symbol __ICFEDIT_region_RAM_start__ = 0x20003288;
1020
define symbol __ICFEDIT_region_RAM_end__ = 0x2003ffff;
1121
export symbol __ICFEDIT_region_RAM_start__;
1222
export symbol __ICFEDIT_region_RAM_end__;
23+
1324
/*-Sizes-*/
1425
/*Heap 1/4 of ram and stack 1/8*/
1526
define symbol __ICFEDIT_size_cstack__ = 0x800;

targets/targets.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3271,7 +3271,8 @@
32713271
"macros_add": ["BOARD_PCA10056", "CONFIG_GPIO_AS_PINRESET", "SWI_DISABLE0", "NRF52_ERRATA_20"],
32723272
"device_has_add": ["FLASH", "ANALOGIN", "I2C", "I2C_ASYNCH", "INTERRUPTIN", "LOWPOWERTIMER", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SERIAL_FC", "SLEEP", "SPI", "SPISLAVE", "TRNG"],
32733273
"release_versions": ["2", "5"],
3274-
"device_name": "nRF52840_xxAA"
3274+
"device_name": "nRF52840_xxAA",
3275+
"bootloader_supported": true
32753276
},
32763277
"BLUEPILL_F103C8": {
32773278
"inherits": ["FAMILY_STM32"],

0 commit comments

Comments
 (0)