Skip to content

Add support of shared upgrade slot feature in simulator#2665

Open
DOAR-Infineon wants to merge 1 commit intomcu-tools:mainfrom
DOAR-Infineon:fork/shared_upgrade_slot_support
Open

Add support of shared upgrade slot feature in simulator#2665
DOAR-Infineon wants to merge 1 commit intomcu-tools:mainfrom
DOAR-Infineon:fork/shared_upgrade_slot_support

Conversation

@DOAR-Infineon
Copy link
Copy Markdown
Contributor

Summary
Adds simulator device configurations and tests that validate the shared upgrade slot feature — a multi-image layout where multiple images share a single physical flash region for their secondary (upgrade) slots. This significantly reduces flash usage in systems where only one image is upgraded at a time.

Motivation
In the standard MCUboot multi-image configuration, each image requires its own dedicated secondary slot. For a 2-image system with 64 KB slots, this means 128 KB of flash reserved for upgrades. With the shared upgrade slot layout, both secondary slots overlap on the same physical SPI flash region, reducing upgrade flash to ~68 KB — a savings of ~47%.

@DOAR-Infineon DOAR-Infineon requested a review from d3zd3z as a code owner March 18, 2026 17:36
@de-nordic de-nordic added the area: sim Affects the simulator label Mar 26, 2026
@d3zd3z d3zd3z self-assigned this Mar 26, 2026
Copy link
Copy Markdown
Member

@d3zd3z d3zd3z left a comment

Choose a reason for hiding this comment

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

Overall, this looks really good. It isn't clear to me where this will get covered in CI tests. We might want to consider, in the future, whether we want a bit more coverage of some of the power-loss test cases in this configuration.

But this is really good for testing what we do have.

Comment thread sim/src/lib.rs
Comment thread docs/shared_upgrade_slot.md Outdated
| Mode | Supported | Scratch needed | Device | Notes |
|------|-----------|----------------|--------|-------|
| Overwrite-only | **Yes** | No | `PSOCEdgeE8xSpiFlash` | Simplest layout |
| Swap-using-scratch | **Yes** | Yes (1 sector) | `PSOCEdgeE8xSpiFlash` | Equal primary/secondary sizes |
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Given that we're trying to deprecate swap-using-scratch, I wonder if we should have this line at all (or the scratch column). I suppose it is here for completeness.

@DOAR-Infineon DOAR-Infineon force-pushed the fork/shared_upgrade_slot_support branch 2 times, most recently from 804654e to 2a725b9 Compare March 30, 2026 12:24
@DOAR-Infineon DOAR-Infineon requested a review from d3zd3z March 30, 2026 13:50
Signed-off-by: INFINEON\DovhalA <artem.dovhal@infineon.com>
@DOAR-Infineon DOAR-Infineon force-pushed the fork/shared_upgrade_slot_support branch from e324503 to 162bd6e Compare March 30, 2026 14:14
d3zd3z
d3zd3z previously approved these changes Mar 30, 2026
> If they differ, boot will print *"Cannot upgrade: slots are not
> compatible"* and refuse to swap.

### Staggering the trailers
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

can you explain why this is needed? The MCUboot header https://github.com/mcu-tools/mcuboot/blob/main/boot/bootutil/include/bootutil/image.h#L166 includes uint32_t ih_load_addr; which gives the exact address to load to which maps to one image only

@d3zd3z d3zd3z dismissed their stale review April 10, 2026 19:58

Jamie's (nordicjcm)'s question needs to be addresses. They are apparently doing this without needing any staggering.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: sim Affects the simulator

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants