The elcap device subcommands provide functionality for interacting with physical devices in a variety of ways. This ranges from discovering what devices can be seen by your computer to locking down the flash on an MCU so it cannot be read out. Each of these commands have command line –options for executing the commands. These options are situationally required so they are not all needed for every command use case. This document will go over when each of the options for each command is required and how to use them. This information can also be gotten from running elcap with the --help option.
Shows all connected programmers/devices over USB and IP.
Read device information including the EUI64 (Extended Unique Identifier) from the connected device.
| --option | description | default |
|---|---|---|
| --usb | USB serial number of the JLink device | None |
| --ip | IP address of the JLink device | None |
| --alias | Alias for the JLink device | None |
| --target | Chip target - 'T32CM11C' or 'T32CZ20B' | None or chip from project directory |
| --interface | Programming interface | SWD |
| --speed | Programming speed | Detected from device or 4000 |
| --help | Print help for this sub-command | None |
NOTE: The --usb, --ip, and --alias options are mutually exclusive - only use one at a time to identify the device.
Erase internal flash on a device. By default, this preserves the token space and only erases the application flash. Use the --all option to erase the entire flash including tokens.
| --option | description | default |
|---|---|---|
| --usb | USB serial number of the JLink device | None |
| --ip | IP address of the JLink device | None |
| --alias | Alias for the JLink device | None |
| --target | Chip target - 'T32CM11C' or 'T32CZ20B' | None or chip from project directory |
| --interface | Programming interface | SWD |
| --speed | Programming speed | Detected from device or 4000 |
| --all | Erase entire flash (application and token space) | False |
| --help | Print help for this sub-command | None |
NOTE: The --usb, --ip, and --alias options are mutually exclusive - only use one at a time to identify the device.
If no device identifier is provided, elcap will prompt you to select from available devices.
Using USB serial number:
Using IP address:
Using alias:
Erase a specified address range of flash memory. This allows for granular control over which sectors of flash are erased without affecting the entire chip.
| argument | description | required |
|---|---|---|
| start_addr | Flash start address | Yes |
| stop_addr | Flash stop address | Yes |
| --option | description | default |
|---|---|---|
| --usb | USB serial number of the JLink device | None |
| --ip | IP address of the JLink device | None |
| --alias | Alias for the JLink device | None |
| --target | Chip target - 'T32CM11C' or 'T32CZ20B' | None or chip from project directory |
| --interface | Programming interface | SWD |
| --speed | Programming speed | Detected from device or 4000 |
| --help | Print help for this sub-command | None |
NOTE: The --usb, --ip, and --alias options are mutually exclusive - only use one at a time to identify the device.
If no device identifier is provided, elcap will prompt you to select from available devices.
Using USB serial number:
Using IP address:
Using alias:
Enable flash readout protection on the target MCU to prevent unauthorized access to firmware. Device lock exists to protect the MCU's flash from being read out. Different chips have different requirements to enable this feature which means not all command line --options are required for every chip.
| --option | description | default |
|---|---|---|
| --usb | USB serial number of the JLink device | None |
| --ip | IP address of the JLink device | None |
| --alias | Alias for the JLink device | None |
| --target | Chip target - 'T32CM11C' or 'T32CZ20B' | None or chip from project directory |
| --interface | Programming interface | SWD |
| --speed | Programming speed | Detected from device or 4000 |
| --port | Serial port (e.g., /dev/ttyUSB0, COM3) | None |
| --confirm | Auto-confirm device lock without interactive prompt | You will be prompted to confirm. |
| --help | Print help for this sub-command | None |
NOTE: The --usb, --ip, and --alias options are mutually exclusive - only use one at a time to identify the device.
WARNING: It is not possible to unlock this chip! Proceed with caution...
The T32CM11C uses permanent flash readout protection. Once locked, the device cannot be unlocked using elcap commands. See SDK Documentation for unlock options.
Auto-confirm without interactive prompt:
Lock specific device:
The elcap device lock command on the T32CZ20 disables SWDIO on GPIO13 and SWCLK on GPIO14 preventing reading and writing to flash via those debug lines.
In addition to the device interface options, you must provide paths to either the public or private key files matching your Z-Wave project.
| --option | Description |
|---|---|
| –root-private-key-path | Path to an ECDSA p-256 private key .der/.pem file. |
| –root-private-key-password | Optional password to the root private key file. |
| –root-public-key-path | Path to an ECDSA p-256 public key .der/.pem file. |
| –adac-private-key-path | Path to an ECDSA p-256 private key .der/.pem file. |
| –adac-private-key-password | Optional password to the ADAC private key file. |
| –adac-public-key-path | Path to an ECDSA p-256 public key .der/.pem file. |
Using public keys
Using private keys
Add --confirm to not be prompted for confirmation...
Note: The ADAC private/public key files are not currently generated by our build system like the Root and other signing keys are. It's possible to steal the private root key from an example project to use as your ADAC key if you don't want to bother running OpenSSL directly.
The Root and ADAC private and public keys can be generated using openssl:
The Root and ADAC public key files can be generated from the private keys in either PEM or DER format:
Device unlock is intended to disable the flash readout protection that is enabled using the elcap device lock command. Again, different chips have different interfaces so not all --options are required for all chips.
Unlocking is not supported for this chip. See SDK Documentation for unlock options.
The elcap device unlock command for the T32CZ20 temporarily enables SWDIO on GPIO13 and SWCLK on GPIO14 allowing reading, writing, and erasing flash and full debugger functionality. The command interfaces with the T32CZ20's BootROM over a UART0 (GPIO16 and GPIO17) and the J-Link's bridged serial port using an Authenticated Debug Access Control (ADAC) challenge and response protocol.
The only required option for unlocking a T32CZ20 is the ADAC public key file.
| --option | Description |
|---|---|
| –adac-private-key-path | Path to an ECDSA p-256 private key .der/.pem file. |
| –adac-private-key-password | Optional password to the ADAC private key file. |
See device lock for information about the keys.
Connect to a device via serial terminal for logging and CLI access. This command opens an interactive serial terminal session for communicating with the device's UART interface. Press Ctrl+C to exit the terminal.
| --option | description | default |
|---|---|---|
| --port, -p | Serial port (e.g., /dev/ttyUSB0, COM3) | None |
| --baudrate, -b | Baud rate (common values: 115200, 230400) | 115200 |
| --databits, -d | Data bits (5, 6, 7, 8) | 8 |
| --stopbits, -s | Stop bits (1, 1.5, 2) | 1 |
| --parity | Parity (none, odd, even, mark, space) | none |
| --flow, -f | Flow control (none, xonxoff, rtscts) | none |
| --help | Print help for this sub-command | None |
Auto-select port (prompts if multiple ports available):
Specify port:
Custom baud rate:
Full configuration:
Using short option names:
NOTE: If no port is specified, elcap will list available serial ports and prompt you to select one. If only one port is available, it will be selected automatically.
Assign or update a device alias/nickname. The alias is stored directly on the J-Link device so it will persist across different computers. This allows you to refer to devices by friendly names instead of serial numbers or IP addresses.
| --option | description | default |
|---|---|---|
| --usb | USB serial number of the JLink device | None |
| --ip | IP address of the JLink device | None |
| --alias | Existing alias to select the device | None |
| --name, -n | New alias to assign to the device | None |
| --unset | Remove alias/nickname from device (cannot be used with –name) | False |
| --help | Print help for this sub-command | None |
NOTE: The --usb, --ip, and --alias options are mutually exclusive - only use one at a time to identify the device. The --name and --unset options are also mutually exclusive.
Auto-select device and prompt for alias:
Rename specific device by USB serial:
Rename specific device by IP:
Rename using existing alias:
Using short option:
Remove alias from specific device:
NOTE: Aliases must not exceed 31 characters. If no device identifier is provided, elcap will prompt you to select from available devices.
Check for new firmware available for a certain device through ElCap's managed dependencies. If a newer version is found, the firmware will update automatically.
| --option | description | default |
|---|---|---|
| --usb | USB serial number of the JLink device | None |
| --ip | IP address of the JLink device | None |
| --alias | Existing alias to select the device | None |
| --help | Print help for this sub-command | None |
NOTE: The --usb, --ip, and --alias options are mutually exclusive - only use one at a time to identify the device.
If no device identifier is provided, elcap will prompt you to select from available devices.
Update specific device by USB serial:
Update specific device by IP:
Update using existing alias:
The elcap device recover command will attempt to recover a device where you cannot connect to the device via the debug SWDIO/SWCLK lines.
Only, the T32CZ20 is currently supported. It works by erasing the entire flash using the BootROM's serial protocol over UART0 via the J-Link's bridged serial/COM port.
| --option | Description | Default |
|---|---|---|
| --usb | USB serial number of the JLink device | None |
| --ip | IP address of the JLink device | None |
| --alias | Alias for the JLink device | None |
| --target | Chip target - 'T32CM11C' or 'T32CZ20B' | None or chip from project directory |
| --interface | Programming interface | SWD |
| --speed | Programming speed | Detected from device or 4000 |
| --help | Print help for this sub-command | None |
NOTE: The --usb, --ip, and --alias options are mutually exclusive - only use one at a time to identify the device.