program - Program DUT

Erase and Program DUT MCU on-board flash.

General usage:

- command: program <target> [<uart_port>] [offset:]<img>[,[offset:]<img>[,...]] [noerase]
  [id: <usb_device_id>]
  [path: <usb_device_path>]
  [interface: <usb_device_interface>]
  [retry: <retryCount>]

Argument

Description

target

Target to program.

uart_port

UART port name. Only required for UART programming targets.

offset

Optional: Image Address Offset.

img

Firmware File.

Optional: Additional offsets, images

noerase

Optional: If set, DUT will not be erased prior to programming.

usb_device_id

Optional: Programming adapter USB device identifiers: VID:PID.

usb_device_path

Optional: Programming adapter USB device path: port. ... .port.

usb_device_interface

Optional: Programming adapter USB device interface: interface_number.

retryCount

Optional: Number of times to retry the test step.

On the PLT-300A, the programming adapter can be specified using usb_device_id, usb_device_path, and usb_device_interface. Specifying the programming adapter location allows multiple adapters of the same type to be used in a single test plan, or for an external adapter to be used in place of the built-in programming adapter. See USB Interaction for details on specifying USB devices.

Firmware images can be provided as Intel HEX (.hex), ELF (.elf / .axf) or binary files (requiring an offset).

Usage with USB-DFU targets:

- command: program USB-DFU [offset:]<img>
  target: <target>
  [id: <usb_device_id>]
  [path: <usb_device_path>]
  [retry: <retryCount>]

Argument

Description

offset

Optional: Image Address Offset.

img

Firmware File.

target

Target MCU to program.

usb_device_id

Optional: USB device identifiers: VID:PID.

usb_device_path

Optional: USB device path: port. ... .port.

retryCount

Optional: Number of times to retry the test step.

If neither usb_device_id or usb_device_path is set, the device connected to DUT USB-C Port (Port 1) is assumed.

For USB-DFU, firmware images must be in .dfu format. The dfuse-pack.py script from the dfu-util project <https://sourceforge.net/p/dfu-util/> can be used to generate .dfu files from hex or binary.

Supported target values:

target

Description

ATSAMD

Microchip (Atmel) SAM D1x/D2x, C2x, L2x, R2x or R3x (SWD)

ATSAMD_DAP

Microchip (Atmel) SAM D1x/D2x, C2x, L2x, R2x or R3x (USB, DAPlink)

ATSAME5

Microchip (Atmel) SAM D5x/E5x (SWD)

ATSAME5_DAP

Microchip (Atmel) SAM D5x/E5x (USB, DAPlink)

AVRATmega168P_ISP

Microchip (Atmel) AVR ATmega168P(A) (JTAG:ISP)

AVRATmega168P_XPm

Microchip (Atmel) AVR ATmega168P(A) (USB, XPmini)

AVRATmega168PB_ISP

Microchip (Atmel) AVR ATmega168PB (JTAG:ISP)

AVRATmega168PB_XPm

Microchip (Atmel) AVR ATmega168PB (USB, XPmini)

CC1352

TI CC1352 RFSoC

EFM32

Silicon Labs EFM32 MCU (SWD)

EFR32

Silicon Labs EFR32 RFSoC (SWD)

ESP32_UART

Espressif ESP32 RFSoC (UART)

LPC11xx

NXP LPC11xx MCU (SWD)

nRF52

Nordic nRF52 RFSoC (SWD)

nRF52_JLink

Nordic nRF52 RFSoC (USB, JLink)

nRF91

Nordic nRF9160 RFSoC:Cortex-M33 (SWD)

nRF91_JLink

Nordic nRF9160 RFSoC:Cortex-M33 (USB, JLink)

PIC18F25K20

Microchip PIC18F25K20 (JTAG:ICSP)

PIC18F25K20_PK2

Microchip PIC18F25K20 (USB, PICkit2)

PN7360

NXP PN7360 (SWD)

PN7362

NXP PN7362 (SWD)

PN7460

NXP PN7460 (SWD)

PN7462

NXP PN7462 (SWD)

PSoC4

Cypress PSoC4 (SWD)

PSoC6

Cypress PSoC6 (SWD)

PSoC6_KP3

Cypress PSoC6 (USB, KitProg3)

STM32F1

ST STM32F1xx MCU (SWD)

STM32F1_STLink

ST STM32F1xx MCU (USB, ST-Link)

STM32F2

ST STM32F2xx MCU (SWD)

STM32F2_STLink

ST STM32F2xx MCU (USB, ST-Link)

STM32F4

ST STM32F4xx MCU (SWD)

STM32F4_STLink

ST STM32F4xx MCU (USB, ST-Link)

STM32L4

ST STM32L4xx MCU (SWD)

STM32L4_STLink

ST STM32L4xx MCU (USB, ST-Link)

STM32L5

ST STM32L5xx MCU (SWD)

STM32L5_STLink

ST STM32L5xx MCU (USB, ST-Link)

STM32H7

ST STM32H7xx MCU (SWD)

STM32H7_STLink

ST STM32H7xx MCU (USB, ST-Link)

USB-DFU

USB Device Firmware Upgrade (DFU 1.0, 1.1) (USB)

Examples