Skip to content

Reference Device Flash Memory

Espen Hovland edited this page Jun 5, 2026 · 1 revision

Reference: device · flash · verify · readmem · extflash

Command suites for the target device, flashing, verification, and memory access. All methods return a dict. See Command-Reference for shared conventions (ranges, patches, tokens, **kwargs).


commander.deviceDeviceCommand

Commands that affect the target device.

info(**kwargs)

Show information about the connected target device (MCU/radio/SoC).

lock(**kwargs) / unlock(**kwargs)

Lock / unlock debug access.

masserase(**kwargs)

Mass-erase the device, clearing the main flash.

pageerase(ranges=[], regions=[], **kwargs)

Erase selected flash pages. ranges are extended to page boundaries; regions are @region names.

protect(read=False, write=False, disable=False, ranges=[], regions=[], **kwargs)

Enable or disable read/write protection. Set read/write to choose the protection; disable=True disables (otherwise enable is implied). Scope with ranges/regions.

recover(**kwargs)

Recover a bricked device.

reset(**kwargs)

Reset the target device.

zwave_qrcode(timeout_ms=0)

Get the QR code from a Z-Wave application. timeout_ms is how long to wait for QR-code initialization (default 5000).

Higher-level equivalents on Target-Class: info, reset, masserase, pageerase, enable/disableWriteProtection, enable/disableReadProtection.


commander.flashFlashCommand

flash(filenames=[], address=None, halt=False, masserase=False, reset=True, close=True, verify=True, patches=[], tokens=[], tokenfiles=[], tokengroup=None, tokendefs=None, binary=False, include_sections=[], exclude_sections=[], vtor=None, **kwargs)

Write one or more files to the target flash.

Parameter Meaning
filenames File(s) to flash
address Address to flash to (not for hex/s37)
halt Leave target halted afterward (PC/SP from vector table)
masserase Mass-erase the main flash first
reset Reset after flashing (False--noreset)
close Close code regions afterward, on applicable devices (False--noclose)
verify Verify written contents (False--noverify)
patches (address, data[, length]) memory patches
tokens (TOKEN_NAME, value) overrides
tokenfiles Files describing tokens to write
tokengroup Token set: common, zigbee, or znet
tokendefs Path to a JSON token-definition file
binary Treat all files as flat binaries (no GBL/s37/hex parsing)
include_sections / exclude_sections ELF sections to include/exclude
vtor Vector table address (with halt or RAM code)

Target-Class wraps this with flashApplication, flashRamCode, and flashPatches.


commander.verifyVerifyCommand

verify(filenames=None, address=None, patches=[], tokens=[], tokenfiles=[], tokengroup=None, tokendefs=None, blank=False, reset=True, regions=[], binary=False, **kwargs)

Compare device flash with the given files/options.

  • filenames — file(s) to compare against (omit and set blank=True to check for blank).
  • address — for .bin comparison (not hex/s37).
  • patches, tokens, tokenfiles, tokengroup, tokendefs — as in flash.
  • blank=True — verify that main flash (or regions) is blank, with no file.
  • reset=False--noreset.
  • binary=True — treat all files as flat binaries.

commander.readmemReadmemCommand

readmem(outfile=None, ranges=[], regions=[], **kwargs)

Read from target memory. outfile extension (.bin/.hex/.s37) chooses the format; without it, data is printed. Scope the read with ranges and/or regions (@region).


commander.extflashExtflashCommand

Interact with an external SPI flash.

erase(ranges=[], board_id=None, verify=True, **kwargs)

Erase external flash. ranges use start:end or start:+length. board_id selects a Series-2 board ID when the default flashloader doesn't work. verify=False--noverify.

read(outfile=None, ranges=[], board_id=None, **kwargs)

Read from external flash. outfile (bin/hex/s37 by extension); without it, data is printed.

write(filename, address=None, board_id=None, verify=True, **kwargs)

Write a file to external flash. address is required for binary input (not for hex/s37). verify=False--noverify.

Clone this wiki locally