2019-10-08 09:05:11 +02:00
|
|
|
CPU_ARCH = cortex-m3
|
2019-10-08 15:26:11 +02:00
|
|
|
CPU_FAM = stm32f2
|
2015-12-13 11:00:06 +01:00
|
|
|
|
2019-07-24 10:40:19 +02:00
|
|
|
# STM32F2 uses sectors instead of pages, where the minimum sector length is 16KB
|
|
|
|
# (the first sector), therefore RIOTBOOT_LEN must be 16KB to cover a whole sector.
|
|
|
|
RIOTBOOT_LEN ?= 0x4000
|
|
|
|
|
|
|
|
# CPU_IRQ_NUMOF for STM32F2 boards is < 81+16 so (97*4 bytes = 388 bytes ~= 0x200)
|
|
|
|
# RIOTBOOT_HDR_LEN can be set to 0x200.
|
|
|
|
# Details on alignment requirements for M3 in `cpu/cortexm_common/Makefile.include`.
|
|
|
|
RIOTBOOT_HDR_LEN ?= 0x200
|
|
|
|
|
|
|
|
# Sectors don't have the same length. Per bank there can be up to 12 sectors. The
|
|
|
|
# first 4 sectors are 16kB long, the 5th is 64kB and the remaining 7 are 128kB.
|
|
|
|
# Since flash can only be erased by sector, slots can't overlap over sectors.
|
|
|
|
# The most efficient layout comes from removing RIOTBOOT_LEN twice, once at the
|
|
|
|
# start of the flash for the bootloader, and a second time at the end of the
|
|
|
|
# flash, to get evenly sized and distributed slots.
|
|
|
|
SLOT0_LEN ?= $(shell printf "0x%x" $$((($(ROM_LEN:%K=%*1024)-2*$(RIOTBOOT_LEN)) / $(NUM_SLOTS))))
|
|
|
|
SLOT1_LEN ?= $(SLOT0_LEN)
|
|
|
|
|
2016-03-23 15:26:18 +01:00
|
|
|
include $(RIOTCPU)/stm32_common/Makefile.include
|
2016-01-27 10:47:12 +01:00
|
|
|
include $(RIOTMAKE)/arch/cortexm.inc.mk
|