nrf: allow target.mbed_ram_start and target.mbed_ram_size to override settings in linker

pull/7957/head
Andrew Leech 2018-08-31 17:25:26 +10:00
parent 340f0a6a57
commit a0d7d4eef7
6 changed files with 52 additions and 40 deletions

View File

@ -10,12 +10,14 @@
#endif #endif
/* If softdevice is present, set aside space for it */ /* If softdevice is present, set aside space for it */
#if defined(SOFTDEVICE_PRESENT) #if !defined(MBED_RAM_START)
#define MBED_RAM_START 0x200031D0 #if defined(SOFTDEVICE_PRESENT)
#define MBED_RAM_SIZE 0xCE30 #define MBED_RAM_START 0x200031D0
#else #define MBED_RAM_SIZE 0xCE30
#define MBED_RAM_START 0x20000000 #else
#define MBED_RAM_SIZE 0x10000 #define MBED_RAM_START 0x20000000
#define MBED_RAM_SIZE 0x10000
#endif
#endif #endif
#define MBED_RAM0_START MBED_RAM_START #define MBED_RAM0_START MBED_RAM_START

View File

@ -26,12 +26,14 @@
#endif #endif
/* If softdevice is present, set aside space for it */ /* If softdevice is present, set aside space for it */
#if defined(SOFTDEVICE_PRESENT) #if !defined(MBED_RAM_START)
#define MBED_RAM_START 0x200031D0 #if defined(SOFTDEVICE_PRESENT)
#define MBED_RAM_SIZE 0xCE30 #define MBED_RAM_START 0x200031D0
#else #define MBED_RAM_SIZE 0xCE30
#define MBED_RAM_START 0x20000000 #else
#define MBED_RAM_SIZE 0x10000 #define MBED_RAM_START 0x20000000
#define MBED_RAM_SIZE 0x10000
#endif
#endif #endif
#define MBED_RAM0_START MBED_RAM_START #define MBED_RAM0_START MBED_RAM_START
@ -189,7 +191,7 @@ SECTIONS
PROVIDE(__start_fs_data = .); PROVIDE(__start_fs_data = .);
KEEP(*(.fs_data)) KEEP(*(.fs_data))
PROVIDE(__stop_fs_data = .); PROVIDE(__stop_fs_data = .);
*(.jcr) *(.jcr)
. = ALIGN(4); . = ALIGN(4);
/* All data end */ /* All data end */

View File

@ -12,12 +12,14 @@ if (!isdefinedsymbol(MBED_APP_SIZE)) {
} }
/* If softdevice is present, set aside space for it */ /* If softdevice is present, set aside space for it */
if (isdefinedsymbol(SOFTDEVICE_PRESENT)) { if (!isdefinedsymbol(MBED_RAM_START)) {
define symbol MBED_RAM_START = 0x200031D0; if (isdefinedsymbol(SOFTDEVICE_PRESENT)) {
define symbol MBED_RAM_SIZE = 0xCE30; define symbol MBED_RAM_START = 0x200031D0;
} else { define symbol MBED_RAM_SIZE = 0xCE30;
define symbol MBED_RAM_START = 0x20000000; } else {
define symbol MBED_RAM_SIZE = 0x10000; define symbol MBED_RAM_START = 0x20000000;
define symbol MBED_RAM_SIZE = 0x10000;
}
} }
define symbol MBED_RAM0_START = MBED_RAM_START; define symbol MBED_RAM0_START = MBED_RAM_START;

View File

@ -9,13 +9,15 @@
#define MBED_APP_SIZE 0x100000 #define MBED_APP_SIZE 0x100000
#endif #endif
/* If app_start is 0, do not set aside space for the softdevice */ /* If softdevice is present, set aside space for it */
#if MBED_APP_START == 0 #if !defined(MBED_RAM_START)
#define MBED_RAM_START 0x20000000 #if defined(SOFTDEVICE_PRESENT)
#define MBED_RAM_SIZE 0x40000 #define MBED_RAM_START 0x20003188
#else #define MBED_RAM_SIZE 0x3CE78
#define MBED_RAM_START 0x20003188 #else
#define MBED_RAM_SIZE 0x3CE78 #define MBED_RAM_START 0x20000000
#define MBED_RAM_SIZE 0x40000
#endif
#endif #endif
#define MBED_RAM0_START MBED_RAM_START #define MBED_RAM0_START MBED_RAM_START

View File

@ -25,13 +25,15 @@
#define MBED_APP_SIZE 0x100000 #define MBED_APP_SIZE 0x100000
#endif #endif
/* If app_start is 0, do not set aside space for the softdevice */ /* If softdevice is present, set aside space for it */
#if MBED_APP_START == 0 #if !defined(MBED_RAM_START)
#define MBED_RAM_START 0x20000000 #if defined(SOFTDEVICE_PRESENT)
#define MBED_RAM_SIZE 0x40000 #define MBED_RAM_START 0x20003188
#else #define MBED_RAM_SIZE 0x3CE78
#define MBED_RAM_START 0x20003188 #else
#define MBED_RAM_SIZE 0x3CE78 #define MBED_RAM_START 0x20000000
#define MBED_RAM_SIZE 0x40000
#endif
#endif #endif
#define MBED_RAM0_START MBED_RAM_START #define MBED_RAM0_START MBED_RAM_START

View File

@ -11,13 +11,15 @@ if (!isdefinedsymbol(MBED_APP_SIZE)) {
define symbol MBED_APP_SIZE = 0x100000; define symbol MBED_APP_SIZE = 0x100000;
} }
/* If app_start is 0, do not set aside space for the softdevice */ /* If softdevice is present, set aside space for it */
if (MBED_APP_START == 0) { if (!isdefinedsymbol(MBED_RAM_START)) {
define symbol MBED_RAM_START = 0x20000000; if (isdefinedsymbol(SOFTDEVICE_PRESENT)) {
define symbol MBED_RAM_SIZE = 0x40000; define symbol MBED_RAM_START = 0x20003188;
} else { define symbol MBED_RAM_SIZE = 0x3CE78;
define symbol MBED_RAM_START = 0x20003188; } else {
define symbol MBED_RAM_SIZE = 0x3CE78; define symbol MBED_RAM_START = 0x20000000;
define symbol MBED_RAM_SIZE = 0x40000;
}
} }
define symbol MBED_RAM0_START = MBED_RAM_START; define symbol MBED_RAM0_START = MBED_RAM_START;