There are two ways to install sdphost: Adafruit builds executables for Windows, Linux, and Mac as a part of the tinyuf2 project, and NXP offers a version on pypi.

Getting "sdphost" from pypi

If your computer has python & pip installed, this is the preferred method.

NXP offers the "NXP Secure Privisioning SDK" (SPSDK) on PyPI.

You may wish to create a virtual environment for this task, or use pipx to install the command using an isolated environment.

$ pip install spsdk
# many lines of output snipped
Successfully installed spsdk-1.11.0

Getting "sdphost" from the tinyuf2 project

If your computer doesn't have Python & PIP available, you can use this method.

First, grab the right version of sdphost for your host computer. There are versions for Windows, Mac, and Linux (including for Raspberry Pi).

Head to this downloads page on github and grab the version that is right for your Mac, PC or Raspberry Pi.

Getting the TinyUF2 bootloader file

Next, download the right tinyuf2 bootloader for your particular board. Head to the tinyuf2 releases page and download the correct zip file, such has "tinyuf2-metro_m7_1011" for the Metro M7 RT1011.

From inside the zip file, extract the ".bin" file. Usually, putting it in the same folder as the sdphost program is easiest.

Open up a terminal window and issue two commands with sdphost, changing the name of the .bin file as appropriate:

sdphost -u 0x1fc9,0x0145 -- write-file 0x20206400 tinyuf2-imxrt1010_evk.bin
sdphost -u 0x1fc9,0x0145 -- jump-address 0x20207000
On Linux, it may be necessary to prefix these commands with sudo

The hex numbers above are the same for any RT1010/RT1011 board. Different processors need different parameters. These are the values used by tinyuf2 for various evk boards:

# sdphost command for imxrt1010_evk:
sdphost -u 0x1fc9,0x0145 -- write-file 0x20206400 tinyuf2-imxrt1010_evk.bin
sdphost -u 0x1fc9,0x0145 -- jump-address 0x20207000

# sdphost command for imxrt1020_evk:
sdphost -u 0x1fc9,0x0130 -- write-file 0x1000 tinyuf2-imxrt1020_evk.bin
sdphost -u 0x1fc9,0x0130 -- jump-address 0x2000

# sdphost command for imxrt1024_evk:
sdphost -u 0x1fc9,0x0130 -- write-file 0x1000 tinyuf2-imxrt1024_evk.bin
sdphost -u 0x1fc9,0x0130 -- jump-address 0x2000

# sdphost command for imxrt1060_evk:
sdphost -u 0x1fc9,0x0135 -- write-file 0x1000 tinyuf2-imxrt1060_evk.bin
sdphost -u 0x1fc9,0x0135 -- jump-address 0x2000

# sdphost command for imxrt1064_evk:
sdphost -u 0x1fc9,0x0135 -- write-file 0x1000 inyuf2-imxrt1064_evk.bin
sdphost -u 0x1fc9,0x0135 -- jump-address 0x2000

These commands run really quickly, in well under a second. Once the sdphost commands finish, your board will re-connect via USB, for instance as RT1010BOOT. However, before you do anything else, you need to return the switches to their usual position.

On the RT1011 EVK, return switches SW8.3 and SW8.4 to the positions shown here

On the Metro M7, set B0 to OFF and B1 to ON

 Then re-plug your device or use its reset button. This mode is sometimes called "FlexSPI boot".

Once again your device will connect as a BOOT device with a disk drive appearing. If it doesn't, double check the DIP switch settings and try pressing RESET twice in quick succession to activate the UF2 bootloader. If you've previously loaded software such as CircuitPython via UF2, it was not erased when you installed TinyUF2 and it will automatically be booted.

You can now drag any compatible UF2 file such as CircuitPython onto the drive.

To access the UF2 bootloader again at any time, press the reset button twice in quick succession. You can upgrade CircuitPython or TinyUF2 itself using the UF2 bootloader. Only if TinyUF2 becomes corrupted will you need to follow the instructions with sdphost again.

Continue installing CircuitPython by following the steps in this guide.

This guide was first published on Mar 27, 2021. It was last updated on Mar 08, 2024.

This page (Run sdphost Loader) was last updated on Mar 08, 2024.

Text editor powered by tinymce.