Applications#

SPSDK includes several applications which could be called directly from the command line.

../_images/spsdk-architecture-apps.png

Command-line applications are available in PATH after activating a virtual environment with SPSDK installed in it.

Note

See how to install SPSDK in Installation Guide chapter. If you don’t use virtual environments, the availability is not guaranteed (you’d need to add Python’s Scripts folder to PATH first).

All applications could be accessed either using a special application called spsdk or directly by its name (e.g. blhost, pfr, …).

spsdk --help

Application Philosophy#

The goal is to provide a simple way of interaction between the application and the user and avoid long and complex command lines with lots of options. All configuration should be passed as configuration file. Application should provide get-template command to generate a template of the configuration file for the selected family of devices. This configuration file should be used as an input for the application and should be well described. The configuration file should be in YAML format. Some applications are generating multiple templates, this is done using the get-templates command.

Most of the CLI application are used for generating some sort of binary files from configuration files, the command for generating the binary from configuration should be export with simple -c option for the configuration file. Some applications also allow the user to parse the binary file and extract the configuration from it. This is done by the parse command with the -b option for the binary file.

<application> get-template -o <output_config>
<application> export -c <configuration_file>
<application> parse -b <binary_file> -o <output_directory>

All applications should provide a help message with the list of available commands and options. The help message should be displayed when the application is called with the –help option.

Most of the applications require family option, specified as –family or -f option. This option is used to select the family of devices for which the application should be used. The family option is mandatory for most of the applications. This allows the application to generate the correct configuration file for the selected family of devices and to validate the configuration file against the selected family of devices.

Note

Click strictly separates parameters between commands and subcommands. What this means is that options and arguments for a specific command have to be specified after the command name itself, but before any other command names.

Application Connectivity#

Some applications communicate with NXP devices connected to the host PC. Details on how to configure the connectivity could be found in the following chapters:

Application Overview#

SPSDK applications are used for various functions and not all applications are valid for all NXP MCU device portfolios. The table mapping particular applications to a specific device is below.

NXPIMAGE Supported devices#

Device

rot

Master Boot Image (MBI)

Secure Binary 2.1

Bootable Image

FlexSPI Configuration Block (FCB)

tz

OTFAD

Secure Binary 3.1

External Memory Configuration Data (XMCD)

HAB

IEE

AHAB

BEE

k32w148

v2.1

kw45b41z5

v2.1

kw45b41z8

v2.1

lpc5502

lpc5504

lpc5506

lpc5512

lpc5514

lpc5516

lpc5526

lpc5528

lpc5534

lpc5536

lpc55s04

v1.0

lpc55s06

v1.0

lpc55s14

v1.0

lpc55s16

v1.0

lpc55s26

v1.0

lpc55s28

v1.0

lpc55s36

v2.1

lpc55s66

v1.0

lpc55s69

v1.0

lpc804

lpc810

lpc812

lpc845

lpc864

lpc865

mc56f81646

mc56f81648

mc56f81666

mc56f81668

mc56f81746

mc56f81748

mc56f81766

mc56f81768

mc56f81866

vX

mc56f81868

vX

mcxa132

mcxa133

mcxa142

mcxa143

mcxa144

mcxa145

mcxa146

mcxa152

mcxa153

mcxa154

mcxa155

mcxa156

mcxn235

v2.1

mcxn236

v2.1

mcxw716a

v2.1

mcxw716c

v2.1

mimx8ulp

SRK AHAB

mimx9352

SRK AHAB

mimxrt1010

SRK HAB

mimxrt1015

SRK HAB

mimxrt1020

SRK HAB

mimxrt1024

SRK HAB

mimxrt1040

SRK HAB

mimxrt1050

SRK HAB

mimxrt1060

SRK HAB

mimxrt1064

SRK HAB

mimxrt1165

SRK HAB

mimxrt1166

SRK HAB

mimxrt1171

SRK HAB

mimxrt1172

SRK HAB

mimxrt1173

SRK HAB

mimxrt1175

SRK HAB

mimxrt1176

SRK HAB

mimxrt1181

SRK AHAB

mimxrt1182

SRK AHAB

mimxrt1187

SRK AHAB

mimxrt1189

SRK AHAB

mimxrt533s

v1.0

mimxrt555s

v1.0

mimxrt595s

v1.0

mimxrt685s

v1.0

mimxrt798s

v2.1

mwct2012

mwct2012a

mwct2014s

mwct2015s

mwct2016s

mwct20d2

vX

mwct20d2a

vX

mwct2d16s

mwct2d17s

nhs52s04

v1.0

rw610

v2.1

rw612

v2.1

Other apps supported devices#

Device

nxpdebugmbox

PFR

tphost

nxpmemcfg

shadowregs

lpcprog

blhost

ifr

el2go-host

nxpdevhsm

nxpwpc

nxpdice

NXPELE

nxpuuu

k32w148

kw45b41z5

kw45b41z8

lpc5502

lpc5504

lpc5506

lpc5512

lpc5514

lpc5516

lpc5526

lpc5528

lpc5534

lpc5536

lpc55s04

lpc55s06

lpc55s14

lpc55s16

lpc55s26

