From f7328a897d5ae709d2e63bffb9196cb75855c96c Mon Sep 17 00:00:00 2001 From: hathach Date: Mon, 8 Jan 2018 13:00:16 +0700 Subject: [PATCH] update linker script for single bank --- boards.txt | 2 + cores/nRF5/linker/bluefruit52_s132_2.0.1.ld | 46 ------------------- .../linker/bluefruit52_s132_5.1.0_single.ld | 38 +++++++++++++++ platform.txt | 2 - 4 files changed, 40 insertions(+), 48 deletions(-) delete mode 100755 cores/nRF5/linker/bluefruit52_s132_2.0.1.ld create mode 100755 cores/nRF5/linker/bluefruit52_s132_5.1.0_single.ld diff --git a/boards.txt b/boards.txt index e115eb4e..414f56b9 100644 --- a/boards.txt +++ b/boards.txt @@ -43,6 +43,7 @@ feather52.menu.softdevice.s132v510dual=5.1.0 Dual, S132 5.1.0 feather52.menu.softdevice.s132v510dual.build.sd_flags=-DS132 -DSD_VER=510 feather52.menu.softdevice.s132v510dual.build.sd_name=s132 feather52.menu.softdevice.s132v510dual.build.sd_version=5.1.0 +feather52.menu.softdevice.s132v510dual.build.ldscript=bluefruit52_s132_5.1.0_dual.ld feather52.menu.softdevice.s132v510dual.build.bootfile=dual/feather52_bootloader_5.1.0_s132_dual feather52.menu.softdevice.s132v510dual.upload.maximum_size=151552 feather52.menu.softdevice.s132v510dual.upload.maximum_data_size=51072 @@ -51,6 +52,7 @@ feather52.menu.softdevice.s132v510single=5.1.0 Single, S132 5.1.0 feather52.menu.softdevice.s132v510single.build.sd_flags=-DS132 -DSD_VER=510 feather52.menu.softdevice.s132v510single.build.sd_name=s132 feather52.menu.softdevice.s132v510single.build.sd_version=5.1.0 +feather52.menu.softdevice.s132v510single.build.ldscript=bluefruit52_s132_5.1.0_single.ld feather52.menu.softdevice.s132v510single.build.bootfile=single/feather52_bootloader_5.1.0_s132_single feather52.menu.softdevice.s132v510single.upload.maximum_size=303104 feather52.menu.softdevice.s132v510single.upload.maximum_data_size=51072 diff --git a/cores/nRF5/linker/bluefruit52_s132_2.0.1.ld b/cores/nRF5/linker/bluefruit52_s132_2.0.1.ld deleted file mode 100755 index 0d4be641..00000000 --- a/cores/nRF5/linker/bluefruit52_s132_2.0.1.ld +++ /dev/null @@ -1,46 +0,0 @@ -/* Linker script to configure memory regions. */ - -SEARCH_DIR(.) -GROUP(-lgcc -lc -lnosys) - -MEMORY -{ - FLASH (rx) : ORIGIN = 0x1c000, LENGTH = 0x28800 /* Max 162 KB for dual banks */ - - /* SRAM required by S132 depend on - * - Attribute Table Size - * - Number of concurrent connection central + peripherl + secure links - * Several configuration with different SRAM config is included for reference - */ - - /* ATTR SIZE = 0x0B00, (central, prph, sec) = (0, 1, 0) */ - /* RAM (rwx) : ORIGIN = 0x20001B00 + 0x0B00, LENGTH = 0xE500 - 0x0B00 */ - - /* ATTR SIZE = 0x0B00, (central, prph, sec) = (4, 1, 1) */ - RAM (rwx) : ORIGIN = 0x20001B00 + (0x0B00 + 0x1280), LENGTH = 0xE500 - (0x0B00 + 0x1280) - - /* ATTR SIZE = 0x0B00, (central, prph, sec) = (7, 1, 1) */ - /* RAM (rwx) : ORIGIN = 0x20001B00 + (0x0B00 + 0x1F08), LENGTH = 0xE500 - (0x0B00 + 0x1F08) */ -} - -SECTIONS -{ - .fs_data : - { - PROVIDE(__start_fs_data = .); - KEEP(*(.fs_data)) - PROVIDE(__stop_fs_data = .); - } > RAM -} INSERT AFTER .data; - -INCLUDE "nrf5x_common.ld" - -/* S132 v2.0.1 role configuration SRAM usage */ -/* APP_RAM_BASE_CENTRAL_LINKS_0_PERIPH_LINKS_1_SEC_COUNT_0_MID_BW 0x20001fe8 */ - -/* APP_RAM_BASE_CENTRAL_LINKS_4_PERIPH_LINKS_1_SEC_COUNT_1_MID_BW 0x20003268 inc = 1280 */ -/* APP_RAM_BASE_CENTRAL_LINKS_4_PERIPH_LINKS_1_SEC_COUNT_2_MID_BW 0x20003438 inc = 1450 */ -/* APP_RAM_BASE_CENTRAL_LINKS_4_PERIPH_LINKS_1_SEC_COUNT_4_MID_BW 0x200037d0 inc = 17e8 */ - -/* APP_RAM_BASE_CENTRAL_LINKS_7_PERIPH_LINKS_1_SEC_COUNT_1_MID_BW 0x20003ef0 inc = 1F08*/ -/* APP_RAM_BASE_CENTRAL_LINKS_7_PERIPH_LINKS_1_SEC_COUNT_7_MID_BW 0x200049b8 inc = 29d0*/ diff --git a/cores/nRF5/linker/bluefruit52_s132_5.1.0_single.ld b/cores/nRF5/linker/bluefruit52_s132_5.1.0_single.ld new file mode 100755 index 00000000..6f0da09e --- /dev/null +++ b/cores/nRF5/linker/bluefruit52_s132_5.1.0_single.ld @@ -0,0 +1,38 @@ +/* Linker script to configure memory regions. */ + +SEARCH_DIR(.) +GROUP(-lgcc -lc -lnosys) + +MEMORY +{ + FLASH (rx) : ORIGIN = 0x23000, LENGTH = 0x4A000 /* Max 296 KB for single bank */ + + /* SRAM required by S132 depend on + * - Attribute Table Size + * - Vendor UUID count + * - Max ATT MTU + * - Concurrent connection peripheral + central + secure links + * - Event Len, HVN queue, Write CMD queue + */ + RAM (rwx) : ORIGIN = 0x20003200, LENGTH = 0x20010000 - 0x20003200 +} + +SECTIONS +{ + . = ALIGN(4); + .svc_data : + { + PROVIDE(__start_svc_data = .); + KEEP(*(.svc_data)) + PROVIDE(__stop_svc_data = .); + } > RAM + + .fs_data : + { + PROVIDE(__start_fs_data = .); + KEEP(*(.fs_data)) + PROVIDE(__stop_fs_data = .); + } > RAM +} INSERT AFTER .data; + +INCLUDE "nrf5x_common.ld" diff --git a/platform.txt b/platform.txt index cd59b080..8cbed859 100644 --- a/platform.txt +++ b/platform.txt @@ -53,8 +53,6 @@ compiler.size.cmd=arm-none-eabi-size build.float_flags=-mfloat-abi=hard -mfpu=fpv4-sp-d16 -u _printf_float build.debug_flags=-DCFG_DEBUG=0 -Os -build.ldscript=bluefruit52_{build.sd_name}_{build.sd_version}.ld - # compatiable with other lib only, would remove in the future build.extra_flags=-DARDUINO_FEATHER52