User Guide - sdphost#

This document describes the usage of Serial Download Protocol Host (sdphost), a PC host application.

The sdphost tool is a useful tool in the factory programming and manufacturing process. It can be used to test and develop the automation software and test setups. It can be invoked from other applications too.

This document introduces the serial download protocol, typical factory programming setup, and usage of the tool and description of its sub-command line interface. It also provides a set of example usages of sdphost tool and its sub-command line arguments with a device.

Serial Download Protocol#

Serial Download Protocol is a set of commands supported by NXP i.MX RT devices in the Boot ROM application’s serial download mode.

The purpose of serial download protocol is to provide means to download bootable images from a PC to the device’s internal or external RAM memory. There are a set of commands to read and write to a memory/register unit, read status of the last command, download images to a given address in internal/external memory, and provide the address to jump and execute the downloaded image.

Typical setup#

The sdphost tool is used in the development phase of the device firmware application, manufacturing, and factory programming process.

The sdphost tool would run on the PC host, and the device would run in Boot ROM serial download mode. The MCU has BOOT_MODE pins that can be used to boot the device in serial downloader mode. The device’s reference manual provides the documentation on booting the device in serial downloader mode.

Communication#

The sdphost tool communicates with NXP i.MX RT devices connected on the host PC via USB-HID or UART device.

sdphost - USB#

sdphost could be connected to MCU over USB HID.

USB device identification in SPSDK

sdphost - UART#

sdphost could be connected to MCU over UART.

UART device identification in SPSDK

Command line interface#

sdphost#

Utility for communication with ROM on i.MX targets using SDP protocol.

sdphost [OPTIONS] COMMAND [ARGS]...

Options

-p, --port <COM[,speed>#

Serial port configuration. Default baud rate is 115200. Use ‘nxpdevscan’ utility to list devices on serial port.

-u, --usb <VID:PID|USB_PATH|DEV_NAME>#

USB device identifier.

Following formats are supported: <vid>, <vid:pid> or <vid,pid>, device/instance path, device name.
<vid>: hex or dec string; e.g. 0x0AB12, 43794.
<vid/pid>: hex or dec string; e.g. 0x0AB12:0x123, 1:3451.
Use ‘nxpdevscan’ utility to list connected device names.
-x, --plugin <identifier=PLUGIN_IDENTIFIER[,param1=value1,param2=value2>#

Plugin interface settings.

Following format of plugin setting is supported:

identifier=<PLUGIN_IDENTIFIER>[,<key1>=<value1>,<key2>=<value2>,…]
- <PLUGIN_IDENTIFIER>: Corresponds to the ‘identifier’ attribute of the plugin class
- <key1>=<value1>: Represent a single interface parameter
Optional interface settings:
- Any number of optional <key>=<value> scan settings separated by comma can be defined
- The <key>=<value> pairs are used as keyword parameters for ‘scan’ method of a plugin class
-j, --json#

Use JSON output

-t, --timeout <ms>#

Sets timeout when waiting on data over a serial line. The default is 10000 milliseconds.

-v, --verbose#

Print more detailed information

-vv, --debug#

Display more debugging information.

--version#

Show the version and exit.

--help#

Show this message and exit.

error-status#

Reads the error code from the device.

sdphost error-status [OPTIONS]

jump-address#

Jumps to the entry point of the image at the given address.

jump-address will result in the execution of the image once the ROM process the IVT and on successful authentication of the image.

ADDRESS - starting address of the image
sdphost jump-address [OPTIONS] ADDRESS

Arguments

ADDRESS#

Required argument

read-register#

Reads the contents of a memory location or register value.

The address of the register or memory location should be passed in as the first argument. Optional arguments include the data format of the register value in the number of bits and number of bytes to read.

ADDRESS - starting address where to read
FORMAT - bits per item: valid values: 8, 16, 32; default 32
COUNT - bytes to read; default size of FORMAT
sdphost read-register [OPTIONS] ADDRESS [FORMAT] [COUNT]

Options

-o, --output <output>#

Path to a file, where to store the output.

-h, --use-hexdump#

Use hexdump format

Arguments

ADDRESS#

Required argument

[FORMAT]#

Optional argument

COUNT#

Optional argument

set-baudrate#

Configures UART baudrate.

The SDP command SET_BAUDRATE is used by the host to configure the UART baudrate on the device side. The default baudrate is 115200. Please note that this command is not supported on all devices.

BAUDRATE - baudrate to be set
sdphost set-baudrate [OPTIONS] BAUDRATE

Arguments

BAUDRATE#

Required argument

write-file#

Writes file to the device’s memory address.

ADDRESS - starting address of the image
FILE - binary file to write
COUNT - Count is the size of data to write in bytes (default: whole file)
sdphost write-file [OPTIONS] ADDRESS FILE [COUNT]

Arguments

ADDRESS#

Required argument

FILE#

Required argument

COUNT#

Optional argument