# Strip 'K' from ROM_LEN definition _rom_len_k = $(shell echo $1 | sed 's/K//') # Set ROM and RAM lengths according to CPU model ifneq (,$(filter cc2538nf11,$(CPU_MODEL))) ROM_LEN ?= 128K RAM_LEN ?= 16K endif ifneq (,$(filter cc2538nf23,$(CPU_MODEL))) ROM_LEN ?= 256K RAM_LEN ?= 32K endif ifneq (,$(filter cc2538nf53 cc2538sf53,$(CPU_MODEL))) ROM_LEN ?= 512K RAM_LEN ?= 32K endif # If using riotboot subtract 2 pages (2 * 2K) to not write over CCA # section and keep page parity (so slots are split evenly among pages) ifneq (,$(filter riotboot,$(FEATURES_USED))) ROM_LEN := $(shell echo $$(( $(call _rom_len_k,$(ROM_LEN)) - 4 )) )K endif # Set ROM and RAM start address ROM_START_ADDR ?= 0x00200000 RAM_START_ADDR ?= 0x20000000 # Set CFLAGS KB := 1024 FLASHSIZE := $(shell echo $$(( $(call _rom_len_k,$(ROM_LEN)) * $(KB))) ) CFLAGS += -DCC2538_FLASHSIZE=$(FLASHSIZE)U # Use common ld script LINKER_SCRIPT ?= cc2538.ld # The entry point `cortex_vector_base` is defined in the cca field. # If the cca field is updated when flashing a slot then the entry # point will never be the bootloader but the respective slot. This # ensures it never happens, the last page will never be touched when # using riotboot. ifneq (,$(filter riotboot,$(FEATURES_USED))) CFLAGS += -DUPDATE_CCA=0 endif include $(RIOTMAKE)/arch/cortexm.inc.mk