Token Commands#
The tokendump command generates a text dump of token data. It can take as input either a (set of) files using the same command line options as the convert command, or a microcontroller using the same command line options as the readmem command.
The output of tokendump can either be printed to standard output or written to an output file using the --outfile option. The file written when using the --outfile option is suitable for modification and re-use as input to the flash, verify, or convert commands using the --tokenfile option.
tokendump always requires a token group to be selected with the --tokengroup option. A token group is a defined set of tokens for a specific stack or application. Simplicity Commander only supports the znet token group.
Manufacturing tokens are the only token type supported by Simplicity Commander; simulated EEPROM tokens are not supported. For more information on manufacturing tokens, see AN961: Bringing Up Custom Nodes for the EFR32MG and EFR32FG Families.
Print Tokens#
Command Line Syntax
$ commander tokendump --tokengroup <token group> [--token <token name>]Command Line Input Example
$ commander tokendump --tokengroup znet --token TOKEN_MFG_STRING --token TOKEN_MFG_EMBER_EUI_64Reads the selected tokens from the device and prints it to stdout.
Command Line Output Example
#
# The token data can be in one of three main forms: byte-array, integer, or string.
# Byte-arrays are a series of hexadecimal numbers of the required length.
# Integers are BIG endian hexadecimal numbers.
# String data is a quoted set of ASCII characters.
#
MFG_STRING : "IoT_Inc"
# MFG_EMBER_EUI_64: F0B2030000570B00
DONEDump Tokens to File#
This example works just like Print Tokens, except that the output is written to a file suitable for use with the --tokenfile option (flash, verify, and convert commands).
Command Line Syntax
$ commander tokendump --tokengroup <token group> [--token <token name>] --outfile <filename>Command Line Input Example
$ commander tokendump --tokengroup znet --outfile tokens.txtReads all tokens from the device and outputs it to the file named tokens.txt.
Command Line Output Example
Writing tokens to tokens.txt...
DONEDump Tokens from Image File#
If an input file is given to the tokendump command, the input is read from one or more files instead of reading from a device.
In this case, the --device option must be provided, because token locations can be different from one device family to another.
Command Line Syntax
$ commander tokendump <filename> --tokengroup <token group> --device <device> [--outfile <filename>]Command Line Input Example
$ commander tokendump blink.hex --tokengroup znet --device EFR32MG1P --outfile tokens.txtCommand Line Output Example
Parsing file blink.hex...
DONEGenerate C Header Files from Token Groups#
The tokenheader command generates a simple header file based on a custom token group. The generated header file contains pre-processor defines that specify the location and size of each token.
See EFR32 Custom Tokens for details on custom tokens.
Command Line Syntax
$ commander tokenheader --tokengroup <group name> --device <target device> <filename>Command Line Input Example
$ commander tokenheader --tokengroup myapp --device EFR32MG1P233F256 my_tokens.hCommand Line Output Example
Writing token header file: my_tokens.h
DONE