Skip to content

Commit 7e796e9

Browse files
Update linker script to Mbed CE standard
1 parent 7654ff7 commit 7e796e9

File tree

3 files changed

+34
-60
lines changed

3 files changed

+34
-60
lines changed

targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/PeripheralPins.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ const PinMap PinMap_I2C_testing[] = {
6767
{P0_23, 0, 0},
6868
{P0_24, 0, 0},
6969
{P0_25, 0, 0},
70+
{P0_26, 0, 0},
71+
{P0_27, 0, 0},
7072
{P0_28, 0, 0},
7173
{P0_29, 0, 0},
7274
{P0_30, 0, 0},
@@ -120,6 +122,8 @@ const PinMap PinMap_SPI_testing[] = {
120122
{P0_23, 0, 0},
121123
{P0_24, 0, 0},
122124
{P0_25, 0, 0},
125+
{P0_26, 0, 0},
126+
{P0_27, 0, 0},
123127
{P0_28, 0, 0},
124128
{P0_29, 0, 0},
125129
{P0_30, 0, 0},
@@ -173,6 +177,8 @@ const PinMap PinMap_UART_testing[] = {
173177
{P0_23, 0, 0},
174178
{P0_24, 0, 0},
175179
{P0_25, 0, 0},
180+
{P0_26, 0, 0},
181+
{P0_27, 0, 0},
176182
{P0_28, 0, 0},
177183
{P0_29, 0, 0},
178184
{P0_30, 0, 0},
@@ -226,6 +232,8 @@ const PinMap PinMap_PWM_testing[] = {
226232
{P0_23, 0, 0},
227233
{P0_24, 0, 0},
228234
{P0_25, 0, 0},
235+
{P0_26, 0, 0},
236+
{P0_27, 0, 0},
229237
{P0_28, 0, 0},
230238
{P0_29, 0, 0},
231239
{P0_30, 0, 0},
@@ -279,6 +287,8 @@ const PinMap PinMap_QSPI_testing[] = {
279287
{P0_23, 0, 0},
280288
{P0_24, 0, 0},
281289
{P0_25, 0, 0},
290+
{P0_26, 0, 0},
291+
{P0_27, 0, 0},
282292
{P0_28, 0, 0},
283293
{P0_29, 0, 0},
284294
{P0_30, 0, 0},

targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/device/TOOLCHAIN_GCC_ARM/NRF52840.ld

Lines changed: 24 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -16,42 +16,17 @@
1616

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

19-
/* Default to no softdevice */
20-
#if !defined(MBED_APP_START)
21-
#define MBED_APP_START 0x0
22-
#endif
23-
24-
#if !defined(MBED_APP_SIZE)
25-
#define MBED_APP_SIZE 0x100000
26-
#endif
27-
28-
#if !defined(MBED_RAM_START)
29-
#define MBED_RAM_START 0x20000000
30-
#define MBED_RAM_SIZE 0x40000
31-
#endif
32-
3319
#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
3420
#define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x800
3521
#endif
36-
37-
#define MBED_RAM0_START MBED_RAM_START
38-
#define MBED_RAM0_SIZE 0x100
39-
40-
#define MBED_CRASH_REPORT_RAM_START (MBED_RAM0_START + MBED_RAM0_SIZE)
4122
#define MBED_CRASH_REPORT_RAM_SIZE 0x100
4223

43-
#define MBED_RAM1_START (MBED_CRASH_REPORT_RAM_START + MBED_CRASH_REPORT_RAM_SIZE)
44-
#define MBED_RAM1_SIZE (MBED_RAM_SIZE - (MBED_RAM0_SIZE + MBED_CRASH_REPORT_RAM_SIZE))
45-
4624
MEMORY
4725
{
48-
FLASH (rx) : ORIGIN = MBED_APP_START, LENGTH = MBED_APP_SIZE
49-
RAM_NVIC (rwx) : ORIGIN = MBED_RAM0_START, LENGTH = MBED_RAM0_SIZE
50-
RAM_CRASH_DATA (rwx) : ORIGIN = MBED_CRASH_REPORT_RAM_START, LENGTH = MBED_CRASH_REPORT_RAM_SIZE
51-
RAM (rwx) : ORIGIN = MBED_RAM1_START, LENGTH = MBED_RAM1_SIZE
26+
FLASH (rx) : ORIGIN = MBED_CONFIGURED_ROM_BANK_IROM1_START, LENGTH = MBED_CONFIGURED_ROM_BANK_IROM1_SIZE
27+
RAM (rwx) : ORIGIN = MBED_RAM_BANK_IRAM1_START, LENGTH = MBED_RAM_BANK_IRAM1_SIZE
5228
}
5329

54-
5530
OUTPUT_FORMAT ("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
5631

5732
/* Linker script to place sections and symbol values. Should be used together
@@ -84,6 +59,28 @@ ENTRY(Reset_Handler)
8459

8560
SECTIONS
8661
{
62+
/* RAM vector table */
63+
.nvictable (NOLOAD) :
64+
{
65+
PROVIDE(__start_nvictable = .);
66+
KEEP(*(.nvictable))
67+
PROVIDE(__stop_nvictable = .);
68+
} > RAM
69+
70+
/* Crash data RAM (preserved across resets) */
71+
.crash_data_ram (NOLOAD):
72+
{
73+
. = ALIGN(8);
74+
__CRASH_DATA_RAM__ = .;
75+
__CRASH_DATA_RAM_START__ = .; /* Create a global symbol at data start */
76+
. += MBED_CRASH_REPORT_RAM_SIZE;
77+
__CRASH_DATA_RAM_END__ = .; /* Define a global symbol at data end */
78+
79+
/* Include any used-defined data in the crash data RAM */
80+
KEEP(*(.keep.crash_data_ram))
81+
*(.m_crash_data_ram)
82+
} > RAM
83+
8784
.text :
8885
{
8986
KEEP(*(.Vectors))
@@ -201,25 +198,6 @@ SECTIONS
201198

202199
__edata = .;
203200

204-
.nvictable (NOLOAD) :
205-
{
206-
PROVIDE(__start_nvictable = .);
207-
KEEP(*(.nvictable))
208-
PROVIDE(__stop_nvictable = .);
209-
} > RAM_NVIC
210-
211-
.crash_data_ram :
212-
{
213-
. = ALIGN(8);
214-
__CRASH_DATA_RAM__ = .;
215-
__CRASH_DATA_RAM_START__ = .; /* Create a global symbol at data start */
216-
KEEP(*(.keep.crash_data_ram))
217-
*(.m_crash_data_ram) /* This is a user defined section */
218-
. += MBED_CRASH_REPORT_RAM_SIZE;
219-
. = ALIGN(8);
220-
__CRASH_DATA_RAM_END__ = .; /* Define a global symbol at data end */
221-
} > RAM_CRASH_DATA
222-
223201
.noinit (NOLOAD) :
224202
{
225203
PROVIDE(__start_noinit = .);

targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/device/cmsis_nvic.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,6 @@
3535
#define NVIC_NUM_VECTORS (16 + 48) // CORE + MCU Peripherals
3636
#define NVIC_USER_IRQ_OFFSET 16
3737

38-
// RAM size defines, same as in the linker script
39-
#if !defined(MBED_APP_START)
40-
#define MBED_APP_START 0x0
41-
#endif
42-
43-
#if !defined(MBED_APP_SIZE)
44-
#define MBED_APP_SIZE 0x100000
45-
#endif
46-
47-
#if !defined(MBED_RAM_START)
48-
#define MBED_RAM_START 0x20000000
49-
#define MBED_RAM_SIZE 0x40000
50-
#endif
51-
5238
#include "nrf.h"
5339
#include "cmsis.h"
5440

0 commit comments

Comments
 (0)