Hi Nordic team,
We’ve implemented a custom firmware update flow for our nRF5340-based device, which supports a robust single-image FOTA process using external NAND flash. The update is downloaded via HTTPS (using fota_download
), written to NAND via stream_flash
, and installed using MCUboot on the next reboot.
Now we want to extend this flow to support coordinated multi-image updates — specifically App Core and Network Core firmware — with atomic validation and rollback behavior.
Current Setup
-
Device: nRF5340 (custom hardware)
-
Storage: External NAND flash via QSPI
-
Transport: Firmware is downloaded via HTTPS using
fota_download
-
Bootloader: MCUboot
-
Flow:
-
Image is stored in NAND (not internal flash)
-
Reboot is triggered via
sys_reboot(SYS_REBOOT_COLD)
-
MCUboot detects new image in NAND and swaps it on boot
-
Image is confirmed using
boot_write_img_confirmed()
if successful
-
We also have a manual firmware_reswap()
function using boot_request_upgrade()
for triggering updates when needed, but this is not part of our automated FOTA path.
Multi-Image FOTA Goal
We want to:
-
Download two images (App Core and Net Core) and store both in external NAND
-
Validate both images before allowing any upgrade
-
Only proceed if both are valid
-
Trigger a coordinated update through MCUboot
-
Ensure that if either image fails to install or boot, both are rolled back
Open Questions
-
MCUboot + External Flash + Multi-Image:
Can MCUboot handle multi-image updates from external NAND using:kconfigKopierenBearbeitenCONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY=y CONFIG_NRF53_MULTI_IMAGE_UPDATE=y CONFIG_NRF53_UPGRADE_NETWORK_CORE=y
Is this officially supported in conjunction with
stream_flash
and external slots? -
Download strategy:
Would you recommend:-
Downloading and storing two separate images independently?
-
Or combining them into a single bundle to unpack after download?
-
-
Partitioning and mapping:
What’s the cleanest way to define partition layout (e.g., viapm_static.yml
) to store both images in NAND and allow MCUboot to find them? -
Image validation:
What’s the best practice to ensure both images are valid before rebooting?
Should we compute and compare hashes manually, or use image manager APIs? -
Rollback consistency:
How do we ensure both images are rolled back if one fails post-upgrade?
Does MCUboot handle this natively in multi-image mode, or do we need additional coordination? -
General advice:
Are there known limitations, recommended patterns, or pitfalls when doing multi-image OTA updates from NAND flash on the nRF5340?
We’re open to customizing parts of this logic ourselves if needed, but would prefer to stick to supported MCUboot patterns where possible.
Thanks in advance for your help and insights!
Best regards,
Lucas