cmake: mcuboot: Flash encrypted image when loading to RAM
When both `SB_CONFIG_MCUBOOT_MODE_RAM_LOAD` and `SB_CONFIG_BOOT_ENCRYPTION` are enabled, MCUBoot loads an encrypted image from flash, decrypts it, and then executes it from RAM. Previously, the unencrypted image was being flashed. This caused a boot failure because MCUBoot would attempt to decrypt an unencrypted image. This commit ensures the encrypted image is flashed when this configuration is active, allowing the system to boot correctly. Signed-off-by: Arthur Gay <arthur.gay@marshmallow.kids>
This commit is contained in:
@@ -283,6 +283,9 @@ function(zephyr_mcuboot_tasks)
|
||||
set_property(GLOBAL APPEND PROPERTY extra_post_build_commands COMMAND
|
||||
${imgtool_sign} ${imgtool_args} --encrypt "${keyfile_enc}" ${output}.hex
|
||||
${output}.signed.encrypted.hex)
|
||||
if(CONFIG_MCUBOOT_BOOTLOADER_MODE_RAM_LOAD)
|
||||
zephyr_runner_file(hex ${output}.signed.encrypted.hex)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CONFIG_MCUBOOT_BOOTLOADER_MODE_RAM_LOAD OR CONFIG_MCUBOOT_BOOTLOADER_MODE_RAM_LOAD_WITH_REVERT)
|
||||
|
||||
Reference in New Issue
Block a user