Skip to content

Commit

Permalink
modules: mcuboot: boot: zephyr: kconfi: Prevent cleanup issue
Browse files Browse the repository at this point in the history
Prevents enabling cleanup secondary slots in MCUboot when
child/parent image is used and nRF5340 multi image update is
enabled. This prevents a possible issue whereby a slot might be
wrongly marked as unused, cleaned up, then updated, where the
result is a 4 byte primary slot main image that cannot be booted,
and on devices with access port protection enabled means that the
device is irrecoverably bricked

Signed-off-by: Jamie McCrae <[email protected]>
  • Loading branch information
nordicjm committed Oct 15, 2024
1 parent 891171d commit 02fb7a1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/mcuboot/boot/zephyr/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,10 @@ config NRF53_RAM_FLASH_SIZE
config MCUBOOT_CLEANUP_UNUSABLE_SECONDARY
bool "Clean-up unusable secondary slots"
default y if FLASH_LOAD_OFFSET != 0 || SOC_NRF5340_CPUAPP
# This code does not work on child/parent image with b0 update and network core updates
# and can result in an erased slot updating the main primary slot which results in a
# brick module, do not allow it to be used in these circumstances
depends on MCUBOOT_APPLICATION_IMAGE_NUMBER != -1 || (MCUBOOT_APPLICATION_IMAGE_NUMBER = -1 && !NRF53_MULTI_IMAGE_UPDATE)
help
If enbales, the mcuboot performs clean-up content of all the secondary slots
which contains valid header but couldn't be assigned to any of
Expand Down

0 comments on commit 02fb7a1

Please sign in to comment.