MCUXpresso SDK Documentation

RT7xx - OTA update by using SB3 file#

In this walkthrough, the device lifecycle is not changed where possible (for development purposes), so that the device can be restored to its initial state. In real-world scenarios, transitioning the chip to the appropriate lifecycle depends on the specific requirements.

Common information related to SB3 is available in the documentation ‘OTA update by using SB3 file’.

1. Provisioning of the device - initial setup#

The device must be provisioned to support SB3 processing. To simplify the workflow, the MCUXpresso Secure Provisioning Tool (SEC tool) is used.

The RT7xx family supports shadow registers to process SB3 files for development purposes, so there is no need to advance the lifecycle.

To provision the device perform the following steps:

  1. Erase the device

  2. Build the mcuboot_opensource + ota_mcuboot_basic or the ota_rom_basic project, depending on what you want to evaluate

  3. Get the device into ISP mode

    • On development boards this is typically done by holding the ISP button and pressing the reset button

  4. Open the SEC tool and create a new workspace for the RT7xx target device

    • Test the ISP connection in SEC tool (Target -> Connection…)

    • Setup and test debug probe (Target -> Debug Probe…)

  5. Switch to PKI management tab

    • Click Generate keys (leave default settings) and then switch back to Build image tab

Image

  1. (Optional) Let ROM generate FCB

    • Target -> Boot Memory (or CTRL+B)

    • Select Boot memory type -> XSPI NOR - simplified

    • Click Convert to complete FCB, check option Apply the converted FCB as the boot device configuration and then click Convert

  2. Initial setup

    • Boot: Plain signed

      • Note: uncheck the option to replace the FCB if you performed step 6

    • Lifecycle: Develop, shadows

    • Select an authentication key and generate CUST_MK_SK and OEM SB seed

    • For MCUboot use case:

      • Select mcuboot_opensource output binary or ELF image as Source executable image

      • Click Additional images

      • Check Image 1 and set a path to an image of signed application ota_mcuboot_basic

      • Note: This initial image has to be generated with additional --pad --confirm imgtool arguments

      • Set Target address 0x28040000 (see flash_partitioning.h) to place this initial image in primary slot

    • For ROM only use case:

      • Select ota_rom_basic output binary or ELF image as Source executable image

      • Click Dual image boot

      • Set Target dual boot image to Image 0

      • Set Image 1 offset to 0x400000 (4MB)

      • Set Image 1 size to Same as offset

      • Click OK

      • Click Firmware versions

      • Set the initial image firmware version to 1 (this number is evaluated by the ROM during boot when selecting the image with the highest version)

      • Click OK

    • Click Build image

Image

  1. Write image tab

    • Click Write image

  2. Switch boot from ISP to normal boot (XSPI0) and soft reset the board

Now the device is provisioned with RKTH and CUST_MK_SK using shadow registers, without transitioning the lifecycle. The shadow registers are preserved and re-initialized on a soft reset (without a power cycle).

2. Prepare OTA images#

RT7xx uses the flash remapping feature with the overlay mechanism (see ‘MCUboot and flash remapping feature’). For this reason, we have to prepare an OTA image targeting the currently inactive image slot. The following steps assume that the primary slot (or image 0) is active and that we have to prepare an OTA image targeting the second slot (or image 1).

2.1 ROM only use case#

Flash memory layout with 4MB image offset looks like this:

Partition

offset

size

FCB

0x28000000

0x004000

Image 0

0x28004000

0x400000

Image 1

0x28400000

0x400000

  1. Switch to Build Image tab

  2. Increase image version using Firmware versions to number 2 and click Build image

  3. Open Tools -> SB Editor (CTRL + E)

    • Click Import from workspace to initialize a template for adjustment

    • Rework the command sequence into these commands:

      • configureMemory - configAddress: 0x28000000 memoryId: $memoryId

      • erase - configAddress: 0x28400000 size: $(appEraseSize) memoryId: $memoryId

      • Note: depending on the erase size, the erase command is a blocking operation and could leave the device unresponsive for a longer period of time. It is recommended to let the application perform the erase before processing the OTA SB file.

      • load - configAddress: 0x28400000 memoryId: memoryId data: ${appPath}

    • Change the name of the secure binary file to ota_rom_image1.sb

    • Click Generate

Image

  • The same steps can be used for an OTA image targeting the image 0 slot, with these adjustments:

    • The image version has to be higher than the active one in the image 1 slot

    • configAddress: 0x28004000

2.2 MCUboot bootloader use case#

The flash memory layout, according to the settings in flash_partitioning.h, should look like this:

Partition

offset

size

FCB + MCUBOOT

0x28000000

0x040000

Primary slot

0x28040000

0x200000

Secondary slot

0x28240000

0x200000

  1. Switch to Build Image tab

  2. Sign ota_mcuboot_basic using imgtool with a higher image version as usual, following the steps in the example_board_readme.md for your board.

  3. Open Tools -> SB Editor (CTRL + E)

    • Click Import from workspace to initialize a template for adjustment

    • Rework the command sequence into these commands:

      • configureMemory - configAddress: 0x28000000 memoryId: $memoryId

      • erase - configAddress: 0x28400000 size: 0x200000 memoryId: $memoryId

      • Note: depending on the erase size, the erase command is a blocking operation and could leave the device unresponsive for a longer period of time. It is recommended to let the application perform the erase before processing the OTA SB file.

      • load - configAddress: 0x28240000 memoryId: memoryId data: path to signed ota_mcuboot_basic

    • Change the name of the secure binary file to ota_mcuboot_secondary_slot.sb

    • Click Generate

Image

  • The same steps can be used for an OTA image targeting the primary slot, with these adjustments:

    • The image version has to be higher than the active one in the secondary slot

    • configAddress: 0x28040000

