The elcap flash command is used to program firmware onto supported MCUs. You can flash:
The command supports several options for controlling behavior, which are explained in this document. You can also run:
to view usage help at any time.
Flash firmware to a connected device.
| --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 |
The simplest way to flash a device from within a Trident project directory is with:
This command will:
If you have not built your project yet, you will get an error. Run elcap build first to generate the hex files.
When more than one programmer or device is connected, specify which to use:
Or for a network-connected device:
Or using a device alias:
Even when inside a project, you can flash a specific hex file:
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:
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.
When run outside a Trident IoT project directory, the tool cannot infer configuration, so you must specify at least a file:
Example:
The --example option allows you to flash pre-compiled example projects from the Trident IoT SDK without needing to build them yourself:
This is useful for:
By default, the SWD interface is used. You can specify a different interface:
Adjust the programming speed (default is 4000 kHz):