Command-Line Programmer

The command line programmer application provides the ability to update the firmware/software in a microcontroller device. The command line programmer application is part of the Developer Tools download.

The command line programmer provides the same functionality as the GUI Programmer application, but is accessible through a command-line interface. The command line version is helpful to create custom applications or scripts.

The output below illustrates each of the switch options that are available for the command line programmer.

install-directory>DZX.Programmer.Console /help Device Selection /device A number of a target device as listed by an attached command /usb An ID to select a target USB device. Format :: /ftdi A serial number of a target FTDI device. /com A number of a target com port Commands /attached Print a list of the attached devices /detach Command the device to perform a detach and switch modes /download:<file> Specifies a file to be downloaded to the device /upload:<file> Specifies a file to be uploaded from the device /length:<number> When uploading, specifies the number of bytes to be uploaded Command Options /verify Specifies to verify the memory after downloading /target Specifies a specific target device type (ISP devices only) /no-detach Specifies to not detach after downloading or uploading /no-isp-signals Specifies to not use DTR and RTS as Reset and ISP Enable signals Connection Options /baud Specifies the baud rate, in bits per second, when using a serial connection Data File Options /source:<file> Specifies a source file when creating a data file /output:<file> Specifies the output file when creating a data file /encrypt:<tag> Specifies to encrypt the file using AES-128, AES-192, or AES-256 /decrypt:<tag> Specifies to decrypt the file using AES-128, AES-192, or AES-256 /passphrase:<text> A passphrase used to generate a key for encryption/decryption purposes /key:<text> Manually specify a key for encryption/decryption purposes /iv:<text> Manually specify an initialization vector for encryption/decryption purposes All file formats are determined based upon the extension for the file name. .bin Binary file .hex Intex extended hex file .srec Motorola s-record file

Attached Devices

All of the currently attached devices can be printed using the /attached switch.

install-directory>DZX.Programmer.Console /attached DZX DESIGNS - PROGRAMMER VERSION 0.0.0 BUILD 0 2 ATTACHED DEVICE(S) NUMBER TYPE ID DESCRIPTION 001 ISP Device A101KHHK FTDI FT232R USB UART 002 ISP Device COM4 Standard Serial Port

A device can be selected from this list, by its number, using the /device switch. For example, the snippet below would select the first attached device. The devices will always appear in order of USB, then FTDI and then standard serial port.

install-directory>DZX.Programmer.Console /device:1

Selecting a USB Device

A USB device can be selected based upon its USB Vendor ID, Product ID and optionally serial number using the /usb switch. The argument for the switch must be formatted with a colon separator in the form of <VendorID>:<ProductID> or <VendorID><ProductID>:<SerialNumber>. The ID numbers must be in hexadecimal format.

For example, the snippet below would select a USB device with Vendor ID = 0 and Product ID of 0x10 (16 decimal).

install-directory>DZX.Programmer.Console /usb:0000:0010

Selecting an FTDI Device

An FTDI device can be selected based upon its serial number. Its serial number is displayed under the 'ID' column when viewing the list of attached devices. The snippet below selects an FTDI device by its serial number.

install-directory>DZX.Programmer.Console /ftdi:A101KHHK

Selecting a Serial Port Device

A standard serial port (com) device can be selected by its port number. The snippet below selects COM port 4.

install-directory>DZX.Programmer.Console /com:4

For serial devices, whether using the standard COM port driver or the FTDI driver, the baud rate can be configured by using the /baud switch. The snippet below shows setting the baud rate to 57600.

install-directory>DZX.Programmer.Console /baud:57600

Switching Modes (DFU Detach)

For USB DFU devices, the /detach switch can be used by itself (without downloading) to switch the device between bootloader and runtime modes. Optionally, use the /no-detach switch in conjunction while downloading to inhibit the device from being requested to runtime mode after downloading.

Download a Data File

A data file can be selected for downloading to the device using the /download switch. The argument to the switch is the path to the file to be downloaded. The application will accept binary (.bin), Intel hex (.hex), and Motorola S-Record (.srec) format files. Optionally, use the /verify switch to have each block of data read back and verified after being programmed.

For example, the snippet below selects the Image.hex file.

install-directory>DZX.Programmer.Console /device:1 /verify /download:C:\DZX\Files\Image.hex DZX DESIGNS - PROGRAMMER VERSION 0.0.0 BUILD 0 Found device, connecting... Connected To: [0000:0010] DZX LPC1788 BOOTLOADER Downloading file Image.hex... Downloading... 0.0% Complete Downloading... 27.0% Complete Downloading... 54.0% Complete Downloading... 81.0% Complete Downloading... 100.0% Complete Verifying... 0.0% Complete Verifying... 27.0% Complete Verifying... 54.0% Complete Verifying... 81.0% Complete Verifying... 100.0% Complete Device in bootloader mode Requesting detach... Device in runtime mode COMPLETED [0.927 sec]