Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions boards/nucleo-f446re/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ FEATURES_PROVIDED += periph_qdec

# Various other features (if any)
FEATURES_PROVIDED += motor_driver
FEATURES_PROVIDED += riotboot

# load the common Makefile.features for Nucleo boards
include $(RIOTBOARD)/common/nucleo64/Makefile.features
Expand Down
3 changes: 3 additions & 0 deletions boards/stm32f429i-disc1/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ FEATURES_PROVIDED += periph_spi
FEATURES_PROVIDED += periph_timer
FEATURES_PROVIDED += periph_uart

# Put other features for this board (in alphabetical order)
FEATURES_PROVIDED += riotboot

include $(RIOTCPU)/stm32f4/Makefile.features
17 changes: 17 additions & 0 deletions cpu/stm32f4/Makefile.include
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
export CPU_ARCH = cortex-m4f
export CPU_FAM = stm32f4

# STM32F4 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 STM32F4 boards is < 102+16 so (118*4 bytes = 472 bytes ~= 0x200)
# RIOTBOOT_HDR_LEN can be set to 0x200.
# Details on alignment requirements for M4 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.
# RIOTBOOT_LEN is removed 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)

include $(RIOTCPU)/stm32_common/Makefile.include
include $(RIOTMAKE)/arch/cortexm.inc.mk