From d7b6ee142213b1d556c1292d0d0bb7db6bb045d0 Mon Sep 17 00:00:00 2001 From: Matthew Kennedy Date: Tue, 8 Dec 2020 23:32:54 -0800 Subject: [PATCH] use shared linker config --- firmware/bootloader/cfg/bootloader.ld | 35 ++------------------------- firmware/cfg/app.ld | 33 ++----------------------- firmware/wideband_layout.ld | 2 +- 3 files changed, 5 insertions(+), 65 deletions(-) diff --git a/firmware/bootloader/cfg/bootloader.ld b/firmware/bootloader/cfg/bootloader.ld index 11c82b6..25e6f68 100644 --- a/firmware/bootloader/cfg/bootloader.ld +++ b/firmware/bootloader/cfg/bootloader.ld @@ -14,40 +14,9 @@ limitations under the License. */ -/*INCLUDE wideband_layout.ld*/ - -/* - * STM32F042x6 memory setup. - */ - -blsize = 10k; - -MEMORY -{ - blflash (rx) : org = 0x08000000, len = blsize - appflash (rx) : org = 0x08000000 + blsize, len = 32k - blsize - flash1 (rx) : org = 0x00000000, len = 0 - flash2 (rx) : org = 0x00000000, len = 0 - flash3 (rx) : org = 0x00000000, len = 0 - flash4 (rx) : org = 0x00000000, len = 0 - flash5 (rx) : org = 0x00000000, len = 0 - flash6 (rx) : org = 0x00000000, len = 0 - flash7 (rx) : org = 0x00000000, len = 0 - ram_vectors (wx) : org = 0x20000000, len = 256 - ram0 (wx) : org = 0x20000200, len = 6k - 256 - ram1 (wx) : org = 0x00000000, len = 0 - ram2 (wx) : org = 0x00000000, len = 0 - ram3 (wx) : org = 0x00000000, len = 0 - ram4 (wx) : org = 0x00000000, len = 0 - ram5 (wx) : org = 0x00000000, len = 0 - ram6 (wx) : org = 0x00000000, len = 0 - ram7 (wx) : org = 0x00000000, len = 0 -} - -__appflash_start__ = ORIGIN(appflash); -__ram_vectors_start__ = ORIGIN(ram_vectors); -__ram_vectors_size__ = LENGTH(ram_vectors); +INCLUDE wideband_layout.ld +/* bootloader goes in blflash */ REGION_ALIAS("flash0", blflash); /* For each data/text section two region are defined, a virtual region diff --git a/firmware/cfg/app.ld b/firmware/cfg/app.ld index 041e37f..b2eaf7c 100644 --- a/firmware/cfg/app.ld +++ b/firmware/cfg/app.ld @@ -14,38 +14,9 @@ limitations under the License. */ -/*INCLUDE wideband_layout.ld*/ - - -blsize = 10k; - -MEMORY -{ - blflash (rx) : org = 0x08000000, len = blsize - appflash (rx) : org = 0x08000000 + blsize, len = 32k - blsize - flash1 (rx) : org = 0x00000000, len = 0 - flash2 (rx) : org = 0x00000000, len = 0 - flash3 (rx) : org = 0x00000000, len = 0 - flash4 (rx) : org = 0x00000000, len = 0 - flash5 (rx) : org = 0x00000000, len = 0 - flash6 (rx) : org = 0x00000000, len = 0 - flash7 (rx) : org = 0x00000000, len = 0 - ram_vectors (wx) : org = 0x20000000, len = 256 - ram0 (wx) : org = 0x20000200, len = 6k - 256 - ram1 (wx) : org = 0x00000000, len = 0 - ram2 (wx) : org = 0x00000000, len = 0 - ram3 (wx) : org = 0x00000000, len = 0 - ram4 (wx) : org = 0x00000000, len = 0 - ram5 (wx) : org = 0x00000000, len = 0 - ram6 (wx) : org = 0x00000000, len = 0 - ram7 (wx) : org = 0x00000000, len = 0 -} - -__appflash_start__ = ORIGIN(appflash); -__ram_vectors_start__ = ORIGIN(ram_vectors); -__ram_vectors_size__ = LENGTH(ram_vectors); - +INCLUDE wideband_layout.ld +/* App goes in appflash region */ REGION_ALIAS("flash0", appflash); /* For each data/text section two region are defined, a virtual region diff --git a/firmware/wideband_layout.ld b/firmware/wideband_layout.ld index 20e929a..413db33 100644 --- a/firmware/wideband_layout.ld +++ b/firmware/wideband_layout.ld @@ -2,7 +2,7 @@ * STM32F042x6 memory setup. */ -blsize = 8k; +blsize = 10k; MEMORY {