3. Firmware update#

For demonstration purposes we use the ExtraPutty tool, as this fork of the classic PuTTY has XMODEM support. Alternatively, TeraTerm can be used.

Note: keep in mind that a hard reset invalidates the shadow registers.

3.1 ROM bootloader only use case#

  1. Run the initial ota_rom_basic application

  2. Check the image state and the active flag location with the image command

    • Use the active flag location to determine the inactive image slot

  3. Send the OTA image

    • Run the xmodem_sb3 command

    • Send ota_rom_image1.sb, targeting the inactive slot, via Files Transfer/Xmodem (1k)

  4. Reboot the device with reboot command

  5. Check image update with image command

Here is an example of serial output:


*************************************
* Basic ROM application example     *
*************************************

$ image
Flash REMAP_OVERLAY disabled
IMAGE 0:
    <IMG_VERSION 0x1 LENGTH 36820 EXEC_ADDR 0x28004000>
    *ACTIVE*
IMAGE 1: Invalid image header
$ xmodem_sb3
Started xmodem processing SB3
Initiated XMODEM-CRC transfer. Receiving... (Press 'x' to cancel)
CCCC
Received 42880 bytes
SB3 has been processed
$
$ reboot
System reset!

*************************************
* Basic ROM application example     *
*************************************

$ image
Flash REMAP_OVERLAY active
IMAGE 0:
    <IMG_VERSION 0x1 LENGTH 36820 EXEC_ADDR 0x28004000>
IMAGE 1:
    <IMG_VERSION 0x2 LENGTH 36820 EXEC_ADDR 0x28004000>
    *ACTIVE*
$

3.2 MCUboot bootloader use case#

  1. Run the initial ota_mcuboot_basic application

  2. Check the image state and the active flag location with the image command

    • Use the active flag location to determine the inactive image slot

  3. Erase the inactive slot with the image erase command

    • Note: not needed if the SB file contains the erase command

  4. Send the OTA image

    • Run the xmodem_sb3 command

    • Send ota_mcuboot_secondary_slot.sb, targeting the inactive slot, via Files Transfer/Xmodem (1k)

  5. Mark the installed image ready for test

    • Run the image test command

  6. Reboot the device with the reboot command

  7. Check the image update with the image command

  8. Mark the updated slot with the confirm flag using image accept, and check the state again with the image command

hello sbl.
Bootloader Version 2.2.0
Primary   slot: version=1.0.0+1000
Image 0 Secondary slot: Image not found
Image 0 loaded from the primary slot
Bootloader chainload address offset: 0x40000
Reset_Handler address offset: 0x40400
Jumping to the image


Booting the primary slot - flash remapping is disabled

*************************************
* Basic MCUBoot application example *
*************************************

Built Oct  3 2025 20:33:10
Toolchain IAR ANSI C/C++ Compiler V9.70.1.475/W64 for ARM

$ image
Image 0; name APP; state None:

  Slot 0 APP_PRIMARY; offset 0x40000; size 0x200000 (2097152):
    <IMAGE: size 42421; version 1.0.0+1000>
    SHA256 of image payload: E069B6127A708EE88B39...
    log_addr 0x28040000
    *ACTIVE*

  Slot 1 APP_SECONDARY; offset 0x240000; size 0x200000 (2097152):
    <No Image Found>

$ image erase
Erasing inactive slot...done
$ xmodem_sb3
Started xmodem processing SB3
Make sure this device is provisioned to accept secure binary and its load address is 0x240000
Initiated XMODEM-CRC transfer. Receiving... (Press 'x' to cancel)
CCCCC
Received 51200 bytes
SB3 has been processed
$
$ image test
write magic number offset = 0x43ff00
$ reboot
System reset!
hello sbl.
Bootloader Version 2.2.0
Primary   slot: version=1.0.0+1000
Secondary slot: version=1.1.0+1000
writing copy_done; fa_id=1 off=0x1fffe0 (0x43ffe0)
Image 0 loaded from the secondary slot
Bootloader chainload address offset: 0x240000
Reset_Handler address offset: 0x240400
Jumping to the image


Booting the secondary slot - flash remapping is enabled

*************************************
* Basic MCUBoot application example *
*************************************

Built Oct  3 2025 20:33:10
Toolchain IAR ANSI C/C++ Compiler V9.70.1.475/W64 for ARM

$ image
Flash REMAP_OVERLAY active.

Image 0; name APP; state Testing:

  Slot 0 APP_PRIMARY; offset 0x40000; size 0x200000 (2097152):
    <IMAGE: size 42421; version 1.0.0+1000>
    SHA256 of image payload: E069B6127A708EE88B39...
    log_addr 0x28040000 remaps to 0x28240000

  Slot 1 APP_SECONDARY; offset 0x240000; size 0x200000 (2097152):
    <IMAGE: size 42421; version 1.1.0+1000>
    SHA256 of image payload: E069B6127A708EE88B39...
    log_addr 0x28240000 remaps to 0x28240000
    *ACTIVE*

$ image accept
$ image
Flash REMAP_OVERLAY active.

Image 0; name APP; state Permanent:

  Slot 0 APP_PRIMARY; offset 0x40000; size 0x200000 (2097152):
    <IMAGE: size 42421; version 1.0.0+1000>
    SHA256 of image payload: E069B6127A708EE88B39...
    log_addr 0x28040000 remaps to 0x28240000

  Slot 1 APP_SECONDARY; offset 0x240000; size 0x200000 (2097152):
    <IMAGE: size 42421; version 1.1.0+1000>
    SHA256 of image payload: E069B6127A708EE88B39...
    log_addr 0x28240000 remaps to 0x28240000
    *ACTIVE*

$

Supported Boards#