NAME
SYNOPSIS
DESCRIPTION
EXAMPLES
OVERVIEW
OPTIONS
EXIT STATUS
AUTHOR
SEE ALSO

NAME

ntdisp - a multiprotocol utility for In System Programming

SYNOPSIS

ntdisp COMMAND-OPTION PROTOCOL-OPTION [OPTIONS...] [FILE]
ntdisp
[-hV]

DESCRIPTION

ntdisp is basically a frontend to the NtdIsp class implemented by the ntdisp library. The purpose is to provide a generic interface for accessing embedded devices, such as ARM based boards, through their In System Programming protocol.

EXAMPLES

ntdisp -d /dev/ttyUSB0 -Cip stm

Wipe all the flash memory of the STM based ARM target connected to the /dev/ttyUSB0 port.

ntdisp -f 123456 -Rip lpc result.img

Dump to result.img all the data starting at 123456 up to the end of the flash memory of the LPC target connected to /dev/S0. Omitting result.img the data will be sent to the standard output.

ntdisp -id /dev/ttyS1 -f 1024 -n 256 -Wp lpc result.img

Download the first 256 bytes of result.img to the LPC target connected to /dev/S1, starting from address 1024.

ntdisp -d /dev/ttyS1 -f 1024 -Xp lpc

Execute on the target connected to /dev/S1 the code at address 1024 without initializing the communication with the target. This is functionally equivalent to a jump instruction.

OVERVIEW

ntdisp is a frontend, so it is expected to follow a 1:1 relationship with the properties defined in its underlying class (NtdIsp). This also means that everything ntdisp is able to do can be done programmatically by using the NtdIsp class.

OPTIONS

This program uses the GOption class extensively, the option parsing facility provided by the GLib2 library. Consult its documentation for details on how it works.

Command option

Every command must include one, and only one, of the following options. Failing to do so will result in an error for invalid arguments. Only exceptions are --version and --help.

-C, --command-clear

Clear the target memory.

By default all the memory is wiped out but --from and --nbytes can be used to specify a portion of it. Check their documentation for pitfalls on using explicit address and size.

-R, --command-read

Read the target memory and store the data in the file specified at the end of the command line. If the file argument is not specified, the data is dumped on the standard output.

By default all the memory is read but --from and --nbytes can be used to specify a portion of it. Check their documentation for pitfalls on using explicit address and size.

-W, --command-write

Download to the target the file specified at the end of the command line. If the file argument is not specified, the data will be read from the standard input.

By default the address where the file is downloaded is the starting address of the flash memory. Use --from for downloading to a custom address. Check its documentation for pitfalls on using explicit address.

-X, --command-execute

Execute the code on the target. Depending on the hardware, the target should be prepared before being able to execute this command. This usually means to disable the ISP, e.g. by opening a jumper, otherwise the target will reenter in ISP mode forever.

By default the command will jump to the starting address of the flash memory. Check the --from documentation for specifying a custom address.

Protocol option

This is a required option with no fallback values, so it must be always specified.

-p type, --protocol=type

For an up to date list of supported protocols, refer to the ntdisp documentation: the reference manual is autogenerated from the sources, hence more likely to be in sync with the binaries. Valid types include:

lpc

Support for the ISP protocol implemented by NXP on its LPC targets.

stm

Boot protocol used by STM32 and related boards.

Other options

-d DEVICE, --device=DEVICE

Device to use for communicating with the target. If not specified, /dev/ttyS0 will be used.

-i, --init

Perform the initialization step: autobaud, syncronization, probing of the target model and whatever needed by the selected protocol.

This option should be always specified after the target has been reset and omitted from further ntdisp calls when chaining multiple operations.

-f ADDRESS, --from=ADDRESS

Starting address the operation will refer to. If not specified, the begin address of the flash memory will be used.

This parameter is usually subject to hardware restrictions: the commands operating on the flash memory of the LPC protocol, for instance, work on a sector basis, so the address should refer to the start boundary of a sector. You must read the manual of the target device to know these hardware details.

-n BYTES, --nbytes=ADDRESS

Used by --command-clear and --command-read to define the size of the memory portion to be read or wiped. If not explicitely set, the size will default to the number of bytes starting from --from up to the end of the flash memory.

The same hardware restrictions described in the --from section could affect this option, so be sure to read the hardware manual of the target device before blaming ntdisp .

-v, --verbose

Enable verbose output.

Getting help

-h, --help

Print a help message and exit.

-V, --version

Display version information.

EXIT STATUS

0

Successful program execution.

1

The mandatory --protocol argument is missing.

2

No command option has been specified.

3

More than one command has been specified.

4

Specified a file option but --command-read and --command-write do not need it.

5

More than one file argument are not allowed.

6

The protocol type specified with --protocol is unknown.

11

Probe operation failed.

12

Wipe operation failed.

13

Read operation failed.

14

Write operation failed.

15

Execute operation failed.

AUTHOR

Originally written by Nicola Fontana (ntd@entidi.it) on Oct 09 2011.

SEE ALSO

lpc21isp(1).