Commit 9e8eddce authored by Jamie McCrae's avatar Jamie McCrae Committed by Dominik Ermel
Browse files

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.

Signed-off-by: default avatarJamie McCrae <jamie.mccrae@nordicsemi.no>
parent 120b7182
Loading
Loading
Loading
Loading
+6 −8
Original line number Original line Diff line number Diff line
@@ -146,20 +146,18 @@ config BOOT_SIGNATURE_KEY_FILE
config MCUBOOT_CLEANUP_ARM_CORE
config MCUBOOT_CLEANUP_ARM_CORE
	bool "Perform core cleanup before chain-load the application"
	bool "Perform core cleanup before chain-load the application"
	depends on CPU_CORTEX_M
	depends on CPU_CORTEX_M
	default y if !ARCH_SUPPORTS_ARCH_HW_INIT
	default y
	help
	help
	  This option instructs MCUboot to perform a clean-up of a set of
	  This option instructs MCUboot to perform a clean-up of a set of
	  architecture core HW registers before junping to the application
	  architecture core HW registers before junping to the application
	  firmware. The clean-up sets these registers to their warm-reset
	  firmware. The clean-up sets these registers to their warm-reset
	  values as specified by the architecture.
	  values as specified by the architecture.


	  By default, this option is enabled only if the architecture does
	  This option is enabled by default to prevent possible problems when
	  not have the functionality to perform such a register clean-up
	  booting zephyr (or other) applications whereby e.g. a MPU stack guard
	  during application firmware boot.
	  may be initialised in RAM which is then used by the application

	  start-up code which can cause a module fault and potentially make the
	  Zephyr applications on Cortex-M will perform this register clean-up
	  module irrecoverable.
	  by default, if they are chain-loadable by MCUboot, so MCUboot does
	  not need to perform such a cleanup itself.


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