The i.MX RT has built-in bootloader in ROM that implements the NXP Serial Download Protocol (SDP), which can be used to load & execute TinyUF2 to SRAM with spdhost
tool via USB.
The built-in ROM bootloader is unerasable, which means your board is never 'bricked' - it can always be restored to factory firmware! We don't use the ROM bootloader for general purpose code upload because it's not as easy to use as TinyUF2 which allows drag-and-dropping of firmware UF2 files. However, if you ever have to factory-reset the board, or if you are developing with NXP software that expects to talk directly to the ROM bootloader, this page is for you!
Step 1. Install SPSDK to get the sdphost tool
Install the NXP SPSDK with pip install spsdk
. More details are described in the SPSDK Installation Guide. If you are running Linux, make sure your user has permission for accessing hidraw
.
Power up your board with the Boot Mode switch set to BOOT_MODE[1:0]=01
to enter Serial Download mode. That means the Boot Select B0 switch is 'on' (next to the ON text) Boot Select B1 switch is 'off' (not next to the ON text).
Note that the Serial Download mode will automatically run with blank flash, so if you have a fresh QSPI flash chip, the boot select switch doesn't matter
Download the tinyuf2-metro_m7_1011.bin binary firmware file and place it into the directory you are running python3 from, then run:
sdphost -v -u 0x1fc9,0x0145 -- write-file 0x20206400 tinyuf2-metro_m7_1011.bin sdphost -u 0x1fc9,0x0145 jump-address 0x20207000
To upload the binary file to RAM memory and then jump to the main()
function (which is not at the exact same address!) which will burn the bootloader to FLASH.
Text editor powered by tinymce.