diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/device/TOOLCHAIN_ARM_STD/nRF52832.sct b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/device/TOOLCHAIN_ARM_STD/nRF52832.sct deleted file mode 100644 index 496f79dfea..0000000000 --- a/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/device/TOOLCHAIN_ARM_STD/nRF52832.sct +++ /dev/null @@ -1,13 +0,0 @@ -LR_IROM1 0x21000 0x00DF000 { - ER_IROM1 0x21000 0x00DF000 { - *.o (RESET, +First) - *(InRoot$$Sections) - .ANY (+RO) - } - RW_IRAM0 0x20003288 UNINIT 0x000000F8 { ;no init section - *(*noinit) - } - RW_IRAM1 0x20003380 0x0003cc80 { - .ANY (+RW +ZI) - } -} diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/device/TOOLCHAIN_ARM_STD/nRF52840.sct b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/device/TOOLCHAIN_ARM_STD/nRF52840.sct new file mode 100644 index 0000000000..0aaa703e9f --- /dev/null +++ b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/device/TOOLCHAIN_ARM_STD/nRF52840.sct @@ -0,0 +1,23 @@ +#! armcc -E + +#if !defined(MBED_APP_START) + #define MBED_APP_START 0x21000 +#endif + +#if !defined(MBED_APP_SIZE) + #define MBED_APP_SIZE 0xDF000 +#endif + +LR_IROM1 MBED_APP_START MBED_APP_SIZE { + ER_IROM1 MBED_APP_START MBED_APP_SIZE { + *.o (RESET, +First) + *(InRoot$$Sections) + .ANY (+RO) + } + RW_IRAM0 0x20003288 UNINIT 0x000000F8 { ;no init section + *(*noinit) + } + RW_IRAM1 0x20003380 0x0003cc80 { + .ANY (+RW +ZI) + } +} diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/device/TOOLCHAIN_GCC_ARM/NRF52840.ld b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/device/TOOLCHAIN_GCC_ARM/NRF52840.ld index 16b5bf1d4f..6f4fe7a0ec 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/device/TOOLCHAIN_GCC_ARM/NRF52840.ld +++ b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/device/TOOLCHAIN_GCC_ARM/NRF52840.ld @@ -16,9 +16,17 @@ /* Linker script to configure memory regions. */ +#if !defined(MBED_APP_START) + #define MBED_APP_START 0x21000 +#endif + +#if !defined(MBED_APP_SIZE) + #define MBED_APP_SIZE 0xDF000 +#endif + MEMORY { - FLASH (rx) : ORIGIN = 0x21000, LENGTH = 0xDF000 + FLASH (rx) : ORIGIN = MBED_APP_START, LENGTH = MBED_APP_SIZE RAM (rwx) : ORIGIN = 0x20003288, LENGTH = 0x3cd78 } @@ -130,7 +138,7 @@ SECTIONS PROVIDE(__start_fs_data = .); KEEP(*(.fs_data)) PROVIDE(__stop_fs_data = .); - + *(.jcr) . = ALIGN(4); /* All data end */ @@ -146,7 +154,7 @@ SECTIONS KEEP(*(.noinit)) PROVIDE(__stop_noinit = .); } > RAM - + .bss : { . = ALIGN(4); diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/device/TOOLCHAIN_IAR/nRF52832.icf b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/device/TOOLCHAIN_IAR/nRF52840.icf similarity index 82% rename from targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/device/TOOLCHAIN_IAR/nRF52832.icf rename to targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/device/TOOLCHAIN_IAR/nRF52840.icf index 6c0e4f7eba..7561156daa 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/device/TOOLCHAIN_IAR/nRF52832.icf +++ b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF52840/device/TOOLCHAIN_IAR/nRF52840.icf @@ -1,15 +1,26 @@ /*###ICF### Section handled by ICF editor, don't touch! ****/ /*-Editor annotation file-*/ /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */ + +if (!isdefinedsymbol(MBED_APP_START)) { + define symbol MBED_APP_START = 0x21000; +} + +if (!isdefinedsymbol(MBED_APP_SIZE)) { + define symbol MBED_APP_SIZE = 0xDF000; +} + /*-Specials-*/ -define symbol __ICFEDIT_intvec_start__ = 0x21000; +define symbol __ICFEDIT_intvec_start__ = MBED_APP_START; + /*-Memory Regions-*/ -define symbol __ICFEDIT_region_ROM_start__ = 0x21000; -define symbol __ICFEDIT_region_ROM_end__ = 0xfffff; +define symbol __ICFEDIT_region_ROM_start__ = MBED_APP_START; +define symbol __ICFEDIT_region_ROM_end__ = MBED_APP_START + MBED_APP_SIZE - 1; define symbol __ICFEDIT_region_RAM_start__ = 0x20003288; define symbol __ICFEDIT_region_RAM_end__ = 0x2003ffff; export symbol __ICFEDIT_region_RAM_start__; export symbol __ICFEDIT_region_RAM_end__; + /*-Sizes-*/ /*Heap 1/4 of ram and stack 1/8*/ define symbol __ICFEDIT_size_cstack__ = 0x800; diff --git a/targets/targets.json b/targets/targets.json index 490a53ee4a..7cea3032d5 100644 --- a/targets/targets.json +++ b/targets/targets.json @@ -3271,7 +3271,8 @@ "macros_add": ["BOARD_PCA10056", "CONFIG_GPIO_AS_PINRESET", "SWI_DISABLE0", "NRF52_ERRATA_20"], "device_has_add": ["FLASH", "ANALOGIN", "I2C", "I2C_ASYNCH", "INTERRUPTIN", "LOWPOWERTIMER", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SERIAL_FC", "SLEEP", "SPI", "SPISLAVE", "TRNG"], "release_versions": ["2", "5"], - "device_name": "nRF52840_xxAA" + "device_name": "nRF52840_xxAA", + "bootloader_supported": true }, "BLUEPILL_F103C8": { "inherits": ["FAMILY_STM32"],