From cf2cc23fc692f3ec613eb717e0e53dd76346c05a Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Thu, 19 Sep 2024 09:43:27 +0100 Subject: [PATCH] cmake: sysbuild: signing: Fix DirectXIP signing with confirmation Adds the confirm flag when using imgtool to make signed hex files be confirmed Signed-off-by: Jamie McCrae --- cmake/sysbuild/image_signing.cmake | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmake/sysbuild/image_signing.cmake b/cmake/sysbuild/image_signing.cmake index a0dc1a0b1e49..136f77b730bd 100644 --- a/cmake/sysbuild/image_signing.cmake +++ b/cmake/sysbuild/image_signing.cmake @@ -68,6 +68,8 @@ function(zephyr_mcuboot_tasks) return() endif() + set(imgtool_directxip_hex_command) + if(CONFIG_MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP_WITH_REVERT OR CONFIG_MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP) # XIP image, need to use the fixed address for this slot if(CONFIG_NCS_IS_VARIANT_IMAGE) @@ -75,6 +77,10 @@ function(zephyr_mcuboot_tasks) else() set(imgtool_rom_command --rom-fixed @PM_MCUBOOT_PRIMARY_ADDRESS@) endif() + + if(CONFIG_MCUBOOT_BOOTLOADER_MODE_DIRECT_XIP_WITH_REVERT) + set(imgtool_directxip_hex_command --confirm) + endif() endif() # Split fields, imgtool_sign_sysbuild is stored in cache which will have fields updated by @@ -190,7 +196,7 @@ function(zephyr_mcuboot_tasks) # calls to the "extra_post_build_commands" property ensures they run # after the commands which generate the unsigned versions. set_property(GLOBAL APPEND PROPERTY extra_post_build_commands COMMAND - ${imgtool_sign} ${imgtool_args} ${unconfirmed_args}) + ${imgtool_sign} ${imgtool_args} ${imgtool_directxip_hex_command} ${unconfirmed_args}) if(NOT "${keyfile_enc}" STREQUAL "") set(unconfirmed_args ${input}.hex ${output}.encrypted.hex)