lpc55s28

lpc55s36

lpc55s66

lpc55s69

lpc804

lpc810

lpc812

lpc845

lpc864

lpc865

mc56f81646

mc56f81648

mc56f81666

mc56f81668

mc56f81746

mc56f81748

mc56f81766

mc56f81768

mc56f81866

mc56f81868

mcxa132

mcxa133

mcxa142

mcxa143

mcxa144

mcxa145

mcxa146

mcxa152

mcxa153

mcxa154

mcxa155

mcxa156

mcxn235

mcxn236

mcxw716a

mcxw716c

mimx8ulp

mimx9352

mimxrt1010

mimxrt1015

mimxrt1020

mimxrt1024

mimxrt1040

mimxrt1050

mimxrt1060

mimxrt1064

mimxrt1165

mimxrt1166

mimxrt1171

mimxrt1172

mimxrt1173

mimxrt1175

mimxrt1176

mimxrt1181

mimxrt1182

mimxrt1187

mimxrt1189

mimxrt533s

mimxrt555s

mimxrt595s

mimxrt685s

mimxrt798s

mwct2012

mwct2012a

mwct2014s

mwct2015s

mwct2016s

mwct20d2

mwct20d2a

mwct2d16s

mwct2d17s

nhs52s04

rw610

rw612

blhost#

The blhost application is a utility for communication with MCU Bootloader on NXP devices.

It allows user to:

  • apply configuration block at internal memory address to memory with ID

  • program one word of OCOTP Field

  • read one word of OCOTP Field

  • erase region of the flash

  • erase all flash/sections of flash according to memory id

  • erase complete flash memory and recover flash security section

  • fill memory with a pattern

  • get/set bootloader-specific property

  • write/read memory

  • reset the device

  • generate the Key Blob for a given DEK

  • receive SB file

  • load a boot image to the device

  • key provisioning

  • execute an application at the address

  • write image to memory specified by ID

  • invoke code at an address

  • program aeskey

  • disable flash security by using of backdoor key

  • read resource of flash module

  • program/read fuse

  • list all memories

  • perform reliable update

  • invoke blhost commands defined in command file

  • perform trust-provisioning commands

blhost --help

ifr#

The ifr application allows user to generate IFR0:

  • generate user configuration

  • parse binary and extract configuration

  • generate binary data

  • list supported devices

ifr --help

nxpcrypto#

The nxpcrypto application allows user to:

  • generate RSA/ECC key pairs (private and public) with various key’s attributes

  • verify key pairs

  • convert key file format (PEM/DER/RAW)

  • generate/verify x509 certificates

  • generate/verify hash digests

nxpcrypto --help

nxpdebugmbox#

The nxpdebugmbox application allows user to:

  • perform the Debug Authentication

  • start/exit Debug Mailbox

  • enter ISP mode

  • set Fault Analysis Mode

  • erase flash

  • test connection

  • generate debug credential files based on YAML configuration file

  • generate the template of Debug Credentials YAML configuration file

nxpdebugmbox --help

nxpdevhsm#

The nxpdevhsm application allows user to generate provisioned SB file.

nxpdevhsm --help

nxpdevscan#

The nxpdevscan application allows users to list all connected USB and UART NXP devices.

nxpdevscan --help

nxpimage#

The nxpimage application allows users to:

  • generate/parse AHAB images

  • generate/parse HAB images

  • generate TrustZone images

  • generate MasterBootImage images

  • generate SecureBinary images

  • generate custom binaries

nxpimage --help

nxpmemcfg#

The nxpmemcfg application allows users to:

  • check database of known configuration option words for external memories

  • parse existing configuration option words

  • export option words from configuration

  • generate BLHOST scripts to configure memory

nxpmemcfg --help

PFR#

The pfr application is a utility for generating and parsing Protected Flash Region data (CMPA, CFPA).

It allows user to:

  • generate user configuration

  • parse binary and extract configuration

  • generate binary data.

  • generate HTML page with brief description of CMPA/CFPA configuration fields

  • list supported devices

pfr --help

sdphost#

The sdphost application is a utility for communication with ROM on i.MX targets using SDP protocol (i.MX RT1xxx).

It allows user to:

  • get error code of the last operation

  • jump to the entry point of the image with IVT at a specified address

  • write a file at the address

  • read one or more registers

sdphost --help

sdpshost#

The sdpshost application is a utility for communication with ROM on i.MX targets using SDPS protocol (i.MX8/9).

It allows the user to write boot image data from the provided binary file.

Warning

This is an experimental utility. Use with caution!

sdphost --help

shadowregs#

The shadowregs application is a utility for Shadow Registers controlling.

It allows user to:

  • save the current state of shadow registers to the YAML file

  • load new state of shadow registers from YAML file into the microcontroller

  • print all shadow registers including their current values

  • print the current value of one shadow register

  • set a value of one shadow register defined by parameter

  • reset the connected device

  • print a list of supported devices

shadowregs --help

Deleted/deprecated applications#

nxpcertgen#

Note

This tool was replaced by nxpcrypto

nxpkeygen#

Note

This tool was replaced by nxpcrypto

elftosb#

Note

This tool was replaced by nxpimage