From de5d2ffdebe6bfc03b29521ed464ebf023c30f9f Mon Sep 17 00:00:00 2001 From: francisco Date: Mon, 13 May 2019 16:08:54 +0200 Subject: [PATCH] cpu/nrf52: set RIOTBOOT_LEN to 8k - nrf52 flash page is 4k, the bootloader needs to be x2 so slots start at the beginning of a page. --- cpu/nrf52/Makefile.include | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cpu/nrf52/Makefile.include b/cpu/nrf52/Makefile.include index 5712804a6d28a..790ece7420090 100644 --- a/cpu/nrf52/Makefile.include +++ b/cpu/nrf52/Makefile.include @@ -1,6 +1,11 @@ export CPU_ARCH = cortex-m4f export CPU_FAM = nrf52 +# Slot size is determined by "((total_flash_size - RIOTBOOT_LEN) / 2)". +# If RIOTBOOT_LEN uses an uneven number of flashpages, the remainder of the +# flash cannot be divided by two slots while staying FLASHPAGE_SIZE aligned. +RIOTBOOT_LEN ?= 0x2000 + # Export internal ROM alignment and slot sizes for bootloader support export MCUBOOT_IMAGE_ALIGN = 8 export MCUBOOT_SLOT0_SIZE = 0x8000