Browse Source
With all the variation in chips and boards it's tedious to copy and redefine linker scripts for every option. Making linker scripts more modular also opens up more possibilities, like enabling/disabling the flash file system from the Makefile - or even defining it's size from a Makefile argument (FS_SIZE=12 for a 12kB filesystem if tight on space).pull/3137/merge
Ayke van Laethem
7 years ago
committed by
Damien George
42 changed files with 102 additions and 321 deletions
@ -1,7 +1,8 @@ |
|||
MCU_SERIES = m4 |
|||
MCU_VARIANT = nrf52 |
|||
MCU_SUB_VARIANT = nrf52832 |
|||
LD_FILE = boards/nrf52832_512k_64k.ld |
|||
SOFTDEV_VERSION = 3.0.0 |
|||
LD_FILES += boards/nrf52832_512k_64k.ld |
|||
FLASHER = pyocd |
|||
|
|||
NRF_DEFINES += -DNRF52832_XXAA |
|||
|
@ -1,9 +0,0 @@ |
|||
MCU_SERIES = m4 |
|||
MCU_VARIANT = nrf52 |
|||
MCU_SUB_VARIANT = nrf52832 |
|||
SOFTDEV_VERSION = 3.0.0 |
|||
FLASHER=pyocd |
|||
|
|||
LD_FILE = boards/nrf52832_512k_64k_s132_$(SOFTDEV_VERSION).ld |
|||
|
|||
NRF_DEFINES += -DNRF52832_XXAA |
@ -1,6 +1,8 @@ |
|||
MCU_SERIES = m4 |
|||
MCU_VARIANT = nrf52 |
|||
MCU_SUB_VARIANT = nrf52832 |
|||
LD_FILE = boards/nrf52832_512k_64k.ld |
|||
SOFTDEV_VERSION = 3.0.0 |
|||
LD_FILES += boards/nrf52832_512k_64k.ld |
|||
|
|||
NRF_DEFINES += -DNRF52832_XXAA |
|||
CFLAGS += -DBLUETOOTH_LFCLK_RC |
|||
|
@ -1,10 +0,0 @@ |
|||
MCU_SERIES = m4 |
|||
MCU_VARIANT = nrf52 |
|||
MCU_SUB_VARIANT = nrf52832 |
|||
SOFTDEV_VERSION = 3.0.0 |
|||
|
|||
LD_FILE = boards/nrf52832_512k_64k_s132_$(SOFTDEV_VERSION).ld |
|||
|
|||
NRF_DEFINES += -DNRF52832_XXAA |
|||
CFLAGS += -DBLUETOOTH_LFCLK_RC |
|||
|
@ -1,25 +0,0 @@ |
|||
MCU_SERIES = m4 |
|||
MCU_VARIANT = nrf52 |
|||
MCU_SUB_VARIANT = nrf52832 |
|||
SOFTDEV_VERSION = 2.0.1 |
|||
|
|||
LD_FILE = boards/feather52/custom_nrf52832_dfu_app.ld |
|||
|
|||
NRF_DEFINES += -DNRF52832_XXAA |
|||
|
|||
|
|||
check_defined = \
|
|||
$(strip $(foreach 1,$1, \
|
|||
$(call __check_defined,$1,$(strip $(value 2))))) |
|||
__check_defined = \
|
|||
$(if $(value $1),, \
|
|||
$(error Undefined make flag: $1$(if $2, ($2)))) |
|||
|
|||
.PHONY: dfu-gen dfu-flash |
|||
|
|||
dfu-gen: |
|||
nrfutil dfu genpkg --dev-type 0x0052 --application $(BUILD)/$(OUTPUT_FILENAME).hex $(BUILD)/dfu-package.zip |
|||
|
|||
dfu-flash: |
|||
@:$(call check_defined, SERIAL, example: SERIAL=/dev/ttyUSB0) |
|||
sudo nrfutil dfu serial --package $(BUILD)/dfu-package.zip -p $(SERIAL) |
@ -0,0 +1,19 @@ |
|||
|
|||
/* Flash layout: softdevice | application | filesystem */ |
|||
/* RAM layout: softdevice RAM | application RAM */ |
|||
_sd_size = DEFINED(_sd_size) ? _sd_size : 0; |
|||
_sd_ram = DEFINED(_sd_ram) ? _sd_ram : 0; |
|||
_fs_size = DEFINED(_fs_size) ? _fs_size : 64K; /* TODO: set to 0 if not using the filesystem */ |
|||
_app_size = _flash_size - _sd_size - _fs_size; |
|||
_app_start = _sd_size; |
|||
_fs_start = _sd_size + _app_size; |
|||
_fs_end = _fs_start + _fs_size; |
|||
_app_ram_start = 0x20000000 + _sd_ram; |
|||
_app_ram_size = _ram_size - _sd_ram; |
|||
|
|||
/* Specify the memory areas */ |
|||
MEMORY |
|||
{ |
|||
FLASH_TEXT (rx) : ORIGIN = _app_start, LENGTH = _app_size /* app */ |
|||
RAM (xrw) : ORIGIN = _app_ram_start, LENGTH = _app_ram_size |
|||
} |
@ -1,19 +1 @@ |
|||
/* |
|||
GNU linker script for NRF51822 AA w/ S110 8.0.0 SoftDevice |
|||
*/ |
|||
/* Specify the memory areas */ |
|||
SEARCH_DIR(.) |
|||
GROUP(-lgcc -lc -lnosys) |
|||
MEMORY |
|||
{ |
|||
FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 256K /* entire flash */ |
|||
FLASH_TEXT (rx) : ORIGIN = 0x00018000, LENGTH = 148K /* app */ |
|||
FLASH_USER (rx) : ORIGIN = 0x0003D000, LENGTH = 12K /* app data, filesystem */ |
|||
RAM (xrw) : ORIGIN = 0x20002000, LENGTH = 8K /* app RAM */ |
|||
} |
|||
|
|||
/* produce a link error if there is not this amount of RAM for these sections */ |
|||
_stack_size = 2K; |
|||
_minimum_heap_size = 1K; |
|||
|
|||
INCLUDE "boards/common.ld" |
|||
_fs_size = 12K; |
|||
|
@ -1,5 +1,11 @@ |
|||
MCU_SERIES = m0 |
|||
MCU_VARIANT = nrf51 |
|||
MCU_SUB_VARIANT = nrf51822 |
|||
LD_FILE = boards/nrf51x22_256k_16k.ld |
|||
SOFTDEV_VERSION = 8.0.0 |
|||
ifneq ($(SD),) |
|||
LD_FILES += boards/microbit/custom_nrf51822_s110_microbit.ld |
|||
endif |
|||
LD_FILES += boards/nrf51x22_256k_16k.ld |
|||
FLASHER = pyocd |
|||
|
|||
CFLAGS += -DBLUETOOTH_LFCLK_RC |
|||
|
@ -1,8 +0,0 @@ |
|||
MCU_SERIES = m0 |
|||
MCU_VARIANT = nrf51 |
|||
MCU_SUB_VARIANT = nrf51822 |
|||
SOFTDEV_VERSION = 8.0.0 |
|||
LD_FILE = boards/microbit/custom_nrf51822_s110_microbit.ld |
|||
FLASHER = pyocd |
|||
|
|||
CFLAGS += -DBLUETOOTH_LFCLK_RC |
@ -1,19 +1,12 @@ |
|||
/* |
|||
GNU linker script for NRF51 AA w/ no SoftDevice |
|||
GNU linker script for NRF51 AA |
|||
*/ |
|||
/* Specify the memory areas */ |
|||
SEARCH_DIR(.) |
|||
GROUP(-lgcc -lc -lnosys) |
|||
MEMORY |
|||
{ |
|||
FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 256K /* entire flash */ |
|||
FLASH_TEXT (rx) : ORIGIN = 0x00000000, LENGTH = 192K /* app */ |
|||
FLASH_USER (rx) : ORIGIN = 0x00030000, LENGTH = 64K /* app data, filesystem */ |
|||
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 16K /* use all RAM */ |
|||
} |
|||
|
|||
/* produce a link error if there is not this amount of RAM for these sections */ |
|||
_stack_size = 4K; |
|||
_minimum_heap_size = 8K; |
|||
|
|||
INCLUDE "boards/common.ld" |
|||
_flash_size = 256K; |
|||
_ram_size = 16K; |
|||
|
|||
/* Default stack size when there is no SoftDevice */ |
|||
_stack_size = 4K; |
|||
_minimum_heap_size = 8K; |
|||
|
@ -1,19 +0,0 @@ |
|||
/* |
|||
GNU linker script for NRF51822 AA w/ S110 8.0.0 SoftDevice |
|||
*/ |
|||
/* Specify the memory areas */ |
|||
SEARCH_DIR(.) |
|||
GROUP(-lgcc -lc -lnosys) |
|||
MEMORY |
|||
{ |
|||
FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 256K /* entire flash */ |
|||
FLASH_TEXT (rx) : ORIGIN = 0x00018000, LENGTH = 140K /* app */ |
|||
FLASH_USER (rx) : ORIGIN = 0x0003B000, LENGTH = 20K /* app data, filesystem */ |
|||
RAM (xrw) : ORIGIN = 0x20002000, LENGTH = 8K /* app RAM */ |
|||
} |
|||
|
|||
/* produce a link error if there is not this amount of RAM for these sections */ |
|||
_stack_size = 2K; |
|||
_minimum_heap_size = 4K; |
|||
|
|||
INCLUDE "boards/common.ld" |
@ -1,19 +1,12 @@ |
|||
/* |
|||
GNU linker script for NRF51 AC w/ no SoftDevice |
|||
GNU linker script for NRF51 AC |
|||
*/ |
|||
/* Specify the memory areas */ |
|||
SEARCH_DIR(.) |
|||
GROUP(-lgcc -lc -lnosys) |
|||
MEMORY |
|||
{ |
|||
FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 256K /* entire flash */ |
|||
FLASH_TEXT (rx) : ORIGIN = 0x00000000, LENGTH = 192K /* app */ |
|||
FLASH_USER (rx) : ORIGIN = 0x00030000, LENGTH = 64K /* app data, filesystem */ |
|||
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 32K /* use all RAM */ |
|||
} |
|||
|
|||
/* produce a link error if there is not this amount of RAM for these sections */ |
|||
_stack_size = 4K; |
|||
_minimum_heap_size = 24K; |
|||
|
|||
INCLUDE "boards/common.ld" |
|||
_flash_size = 256K; |
|||
_ram_size = 32K; |
|||
|
|||
/* Default stack size when there is no SoftDevice */ |
|||
_stack_size = 4K; |
|||
_minimum_heap_size = 24K; |
|||
|
@ -1,19 +0,0 @@ |
|||
/* |
|||
GNU linker script for NRF51822 AC w/ S110 8.0.0 SoftDevice |
|||
*/ |
|||
/* Specify the memory areas */ |
|||
SEARCH_DIR(.) |
|||
GROUP(-lgcc -lc -lnosys) |
|||
MEMORY |
|||
{ |
|||
FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 256K /* entire flash */ |
|||
FLASH_TEXT (rx) : ORIGIN = 0x00018000, LENGTH = 140K /* app */ |
|||
FLASH_USER (rx) : ORIGIN = 0x0003B000, LENGTH = 20K /* app data, filesystem */ |
|||
RAM (xrw) : ORIGIN = 0x20002000, LENGTH = 24K /* app RAM */ |
|||
} |
|||
|
|||
/* produce a link error if there is not this amount of RAM for these sections */ |
|||
_stack_size = 4K; |
|||
_minimum_heap_size = 1K; |
|||
|
|||
INCLUDE "boards/common.ld" |
@ -1,19 +0,0 @@ |
|||
/* |
|||
GNU linker script for NRF51822 AC w/ S120 2.1.0 SoftDevice |
|||
*/ |
|||
/* Specify the memory areas */ |
|||
SEARCH_DIR(.) |
|||
GROUP(-lgcc -lc -lnosys) |
|||
MEMORY |
|||
{ |
|||
FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 256K /* entire flash */ |
|||
FLASH_TEXT (rx) : ORIGIN = 0x0001D000, LENGTH = 130K /* app */ |
|||
FLASH_USER (rx) : ORIGIN = 0x0003D800, LENGTH = 10K /* app data, filesystem */ |
|||
RAM (xrw) : ORIGIN = 0x20002800, LENGTH = 22K /* app RAM */ |
|||
} |
|||
|
|||
/* produce a link error if there is not this amount of RAM for these sections */ |
|||
_stack_size = 4K; |
|||
_minimum_heap_size = 4K; |
|||
|
|||
INCLUDE "boards/common.ld" |
@ -1,19 +0,0 @@ |
|||
/* |
|||
GNU linker script for NRF51822 AC w/ S130 2.0.1 SoftDevice |
|||
*/ |
|||
/* Specify the memory areas */ |
|||
SEARCH_DIR(.) |
|||
GROUP(-lgcc -lc -lnosys) |
|||
MEMORY |
|||
{ |
|||
FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 256K /* entire flash */ |
|||
FLASH_TEXT (rx) : ORIGIN = 0x0001B000, LENGTH = 130K /* app */ |
|||
FLASH_USER (rx) : ORIGIN = 0x0003B000, LENGTH = 18K /* app data, filesystem */ |
|||
RAM (xrw) : ORIGIN = 0x200013c8, LENGTH = 0x006c38 /* 27 KiB */ |
|||
} |
|||
|
|||
/* produce a link error if there is not this amount of RAM for these sections */ |
|||
_stack_size = 4K; |
|||
_minimum_heap_size = 6K; |
|||
|
|||
INCLUDE "boards/common.ld" |
@ -1,18 +0,0 @@ |
|||
/* |
|||
GNU linker script for NRF52 w/ s132 2.0.1 SoftDevice |
|||
*/ |
|||
|
|||
/* Specify the memory areas */ |
|||
MEMORY |
|||
{ |
|||
FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 512K /* entire flash */ |
|||
FLASH_TEXT (rx) : ORIGIN = 0x0001c000, LENGTH = 336K /* app */ |
|||
FLASH_USER (rx) : ORIGIN = 0x00070000, LENGTH = 64K /* app data, filesystem */ |
|||
RAM (xrw) : ORIGIN = 0x200039c0, LENGTH = 0x0c640 /* 49.5 KiB, give 8KiB headroom for softdevice */ |
|||
} |
|||
|
|||
/* produce a link error if there is not this amount of RAM for these sections */ |
|||
_stack_size = 8K; |
|||
_minimum_heap_size = 16K; |
|||
|
|||
INCLUDE "boards/common.ld" |
@ -1,18 +0,0 @@ |
|||
/* |
|||
GNU linker script for NRF52 w/ s132 3.0.0 SoftDevice |
|||
*/ |
|||
|
|||
/* Specify the memory areas */ |
|||
MEMORY |
|||
{ |
|||
FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 512K /* entire flash */ |
|||
FLASH_TEXT (rx) : ORIGIN = 0x0001F000, LENGTH = 324K /* app */ |
|||
FLASH_USER (rx) : ORIGIN = 0x00070000, LENGTH = 64K /* app data, filesystem */ |
|||
RAM (xrw) : ORIGIN = 0x200039c0, LENGTH = 0x0c640 /* 49.5 KiB, give 8KiB headroom for softdevice */ |
|||
} |
|||
|
|||
/* produce a link error if there is not this amount of RAM for these sections */ |
|||
_stack_size = 8K; |
|||
_minimum_heap_size = 16K; |
|||
|
|||
INCLUDE "boards/common.ld" |
@ -1,4 +1,5 @@ |
|||
MCU_SERIES = m0 |
|||
MCU_VARIANT = nrf51 |
|||
MCU_SUB_VARIANT = nrf51822 |
|||
LD_FILE = boards/nrf51x22_256k_16k.ld |
|||
SOFTDEV_VERSION = 8.0.0 |
|||
LD_FILES += boards/nrf51x22_256k_16k.ld |
|||
|
@ -1,5 +0,0 @@ |
|||
MCU_SERIES = m0 |
|||
MCU_VARIANT = nrf51 |
|||
MCU_SUB_VARIANT = nrf51822 |
|||
SOFTDEV_VERSION = 8.0.0 |
|||
LD_FILE = boards/nrf51x22_256k_16k_s110_$(SOFTDEV_VERSION).ld |
@ -1,4 +1,5 @@ |
|||
MCU_SERIES = m0 |
|||
MCU_VARIANT = nrf51 |
|||
MCU_SUB_VARIANT = nrf51822 |
|||
LD_FILE = boards/nrf51x22_256k_16k.ld |
|||
SOFTDEV_VERSION = 8.0.0 |
|||
LD_FILES += boards/nrf51x22_256k_16k.ld |
|||
|
@ -1,5 +0,0 @@ |
|||
MCU_SERIES = m0 |
|||
MCU_VARIANT = nrf51 |
|||
MCU_SUB_VARIANT = nrf51822 |
|||
SOFTDEV_VERSION = 8.0.0 |
|||
LD_FILE = boards/nrf51x22_256k_16k_s110_$(SOFTDEV_VERSION).ld |
@ -1,4 +1,5 @@ |
|||
MCU_SERIES = m0 |
|||
MCU_VARIANT = nrf51 |
|||
MCU_SUB_VARIANT = nrf51822 |
|||
LD_FILE = boards/nrf51x22_256k_32k.ld |
|||
SOFTDEV_VERSION = 8.0.0 |
|||
LD_FILES += boards/nrf51x22_256k_32k.ld |
|||
|
@ -1,5 +0,0 @@ |
|||
MCU_SERIES = m0 |
|||
MCU_VARIANT = nrf51 |
|||
MCU_SUB_VARIANT = nrf51822 |
|||
SOFTDEV_VERSION = 8.0.0 |
|||
LD_FILE = boards/nrf51x22_256k_32k_s110_$(SOFTDEV_VERSION).ld |
@ -1,5 +0,0 @@ |
|||
MCU_SERIES = m0 |
|||
MCU_VARIANT = nrf51 |
|||
MCU_SUB_VARIANT = nrf51822 |
|||
SOFTDEV_VERSION = 2.1.0 |
|||
LD_FILE = boards/nrf51x22_256k_32k_s120_$(SOFTDEV_VERSION).ld |
@ -1,5 +0,0 @@ |
|||
MCU_SERIES = m0 |
|||
MCU_VARIANT = nrf51 |
|||
MCU_SUB_VARIANT = nrf51822 |
|||
SOFTDEV_VERSION = 2.0.1 |
|||
LD_FILE = boards/nrf51x22_256k_32k_s130_$(SOFTDEV_VERSION).ld |
@ -1,4 +1,5 @@ |
|||
MCU_SERIES = m0 |
|||
MCU_VARIANT = nrf51 |
|||
MCU_SUB_VARIANT = nrf51822 |
|||
LD_FILE = boards/nrf51x22_256k_32k.ld |
|||
SOFTDEV_VERSION = 8.0.0 |
|||
LD_FILES += boards/nrf51x22_256k_32k.ld |
|||
|
@ -1,5 +0,0 @@ |
|||
MCU_SERIES = m0 |
|||
MCU_VARIANT = nrf51 |
|||
MCU_SUB_VARIANT = nrf51822 |
|||
SOFTDEV_VERSION = 8.0.0 |
|||
LD_FILE = boards/nrf51x22_256k_32k_s110_$(SOFTDEV_VERSION).ld |
@ -1,5 +0,0 @@ |
|||
MCU_SERIES = m0 |
|||
MCU_VARIANT = nrf51 |
|||
MCU_SUB_VARIANT = nrf51822 |
|||
SOFTDEV_VERSION = 2.1.0 |
|||
LD_FILE = boards/nrf51x22_256k_32k_s120_$(SOFTDEV_VERSION).ld |
@ -1,5 +0,0 @@ |
|||
MCU_SERIES = m0 |
|||
MCU_VARIANT = nrf51 |
|||
MCU_SUB_VARIANT = nrf51822 |
|||
SOFTDEV_VERSION = 2.0.1 |
|||
LD_FILE = boards/nrf51x22_256k_32k_s130_$(SOFTDEV_VERSION).ld |
@ -1,6 +1,7 @@ |
|||
MCU_SERIES = m4 |
|||
MCU_VARIANT = nrf52 |
|||
MCU_SUB_VARIANT = nrf52832 |
|||
LD_FILE = boards/nrf52832_512k_64k.ld |
|||
SOFTDEV_VERSION = 3.0.0 |
|||
LD_FILES += boards/nrf52832_512k_64k.ld |
|||
|
|||
NRF_DEFINES += -DNRF52832_XXAA |
|||
|
@ -1,8 +0,0 @@ |
|||
MCU_SERIES = m4 |
|||
MCU_VARIANT = nrf52 |
|||
MCU_SUB_VARIANT = nrf52832 |
|||
SOFTDEV_VERSION = 3.0.0 |
|||
|
|||
LD_FILE = boards/nrf52832_512k_64k_s132_$(SOFTDEV_VERSION).ld |
|||
|
|||
NRF_DEFINES += -DNRF52832_XXAA |
@ -1,6 +1,6 @@ |
|||
MCU_SERIES = m4 |
|||
MCU_VARIANT = nrf52 |
|||
MCU_SUB_VARIANT = nrf52840 |
|||
LD_FILE = boards/nrf52840_1M_256k.ld |
|||
LD_FILES += boards/nrf52840_1M_256k.ld |
|||
|
|||
NRF_DEFINES += -DNRF52840_XXAA |
|||
|
@ -0,0 +1,9 @@ |
|||
|
|||
/* GNU linker script for s110 SoftDevice version 8.0.0 */ |
|||
|
|||
_sd_size = 0x00018000; |
|||
_sd_ram = 0x00002000; |
|||
_fs_size = DEFINED(_fs_size) ? _fs_size : 20K; |
|||
|
|||
_stack_size = _ram_size > 16K ? 4K : 2K; |
|||
_minimum_heap_size = 4K; |
@ -0,0 +1,4 @@ |
|||
/* GNU linker script for s132 SoftDevice version 3.0.0 */ |
|||
|
|||
_sd_size = 0x0001F000; |
|||
_sd_ram = 0x000039c0; |
@ -1,4 +1,7 @@ |
|||
MCU_SERIES = m0 |
|||
MCU_VARIANT = nrf51 |
|||
MCU_SUB_VARIANT = nrf51822 |
|||
LD_FILE = boards/nrf51x22_256k_16k.ld |
|||
SOFTDEV_VERSION = 8.0.0 |
|||
LD_FILES += boards/nrf51x22_256k_16k.ld |
|||
|
|||
CFLAGS += -DBLUETOOTH_LFCLK_RC |
|||
|
@ -1,7 +0,0 @@ |
|||
MCU_SERIES = m0 |
|||
MCU_VARIANT = nrf51 |
|||
MCU_SUB_VARIANT = nrf51822 |
|||
SOFTDEV_VERSION = 8.0.0 |
|||
LD_FILE = boards/nrf51x22_256k_16k_s110_$(SOFTDEV_VERSION).ld |
|||
|
|||
CFLAGS += -DBLUETOOTH_LFCLK_RC |
Loading…
Reference in new issue