The elcap tokens subcommands provide functionality for reading, writing, and erasing flash tokens on Trident MCUs. 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.
TIP: elcap will make assumptions when commands are being run inside of a Trident IoT project directory that reduce the number of required options for commands. For example, running command
outside of a project directory will throw an error because it does not know which chip target to list the MFG tokens for. If you run the same command inside of a project directory, it will get the chip target being used within that project and list the corresponding MFG tokens for it.
There are 2 types of tokens that can be interacted with, MFG and APP tokens. For a more detailed description of token use cases, please see the Trident IoT SDK Documentation page.
MFG tokens are manufacturing tokens that are supported by Trident IoT devices. These are used for setting things such as XTAL calibration information or for storing information that is used by an application in a place that does not require it to be built into the application itself.
APP tokens are custom tokens that can be created by the application developer for doing things like storing device specific calibration data or storing data in persistent memory. Defining APP tokens is done using the Trident framework from within a project. Review the Trident IoT SDK Documentation for more details.
Lists the available tokens for the passed in type. Defaults to MFG.
--option | description | default |
---|---|---|
--type | Specifies the type of token to use - 'APP' or 'MFG' | MFG |
--target | Chip target - 'T32CM11C' or 'T32CZ20B' | None or chip from project directory |
--def | JSON token definition file (only required for APP type) | None |
--help | Print help for this sub-command | None |
NOTE: The json token definition for APP tokens is generated as part of the project build if the project supports APP tokens. This file will be in the build directory and look something like: T32CM11C_app_token_def.json
Outside of a project directory:
Inside of a project directory:
Outside of a project directory:
Inside of a project directory:
Read contents of flash tokens on a device.
--option | description | default |
---|---|---|
--type | Specifies the type of token to use - 'APP' or 'MFG' | MFG |
--target | Chip target - 'T32CM11C' or 'T32CZ20B' | None or chip from project directory |
--def | JSON token definition file (only required for APP type) | None |
--name | Name of the single token to read, leave off to read all | None |
--usb | USB serial no. of conneected programmer/dev kit | None |
--ip | IP address of conneected programmer/dev kit | None |
--json | Return result of token read in json format | No json response |
--help | Print help for this sub-command | None |
Outside of a project directory:
Inside of a project directory:
Outside of a project directory:
Inside of a project directory:
Outside of a project directory:
Inside of a project directory:
Outside of a project directory:
Inside of a project directory:
Write contents of flash tokens on a device.
--option | description | default |
---|---|---|
--type | Specifies the type of token to use - 'APP' or 'MFG' | MFG |
--target | Chip target - 'T32CM11C' or 'T32CZ20B' | None or chip from project directory |
--def | JSON token definition file (only required for APP type) | None |
--name | Name of the single token to write | None |
--value | Value to write when using --name option | None |
--file | Token data JSON file to use when writing multiple tokens | None |
--usb | USB serial no. of conneected programmer/dev kit | None |
--ip | IP address of conneected programmer/dev kit | None |
--help | Print help for this sub-command | None |
Outside of a project directory:
Inside of a project directory:
Outside of a project directory:
Inside of a project directory:
Outside of a project directory:
Inside of a project directory:
Example contents of mfg_token_data.json:
Outside of a project directory:
Inside of a project directory:
Example contents of app_token_data.json:
NOTE: APP tokens must be defined in a Trident project before interacting with them via elcap.
--option | description | default |
---|---|---|
--type | Specifies the type of token to use - 'APP' or 'MFG' | MFG |
--target | Chip target - 'T32CM11C' or 'T32CZ20B' | None or chip from project directory |
--def | JSON token definition file (only required for APP type) | None |
--name | Name of the single token to erase, leave off to read all | None |
--usb | USB serial no. of conneected programmer/dev kit | None |
--ip | IP address of conneected programmer/dev kit | None |
--confirm | Auto-confirm erasing all tokens, only for mass erase | No auto-confirm |
--help | Print help for this sub-command | None |
Outside of a project directory:
Inside of a project directory:
NOTE: use –confirm option to erase all tokens without additional user input.
Outside of a project directory:
Inside of a project directory:
NOTE: use –confirm option to erase all tokens without additional user input.
Outside of a project directory:
Inside of a project directory:
Outside of a project directory:
Inside of a project directory:
The tokens patch command is intended for patching tokens into hex files so when you program a device the token information will be there automatically. This command is still in development and is not currently supported.