Skip to content

Reference Tokens NVM3 LittleFS

Espen Hovland edited this page Jun 5, 2026 · 2 revisions

Reference: tokens · nvm3 · littlefs

Command suites for manufacturing tokens, NVM3 storage, and the LittleFS filesystem. All methods return a dict. See Command-Reference for shared conventions.

Common token parameters:

  • tokengroup — a built-in token set: common, zigbee, or znet.
  • tokendefs — path to a JSON file defining a token set (alternative to tokengroup).
  • tokens(TOKEN_NAME, value) pairs.
  • securerange / range(start, end) tuples.

commander.tokensTokensCommand

Handling of manufacturing tokens.

createheader(filename, tokengroup=None, tokendefs=None, **kwargs)

Create a token header file at filename.

erase(securerange=None, type=None, tokens=[], tokengroup=None, tokendefs=None, **kwargs)

Erase tokens (on device or in a secure range). type: secure or device (static tokens only). tokens is a list of token names.

read(filenames=None, outfile=None, showoverrides=False, tokens=[], securerange=None, tokengroup=None, tokendefs=None, range=None, type=None, includeall=False, address=None, **kwargs)

Read tokens from the device or from file(s).

  • filenames — read from these files instead of the device.
  • outfile — write output here (otherwise stdout).
  • showoverrides — show NVM3 overrides (static tokens only).
  • tokens — limit output to these token names.
  • range — NVM3 area range; securerange — static secure-token range.
  • typesecure or device; includeall — show all tokens in the group (static only).
  • address — memory address.

write(tokenfiles=[], tokens=[], tokengroup=None, tokendefs=None, securerange=None, **kwargs)

Write tokens to the device. tokens values are hex strings.

Target.writeManufacturingTokens() / writeStaticTokens() wrap tokens write for Series 1/2 and Series 3 respectively.


commander.nvm3Nvm3Command

NVM3 (non-volatile memory) storage. Object keys are integers; helper methods format objects/counters as 0xKKKKK:value.

delete(filename, outfile, object_keys=None, delete_all=False, address=None, range=None, **kwargs)

Delete NVM3 objects from a file; write the result to outfile. object_keys are keys to delete; delete_all=True deletes everything.

deletedevice(object_keys=None, delete_all=False, range=None, **kwargs)

Delete NVM3 objects on the device.

dump(outfile, range=None, **kwargs)

Dump NVM3 contents to outfile.

initfile(outfile, size_bytes, device, address=None, range=None, **kwargs)

Create an initialized NVM3 file of size_bytes for device.

parse(filename, object_keys=None, nvm3file=None, address=None, range=None, **kwargs)

Parse an NVM3 file and optionally export objects to nvm3file.

readdevice(object_keys=None, nvm3file=None, range=None, **kwargs)

Read NVM3 objects from the device (optionally to nvm3file).

set(filename, outfile, address=None, range=None, objects=None, counters=None, nvm3file=None, **kwargs)

Set NVM3 objects/counters in a file; write to outfile.

  • objects: list[tuple[int, bytes]](key, data) entries.
  • counters: list[tuple[int, int]](key, value) entries.

writedevice(range=None, objects=None, counters=None, nvm3file=None, **kwargs)

Write NVM3 objects/counters to the device.


commander.littlefsLittlefsCommand

Interact with a LittleFS filesystem. Filesystem location is given by address, range, or infile (a binary containing the filesystem).

add(outfile, file_paths=[], dir_paths=[], address=None, range=None, infile=None, **kwargs)

Add file(s)/dir(s) to a filesystem and write it to outfile.

dump(outfile, address=None, range=None, infile=None, **kwargs)

Dump the filesystem to outfile.

extract(dest_dir=None, zip_dir=None, file_paths=[], dir_paths=[], address=None, range=None, infile=None, **kwargs)

Extract file(s)/dir(s) to dest_dir, or into a zip at zip_dir.

info(address=None, range=None, infile=None, **kwargs)

Show filesystem info.

init(outfile, device, size=None, address=None, range=None, **kwargs)

Initialize a new filesystem for device and write it to outfile. size is in bytes. (Note: the Commander's configured target_device is intentionally not applied here — device is passed explicitly.)

list_files(address=None, range=None, infile=None, **kwargs)

List files in the filesystem. (Maps to the CLI littlefs list command.)

remove(file_paths=[], dir_paths=[], address=None, range=None, infile=None, **kwargs)

Remove file(s)/dir(s) from the filesystem.

Clone this wiki locally