zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
10.36k stars 6.35k forks source link

west flash: When CONFIG_MCUBOOT_GENERATE_CONFIRMED_IMAGE is set padded and confirmed image should probably be flashed #56787

Open de-nordic opened 1 year ago

de-nordic commented 1 year ago

Is your enhancement proposal related to a problem? Please describe. The Kconfig option CONFIG_MCUBOOT_GENERATE_CONFIRMED_IMAGE makes additional application image that is already padded and confirmed for MCUboot execution, but west flash will still flash the only bare or signed image. Shouldn't the option also make west flash write the confirmed image?

Describe the solution you'd like When CONFIG_MCUBOOT_GENERATE_CONFIRMED_IMAGE is selected then west flash writes confirmed image to board.

Describe alternatives you've considered Leaving as is or adding Kconfig to allow selecting which image will be uploaded (not so great idea).

Additional context When the Kconfig option is enabled, additional binary and hex are created: zephyr.signed.confirmed.hex zephyr.signed.confirmed.bin

by cmake code: https://github.com/zephyrproject-rtos/zephyr/blob/2568ab661d737ffe91e0e7f78a37ce006205b8bc/cmake/mcuboot.cmake#L115-L124

additionally to the zephyr.signed.{bin,hex}, but it seems that west flash does not use them.

henrikbrixandersen commented 1 year ago

Shouldn't the option also make west flash write the confirmed image?

Not necessarily. I am the one who asked @mbolivar-nordic to add CONFIG_MCUBOOT_GENERATE_CONFIRMED_IMAGE. We use it downstream to generate two images, one confirmed and padded to be flashed in production along with MCUboot, and one for OTA firmware updates. We typically want to flash the unconfirmed and unpadded image when calling west flash.

If the unconfirmed, unpadded image is used in production, the firmware will appear as "unconfirmed" when first booted.

zephyrbot commented 6 months ago

Hi @d3zd3z, @mbolivar-ampere,

This issue, marked as an Enhancement, was opened a while ago and did not get any traction. It was just assigned to you based on the labels. If you don't consider yourself the right person to address this issue, please re-assing it to the right person.

Please take a moment to review if the issue is still relevant to the project. If it is, please provide feedback and direction on how to move forward. If it is not, has already been addressed, is a duplicate, or is no longer relevant, please close it with a short comment explaining the reason.

@de-nordic you are also encouraged to help moving this issue forward by providing additional information and confirming this request/issue is still relevant to you.

Thanks!