Skip to content

Commit 9c58609

Browse files
nordicjmtmon-nordic
authored andcommitted
[nrf fromlist] boot: zephyr: Clean up before chainloading by default
This changes the default mcuboot configuration for zephyr applications to clean up before booting the user application. The reason for this change is that mcuboot may configure protection (e.g. MPU stack guard) which is then used by the user application during its startup code prior to cleaning the configuration up, this can lead to a unbootable application and potentially irrecoverable module, therefore cleaning up is now being enabled by default. Upstream PR: mcu-tools/mcuboot#1635 Signed-off-by: Jamie McCrae <[email protected]>
1 parent 68b4648 commit 9c58609

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

boot/zephyr/Kconfig

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -148,20 +148,18 @@ config BOOT_SIGNATURE_KEY_FILE
148148
config MCUBOOT_CLEANUP_ARM_CORE
149149
bool "Perform core cleanup before chain-load the application"
150150
depends on CPU_CORTEX_M
151-
default y if !ARCH_SUPPORTS_ARCH_HW_INIT
151+
default y
152152
help
153153
This option instructs MCUboot to perform a clean-up of a set of
154154
architecture core HW registers before junping to the application
155155
firmware. The clean-up sets these registers to their warm-reset
156156
values as specified by the architecture.
157157

158-
By default, this option is enabled only if the architecture does
159-
not have the functionality to perform such a register clean-up
160-
during application firmware boot.
161-
162-
Zephyr applications on Cortex-M will perform this register clean-up
163-
by default, if they are chain-loadable by MCUboot, so MCUboot does
164-
not need to perform such a cleanup itself.
158+
This option is enabled by default to prevent possible problems when
159+
booting zephyr (or other) applications whereby e.g. a MPU stack guard
160+
may be initialised in RAM which is then used by the application
161+
start-up code which can cause a module fault and potentially make the
162+
module irrecoverable.
165163

166164
config MBEDTLS_CFG_FILE
167165
default "mcuboot-mbedtls-cfg.h"

0 commit comments

Comments
 (0)