cmake: mcuboot: confirmed images needs to be padded

Add --pad to imgtool.py command line arguments when generating confirmed
images, otherwise the image contains no trailer magic for writing the
confirmed status.

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
This commit is contained in:
Henrik Brix Andersen 2020-09-03 20:37:31 +02:00 committed by Carles Cufí
commit 7e39e1d747
2 changed files with 4 additions and 4 deletions

View file

@ -435,10 +435,10 @@ config MCUBOOT_EXTRA_IMGTOOL_ARGS
For example, you could set this to "--version 1.2". For example, you could set this to "--version 1.2".
config MCUBOOT_GENERATE_CONFIRMED_IMAGE config MCUBOOT_GENERATE_CONFIRMED_IMAGE
bool "Also generate a confirmed image" bool "Also generate a padded, confirmed image"
help help
The signed and confirmed binaries are placed in the build directory The signed, padded, and confirmed binaries are placed in the build
at zephyr/zephyr.signed.confirmed.bin and directory at zephyr/zephyr.signed.confirmed.bin and
zephyr/zephyr.signed.confirmed.hex. zephyr/zephyr.signed.confirmed.hex.
The file names can be customized with CONFIG_KERNEL_BIN_NAME. The file names can be customized with CONFIG_KERNEL_BIN_NAME.

View file

@ -134,7 +134,7 @@ function(zephyr_mcuboot_tasks)
${west_sign} ${unconfirmed_args} ${imgtool_args}) ${west_sign} ${unconfirmed_args} ${imgtool_args})
if(confirmed_args) if(confirmed_args)
set_property(GLOBAL APPEND PROPERTY extra_post_build_commands COMMAND set_property(GLOBAL APPEND PROPERTY extra_post_build_commands COMMAND
${west_sign} ${confirmed_args} ${imgtool_args} --confirm) ${west_sign} ${confirmed_args} ${imgtool_args} --pad --confirm)
endif() endif()
set_property(GLOBAL APPEND PROPERTY extra_post_build_byproducts ${byproducts}) set_property(GLOBAL APPEND PROPERTY extra_post_build_byproducts ${byproducts})
endfunction() endfunction()