Skip to content
Snippets Groups Projects
Commit 7a6849ca authored by Kaspar Schleiser's avatar Kaspar Schleiser
Browse files

cpu/cortexm_common: add riotboot and slot support


RIOTBOOT_SLOT_LEN is calculated as an hexadecimal value and
handles ROM_LEN defined as kilobytes like '512K'

This enables support for all the cortex-m0+/3/4/7 arch,
so most boards embedding these are potentially supported.
One needs just to ensure that the CPU can be initialised
at least twice.

Co-authored-by: default avatarGaëtan Harter <gaetan.harter@fu-berlin.de>
parent 9cfdf6e3
Branches
No related tags found
No related merge requests found
...@@ -24,3 +24,11 @@ TOOLCHAINS_SUPPORTED = gnu llvm ...@@ -24,3 +24,11 @@ TOOLCHAINS_SUPPORTED = gnu llvm
LINKFLAGS += $(if $(ROM_OFFSET),$(LINKFLAGPREFIX)--defsym=_rom_offset=$(ROM_OFFSET)) LINKFLAGS += $(if $(ROM_OFFSET),$(LINKFLAGPREFIX)--defsym=_rom_offset=$(ROM_OFFSET))
# FW_ROM_LEN: rom length to use for firmware linking. Allows linking only in a section of the rom. # FW_ROM_LEN: rom length to use for firmware linking. Allows linking only in a section of the rom.
LINKFLAGS += $(if $(FW_ROM_LEN),$(LINKFLAGPREFIX)--defsym=_fw_rom_length=$(FW_ROM_LEN)) LINKFLAGS += $(if $(FW_ROM_LEN),$(LINKFLAGPREFIX)--defsym=_fw_rom_length=$(FW_ROM_LEN))
# Configure riotboot bootloader and slot lengths
# 4KB are currently enough
RIOTBOOT_LEN ?= 0x1000
# Take the whole flash minus RIOTBOOT_LEN
SLOT0_LEN ?= $(shell printf "0x%x" $$(($(ROM_LEN:%K=%*1024)-$(RIOTBOOT_LEN))))
SLOT0_LEN := $(SLOT0_LEN)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment