Overwrite updates using multiple secondary slots #2505
Unanswered
sjlongland
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
I'm trying to port an existing project over to using Zephyr and MCUBoot. The old project used a custom-made bootloader (yes, in hindsight should have looked at MCUBoot but I didn't know it existed then) which "overwrote" the active image (stored in on-chip executable flash) from one of two possible image partitions in a SPI flash chip.
The bootloader did SHA-256 verification with the application itself checking authenticity. It's been a reliable workhorse which we've had in use for about 5 years now. The application signalled to the bootloader which of the off-chip images it was to load, and the bootloader would erase the main flash and copy the image off off-chip storage into main flash.
The image format was largely a raw MCU image, but there were some reserved parts at fixed addresses that allowed for metadata to be stored (version number, SHA-256 hash, digital signature).
The advantage of this was three-fold:
The only real downside is you need space for three image slots (primary and the two secondaries), with one of them being a copy of the active image.
At the moment MCUboot only seems to support a single "secondary" image which is used for a "next image" partition so I'd have to do something like this:
I reserve a partition to be
slot1that's for MCUBoot use. My application's OTA partitions (image0andimage1) are separate, and when I want to load one onto the MCU, I copy it toslot1.Advantages:
image0andimage1can exist in a filesystem if so desired (e.g. LittleFS)Disadvantages:
slot1sectors during an updateIf MCUBoot supported a second secondary partition, I'd have to nominate which one I was intending to use, but then MCUBoot would proceed with an overwrite like normal.
Is there something I missed that in fact, does allow something like this to be implemented? If not supported, are there any plans to add such support?
Beta Was this translation helpful? Give feedback.
All reactions