Skip to content

Commit 518d93a

Browse files
ioannisgnvlsianpu
authored andcommitted
zephyr: Kconfig: change default for MCUBOOT_CLEANUP_ARM_CODE
Zephyr has introduced an option to perform the cleanup of ARM core HW registers during early boot, when the firmware is chain-loaded by MCUboot. Therefore, MCUboot does not need to perform the same cleanup before jumping to the application image. The patch relies on the fact that building MCUboot with Zephyr implies loading also a Zephyr-based application firmware. If this is not the case, the application developer needs to enable the MCUBOOT_CLEANUP_ARM_CODE Kconfig option manually, in the project configuration. Signed-off-by: Ioannis Glaropoulos <[email protected]>
1 parent 6610e88 commit 518d93a

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

boot/zephyr/Kconfig

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,20 @@ config BOOT_SIGNATURE_KEY_FILE
147147
config MCUBOOT_CLEANUP_ARM_CORE
148148
bool "Perform core cleanup before chain-load the application"
149149
depends on CPU_CORTEX_M
150-
default y
150+
default y if !ARCH_SUPPORTS_ARCH_HW_INIT
151+
help
152+
This option instructs MCUboot to perform a clean-up of a set of
153+
architecture core HW registers before junping to the application
154+
firmware. The clean-up sets these registers to their warm-reset
155+
values as specified by the architecture.
156+
157+
By default, this option is enabled only if the architecture does
158+
not have the functionality to perform such a register clean-up
159+
during application firmware boot.
160+
161+
Zephyr applications on Cortex-M will perform this register clean-up
162+
by default, if they are chain-loadable by MCUboot, so MCUboot does
163+
not need to perform such a cleanup itself.
151164

152165
config MBEDTLS_CFG_FILE
153166
default "mcuboot-mbedtls-cfg.h"

0 commit comments

Comments
 (0)