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.
sdphost - UART
sdphost could be connected to MCU over UART.
Command line interface
sdphost
Utility for communication with ROM on i.MX targets.
sdphost [OPTIONS] COMMAND [ARGS]...
Options
- -p, --port <COM[,speed>
Serial port configuration. Default baud rate is 57600. 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.
- -j, --json
Use JSON output
- -t, --timeout <ms>
Sets timeout when waiting on data over a serial line. The default is 5000 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.
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.
sdphost read-register [OPTIONS] ADDRESS [FORMAT] [COUNT] [FILE]
Options
- -h, --use-hexdump
Use hexdump format
Arguments
- ADDRESS
Required argument
- [FORMAT]
Optional argument
- COUNT
Optional argument
- FILE
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.
sdphost set-baudrate [OPTIONS] BAUDRATE
Arguments
- BAUDRATE
Required argument
write-file
Writes file to the device’s memory address.
sdphost write-file [OPTIONS] ADDRESS FILE [COUNT]
Arguments
- ADDRESS
Required argument
- FILE
Required argument
- COUNT
Optional argument