ElCap Documentation
Loading...
Searching...
No Matches
Flash

Overview


The elcap flash command is used to program firmware onto supported MCUs. You can flash:

  • Hex files generated by your current project
  • Custom hex files from any location
  • Pre-compiled example firmware included with the Trident IoT SDK

The command supports several options for controlling behavior, which are explained in this document. You can also run:

elcap flash --help

to view usage help at any time.

Command Usage


elcap flash

Flash firmware to a connected device.

Options

--option description default
--target Chip target (e.g. T32CM11C or T32CZ20B) None or chip from project directory
--file Specific hex file to flash None
--example Flash a pre-compiled example from the SDK (cannot use with –file) False
--usb USB serial no. of connected programmer/dev kit None
--ip IP address of connected programmer/dev kit None
--alias Alias for the JLink device (cannot be used with –usb or –ip) None
--interface Programming interface SWD
--speed Programming speed 4000
--help Print help for this sub-command None

Flashing Inside a Project


The simplest way to flash a device from within a Trident project directory is with:

elcap flash

This command will:

  1. Read the target chip from your trident.toml file
  2. Look in your project's build directory for the appropriate target build folder (e.g., T32CM11C.Debug, T32CM11C.Release)
    • NOTE: build directory is prioritized in the order of Debug, Release, then anything else that matches the specified chip target.
  3. Find the hex file specified in your project's default_hex setting, or prompt you to select one if multiple hex files exist
  4. Flash the hex file to the connected device

If you have not built your project yet, you will get an error. Run elcap build first to generate the hex files.

Flashing a Specific Device

When more than one programmer or device is connected, specify which to use:

elcap flash --usb <serial_number>

Or for a network-connected device:

elcap flash --ip <ip_address>

Or using a device alias:

elcap flash --alias <device_alias>

Flashing a Specific File

Even when inside a project, you can flash a specific hex file:

elcap flash --file path/to/custom_firmware.hex

Default Hex File Behavior

The default_hex field in your trident.toml determines which file is used when running plain elcap flash.

The value is matched by substring, not exact filename, so if the value appears anywhere inside a hex filename, it qualifies. If multiple files match, you will be prompted to choose one.

Example trident.toml file:

[project]
name = "zwave_example"
category = "z-wave"
target = "T32CZ20B"
template = "z-wave/sensor_pir"
default_hex = "dkncz20_usb_t32cz20_signed_combined.hex"
[sdk]
version = "v2025.10.00-ga"

The project described by the trident.toml file above produces zwave_example_dkncz20_usb_t32cz20_signed_combined.hex when it is built, but due to the string matching used by default_hex, specifying dkncz20_usb_t32cz20_signed_combined.hex is sufficient to locate the file.

Recommendation: use the entire hex file name for default_hex if you plan to change it.

Flashing Outside a Project


When run outside a Trident IoT project directory, the tool cannot infer configuration, so you must specify at least a file:

elcap flash --file path/to/firmware.hex

Example:

elcap flash --file zwave_example_dkncz20_usb_t32cz20_signed_combined.hex

Flashing Pre-compiled Examples


The --example option allows you to flash pre-compiled example projects from the Trident IoT SDK without needing to build them yourself:

elcap flash --example

This is useful for:

  • Testing hardware
  • Evaluating known-working firmware
  • Trying out SDK applications

Advanced Options


Programming Interface

By default, the SWD interface is used. You can specify a different interface:

elcap flash --interface JTAG

Programming Speed

Adjust the programming speed (default is 4000 kHz):

elcap flash --speed 1000