RW61x - 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. Provision the device#
The device must be provisioned to support SB3 processing. To simplify the workflow, the MCUXpresso Secure Provisioning Tool (SEC tool) is used.
To provision the device perform the following steps:
Erase the device
Build the
mcuboot_opensource+ota_mcuboot_basicor theota_rom_basicproject, depending on what you want to evaluateGet the device into ISP mode
On development boards this is typically done by holding the ISP button and pressing the reset button
Open the SEC tool and create a new workspace for the RW61x target device
Test the ISP connection in the SEC tool
Switch to PKI management tab
Click Generate keys (leave default settings)

RW61x does not properly support shadow registers to process SB3 files for development purposes, so the correct RKTH and CUST_MK_SK have to be provisioned. To provision these keys while keeping the device in the Develop lifecycle, we initially use the Encrypted (IPED) Plain boot type as a workaround. This initial operation provisions the device with RKTH and CUST_MK_SK permanently, but the board remains usable for development purposes, as OTP BOOT_CFG0 (fuseword 15) remains intact.
Note: the user is advised to save the SEC tool workspace (or at least the keys) for future use.
Build Image
Boot: Encrypted (IPED) Plain
Select
ota_rom_basicormcuboot_opensourceoutput binary or ELF image as Source executable imageLifecycle: Develop, OTP
Select an authentication key and generate CUST_MK_SK and OEM SB seed
Click Build image

Write image
Click Write image

Now the device is provisioned with RKTH and CUST_MK_SK without transitioning the lifecycle.
Enable dual image support
Note: This is needed only for ROM bootloader use case, otherwise skip this step
The correct image offset and size have to be programmed into OTP fuseword 17 (BOOT_CFG2). In this example we use these values:
FLEXSPI_IMAGE_SIZE = 0x0 (The size of the boot image is considered to be equal to the offset of the second image)
FLEXSPI_IMAGE_OFFSET = 0x10
Fuse the OTP using blhost:
blhost -p COM3,115200 -- efuse-program-once 17 00008000
Note: We set a 4MB offset here, but the final value is up to the user as this operation is also permanent. The device will still be usable for development purposes, as ROM evaluates only the valid image header of a signed image and looks for image version presence.
Erase device
This will erase encrypted image from the workaround.
Load MCUboot (only MCUboot use case)
Load the unencrypted, unsigned mcuboot_opensource to the device using a programmer, as usual.
2. Prepare OTA images#
2.1 ROM bootloader only use case#
Build Image tab
Boot: Plain Signed
Select
ota_rom_basicoutput binary or ELF image as Source executable imageDefine Image version 1
Enable Dual image boot with these parameters:
Target dual boot image: Image 0
Image 1 offset: 0x00400000
Image 1 size: Same as offset
Click Build image

Rename the generated SB3 file
bootable_images/ota_rom_basic.sbtoota_rom_image0.sbRepeat step 1 with these changes:
Define Image version 2
In Dual image boot:
Target dual boot image: Image 1
Click Build image
Rename the generated SB3 file
bootable_images/ota_rom_basic.sbtoota_rom_image1.sb
Note: Do not write the image using the Write image tab! This would also fuse BOOT_CFG0 to enable secure boot. The initial SB3 file will be written separately in the next chapter.
2.2 MCUboot bootloader use case#
Build
ota_mcuboot_basicand sign the image withimgtoolas usual, following the steps in theexample_board_readme.mdfor your board. Copy the signed binary to your$sec_tool_workspace/source_images.Look into the
ota_examples/_common/sb3_templatesdirectory and copy the SB3 configuration templates for your device to your$sec_tool_workspace/configs.rw612_sb3_cfg_primary_slot.yamlfor the primary slotrw612_sb3_cfg_secondary_slot.yamlfor the secondary slot
In the SEC tool, open Tools/SB Editor and click Import to import
sb3_config_rw612_secondary_slot.yaml.Check and, if necessary, fix the paths to the keys and the image binary.
Click Generate.

Repeat step 3 for
sb3_config_rw612_primary_slot.yaml.
Note: Optionally, an initial SB3 file containing the initial (first) ota_mcuboot_basic application for the primary or secondary slot can be created to simulate the manufacturing process. This image has to be generated with the additional --pad --confirm imgtool arguments. The initial signed image can also be loaded directly using ISP (via blhost and the receive-sb-file command) or another preferred method, as usual.
Note 2: Do not write the image using the Write image tab! This would also fuse BOOT_CFG0 to enable secure boot. The initial SB3 file will be written separately in the next chapter.
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.
3.1 ROM bootloader only use case#
Load and run the initial
ota_rom_basicapplication in one of these ways:load signed image via
blhostcommands:blhost -p COM3,115200 -- fill-memory 0x20001000 0x4 0xC0000004blhost -p COM3,115200 -- configure-memory 0x9 0x20001000blhost -p COM3,115200 -t 20000 receive-sb-file ota_rom_basic_image_0_v1
or
load the unsigned application via a debug session - in this case the
imagecommand returns invalid information, as there is no valid image header to parse
Check the image state and the active flag location with the
imagecommandUse the active flag location to determine the inactive image slot
Send the OTA image
Run the
xmodem_sb3commandSend
ota_rom_image1.sb, targeting the inactive slot, via Files Transfer/Xmodem (1k)
Reboot the device with
rebootcommandCheck image update with
imagecommand
Here is an example of serial output:
*************************************
* Basic ROM application example *
*************************************
$ image
Flash REMAP_OVERLAY disabled
IMAGE 0:
<IMG_VERSION 0x1 LENGTH 34884 EXEC_ADDR 0x8001000>
*ACTIVE*
IMAGE 1: Invalid image header
$ xmodem_sb3
IAP API version=1.0.0
Started xmodem processing SB3
Initiated XMODEM-CRC transfer. Receiving... (Press 'x' to cancel)
CCCCCCC
Received 41984 bytes
SB3 has been processed
$
$ reboot
System reset!
*************************************
* Basic ROM application example *
*************************************
$ image
Flash REMAP_OVERLAY active
IMAGE 0:
<IMG_VERSION 0x1 LENGTH 34884 EXEC_ADDR 0x8001000>
IMAGE 1:
<IMG_VERSION 0x2 LENGTH 34884 EXEC_ADDR 0x8001000>
*ACTIVE*
$
3.2 MCUboot bootloader use case#
Load
mcuboot_opensourceand run the initialota_mcuboot_basicapplication in one of these ways:load signed image via
blhostcommands:blhost -p COM3,115200 -- fill-memory 0x20001000 0x4 0xC0000004blhost -p COM3,115200 -- configure-memory 0x9 0x20001000blhost -p COM3,115200 -t 20000 receive-sb-file signed_padded_ota_mcuboot_basic_primary_slot.sb
or
load the unsigned application via a debug session - in this case the
imagecommand returns invalid information, as there is no valid image header to parse
Check the image state and the active flag location with the
imagecommandUse the active flag location to determine the inactive image slot
Erase the inactive slot with the
image erasecommandNote: not needed if the SB file contains the erase command
Send the OTA image
Run the
xmodem_sb3commandSend
ota_mcuboot_secondary_slot.sb, targeting the inactive slot, via Files Transfer/Xmodem (1k)
Mark the installed image ready for test
Run the
image testcommand
Reboot the device with the
rebootcommandCheck the image update with the
imagecommandMark the updated slot with the confirm flag using
image accept, and check the state again with theimagecommand
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.2.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.2.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.2.0+1000>
SHA256 of image payload: E069B6127A708EE88B39...
log_addr 0x28240000 remaps to 0x28240000
*ACTIVE*
$