aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn Ruben Bakke2020-07-16 23:04:02 +0200
committerGlenn Ruben Bakke2020-12-07 20:04:50 +0100
commit718397a37d7ec2071b5f5d3668c31e6b8f69f3b9 (patch)
tree490922222ba35020c0df2b4c153ddf58be0e5e73
parent248968863595fb285b1209927e27c37b06faf857 (diff)
nrf/Makefile: Add bootloader specific section.
Add the option for "mpconfigboard.mk" to define whether the board hosts a bootloader or not. The BOOTLOADER make variable must be set to the name of the bootloader. When the BOOTLOADER name is set it is also required to supply the BOOTLOADER_VERSION_MAJOR and the BOOTLOADER_VERSION_MINOR from the "mpconfigboards.mk". These will be used to resolve which bootloader linker script that should be passed to the linker. The BOOTLOADER section also supplies the C-compiler with BOOTLOADER_<bootloader name>=<version major><version minor> as a compiler define. This is for future use in case a bootloader needs to do modification to the startup files or similar (like setting the VTOR specific to a version of a bootloader).
-rw-r--r--ports/nrf/Makefile7
1 files changed, 7 insertions, 0 deletions
diff --git a/ports/nrf/Makefile b/ports/nrf/Makefile
index e5a1b471a..4ee9384ec 100644
--- a/ports/nrf/Makefile
+++ b/ports/nrf/Makefile
@@ -26,6 +26,13 @@ else
include drivers/bluetooth/bluetooth_common.mk
endif
+ifneq ($(BOOTLOADER),)
+ BOOTLOADER_UPPER = $(shell echo $(BOOTLOADER) | tr '[:lower:]' '[:upper:]')
+ # Use additional bootloader linker script
+ LD_FILES += boards/$(MCU_SUB_VARIANT)_$(BOOTLOADER)_$(BOOTLOADER_VERSION_MAJOR).$(BOOTLOADER_VERSION_MINOR).x.ld
+ CFLAGS += -DBOOTLOADER_$(BOOTLOADER_UPPER)_VERSION=$(BOOTLOADER_MAJOR)$(BOOTLOADER_MINOR)
+endif
+
LD_FILES += boards/memory.ld boards/common.ld
ifneq ($(LD_FILE),)