From 18c22abdfa8537e074a0bd3b44011ec1f9f25f63 Mon Sep 17 00:00:00 2001 From: Andrey G Date: Fri, 15 Jul 2022 10:07:41 +0300 Subject: [PATCH] bootloader: make bootloader flash area reserve optional (#111) * bootloader: make bootloader flash area reserve optional and increase config flash area to 8K * f1_rev2: empty blflash section --- firmware/Makefile | 5 +++++ firmware/boards/f1_rev2/wideband_layout.ld | 7 ++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/firmware/Makefile b/firmware/Makefile index 86bbabd..90f181e 100644 --- a/firmware/Makefile +++ b/firmware/Makefile @@ -210,6 +210,11 @@ ifeq ($(USE_BOOTLOADER),yes) USE_OPT += -Wl,--defsym=USE_BOOTLOADER=1 endif +ifeq ($(USE_OPENBLT),yes) + # Reserve start of flash for OpenBLT + USE_OPT += -Wl,--defsym=USE_BOOTLOADER=1 +endif + # # End of user section ############################################################################## diff --git a/firmware/boards/f1_rev2/wideband_layout.ld b/firmware/boards/f1_rev2/wideband_layout.ld index d1a7dcc..d088825 100644 --- a/firmware/boards/f1_rev2/wideband_layout.ld +++ b/firmware/boards/f1_rev2/wideband_layout.ld @@ -4,9 +4,10 @@ MEMORY { - /* 8k reserved for bootloader */ - appflash (rx) : org = 0x08000000 + 8k, len = 128k - 1k - 8k - configflash (rx) : org = 0x08000000 + 128k - 1k, len = 1k + /* empty section to keep linker happy */ + blflash (rx) : org = 0x08000000, len = 0 + appflash (rx) : org = DEFINED(USE_BOOTLOADER) ? (0x08000000 + 8k) : 0x08000000, len = DEFINED(USE_BOOTLOADER) ? (128k - 8k - 8k) : (128k - 8k) + configflash (rx) : org = 0x08000000 + 128k - 8k, len = 8k flash1 (rx) : org = 0x00000000, len = 0 flash2 (rx) : org = 0x00000000, len = 0 flash3 (rx) : org = 0x00000000, len = 0