Skip to content

Commit

Permalink
cmake: sysbuild: signing: Fix DirectXIP signing with confirmation
Browse files Browse the repository at this point in the history
Adds the confirm flag when using imgtool to make signed hex files
be confirmed

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
  • Loading branch information
nordicjm committed Sep 24, 2024
1 parent acc2ee1 commit cf2cc23
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cmake/sysbuild/image_signing.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,19 @@ 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)
set(imgtool_rom_command --rom-fixed @PM_MCUBOOT_SECONDARY_ADDRESS@)
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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit cf2cc23

Please sign in to comment.