Skip to content

Conversation

ozersa
Copy link

@ozersa ozersa commented Sep 29, 2025

This PR introduce an proposal method that can be used to handle multi image in a single image pack to decrease number of signature check during bootup. By this change multiple images can be loaded/updated on device with one signature check.
Depend on the product this feature might requires to decrease boot up time.

This PR includes:

  • combine_images.py which is used to combine images and generate mcuboot image structure by using imgtool.
  • combine_images.yaml is provide each images parameters. It is a reference file to demonstrate how can it be used.

The feature only support for if (BOOT_IMAGE_NUMBER == 1) and MCUBOOT_RAM_LOAD defined case.
And assume on multicore heterogeneous system the host core which execute MCUBoot FW able to access sub core ITCM/DTCM by just memcpy operation.
The MCUBoot FW after copy them to the target address is going to execute first bootable image.

As an example 3 images can be concatenated as
image

Simply tested with Zephyr on MAX32690EVKIT
image

Michael Eskowitz and others added 2 commits September 29, 2025 11:04
MCUBoot multi image support mode requires each image
be procedded individually that requires multiple signature
check during boot. If there be 4 image it will require 4 times
signature validatation. This feature increase boot time and
depend on the project long boot time may not be expected.

To provide a solution for this case we propose to
- Generate each image as regular
- Concatanate them and re generate a main mcuboot image.

-------------------------
|         Header        |
-------------------------
|  SubImage (optional)  |
|  (Header+Data+Footer) |
-------------------------
|  SubImage (optional)  |
|  (Header+Data+Footer) |
-------------------------
|        .....          |
-------------------------
|         Footer        |
-------------------------

During boot time if top level image be validated sub image can be
just copied to the target location without to recheck them.

To provide this feature there will be two commit
1- Provide a script that combine images
2- Update mcuboot source code to process subimages

This commit is for mcu-tools#1, in this commit we are adding
a script which called as combine_images.py.

The usage of the script is:
python combine_images.py --config combine_images.yaml --imgtool imgtool --output <outfolder>

combine_images.yaml file is added as reference file it need to be
updated as per of the project need.

Signed-off-by: Sadik Ozer <[email protected]>
Signed-off-by: Michael Eskowitz [email protected]
This is source code update to provide images in images
feature support. As mentioned in prev commit:

MCUBoot multi image support mode requires each image
be procedded individually that requires multiple signature
check during boot. If there be 4 image it will require 4 times
signature validatation. This feature increase boot time and
depend on the project long boot time may not be expected.

In this commit the loader.c file update to search subimages and copy them
in the related load_address.
By this solution:
- Image update will be handled as requlary
- Signature check will be executed for combined image
- Boot time will be decreased by eliminating multiple signature check

This featue only support for (BOOT_IMAGE_NUMBER == 1 && MCUBOOT_RAM_LOAD) case.

Signed-off-by: Sadik Ozer <[email protected]>
@ozersa ozersa changed the title Feat images in image support Feature: images in image support Sep 29, 2025
Copy link
Collaborator

@nordicjm nordicjm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really not at all how MCUboot is designed to operate, if you want this then you should use the hooks MCUboot has to run your functions for doing this in your own application or module

@ozersa
Copy link
Author

ozersa commented Sep 29, 2025

This is really not at all how MCUboot is designed to operate, if you want this then you should use the hooks MCUboot has to run your functions for doing this in your own application or module

@nordicjm thanks for the feedback. While adding this feature we have not change behavior of mcuboot. It is just extended.
Isn't it be useful for anyone else? Especially for multi core heterogenous systems.
It helps to to decrease boot time & simplify fw update due to there is one main package that need to be managed.

@mehmetariman
Copy link

This is really not at all how MCUboot is designed to operate, if you want this then you should use the hooks MCUboot has to run your functions for doing this in your own application or module

@nordicjm thanks for the feedback. While adding this feature we have not change behavior of mcuboot. It is just extended. Isn't it be useful for anyone else? Especially for multi core heterogenous systems. It helps to to decrease boot time & simplify fw update due to there is one main package that need to be managed.

@nordicjm

I find this feature useful for bundling multiple images into single envelope so that it can decrease the authentication burden. We may have a discussion on how to infuse it better for the architecture. Yet, adding a hook for tailoring is not the main purpose. The main purpose is to add capability of bundling multiple packs into single image for verification which enhances performance in MCUBoot in general.

@nordicjm
Copy link
Collaborator

This is really not at all how MCUboot is designed to operate, if you want this then you should use the hooks MCUboot has to run your functions for doing this in your own application or module

@nordicjm thanks for the feedback. While adding this feature we have not change behavior of mcuboot. It is just extended. Isn't it be useful for anyone else? Especially for multi core heterogenous systems. It helps to to decrease boot time & simplify fw update due to there is one main package that need to be managed.

You have taken a mode and completely made up an entirely new container format without any discussion or thought about other MCUboot modes, security, previous version compatibility or design queries or how other supported OS's would implement such a feature notwithstanding a complete lack of documentation. Not to say that such a feature cannot be added, but this is really not at all the correct way to do it

@ozersa
Copy link
Author

ozersa commented Sep 30, 2025

This is really not at all how MCUboot is designed to operate, if you want this then you should use the hooks MCUboot has to run your functions for doing this in your own application or module

@nordicjm thanks for the feedback. While adding this feature we have not change behavior of mcuboot. It is just extended. Isn't it be useful for anyone else? Especially for multi core heterogenous systems. It helps to to decrease boot time & simplify fw update due to there is one main package that need to be managed.

You have taken a mode and completely made up an entirely new container format without any discussion or thought about other MCUboot modes, security, previous version compatibility or design queries or how other supported OS's would implement such a feature notwithstanding a complete lack of documentation. Not to say that such a feature cannot be added, but this is really not at all the correct way to do it

@nordicjm We tried to add it without changing existing feature as possible as, There might be some items that we missed. We are eager to refactor it as per of your and maintainers feedback and direction to handle it in appropriate way.
Please let me know which flow should we follow or which changes should we apply in this PR.
Thanks for your support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants