MCUboot and flash remapping feature
The default upgrade mechanism in MCUBoot is the SWAP algorithm. There are several NXP processors which support flash remapping functionality that can be used to speed up the OTA update process and minimize the flash wear. Flash remapping feature is used for zero-copy image swapping without the need of any data moving operations. This results in the fastest update operation possible. There are several platforms that support this mechanism. Mostly based on their external memory FlexSPI controller (eg. RT1060, RW612…). Platforms like MCX N9 also implement this mechanism for their internal flash memory.
The boards with such processors have example projects configured to use this feature. This is achieved by using MCUboot’s DIRECT-XIP mechanism and by activating flash remapping when an active flag is located on the secondary slot - image is still built to run from primary slot. Keep in mind that DIRECT-XIP mode loads image with the highest version as there is no rollback support.
IMPORTANT NOTE: Signed application images directly programmed into flash memory by a programmer require additional “–pad –confirm” parameter for imgtool. This parameter adds additional trailer to the signed image and is required by bootloader DIRECT-XIP process. Signed images used in OTA process do not require “-pad” parameter.
Flash remap mechanisms in NXP devices
There are currently two flash remapping mechanisms:
Flash remap using overlay
active region overlays inactive region - inactive region is logically not accessible for read - for flash reads user has to manually use a peripheral driver of the memory device
OTA process has to download the OTA image into primary or secondary slot depending on the active flag location
Flash remap using swap
active region swaps address range with inactive region - both regions are logically accessible
OTA process always downloads the OTA image into secondary (candidate) slot as the primary slot always “virtually” holds the active flag
Supported Boards
Flash remap using overlay
Flash remap using swap