Skip to content

Reference Utilities

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

Reference: util · serial · mfg917

Utility commands, serial-interface operations, and SiWx91x manufacturing. All methods return a dict. See Command-Reference for shared conventions.


commander.utilUtilCommand

General-purpose utilities for application/ELF inspection and key/certificate handling.

appinfo(filename, **kwargs)

Show all available information about an application file.

elfinfo(filename, **kwargs)

Show information about a file's ELF sections.

extractkeys(filename, dir, **kwargs)

Extract cryptographic keys from a JSON config filename into directory dir.

gencert(outfile, cert_version, cert_type, cert_pubkey, sign_keyfile=None, extsign=False, **kwargs)

Create a delegate certificate.

  • cert_version — running version number used for rollback prevention (a device will not accept a lower cert than it has seen).
  • cert_type — e.g. gbl, secureboot.
  • cert_pubkey — public key to embed.
  • sign_keyfile — private key to sign with; extsign=True produces an unsigned cert to sign later via signcert.

genkey(type, pubkey=None, privkey=None, outfile=None, tokenfile=None, **kwargs)

Generate a key.

  • type="ecc-p256" → a signing key pair (requires pubkey and privkey); optional tokenfile writes the public key as a token.
  • type="aes-ccm" → an encrypt/decrypt key (requires outfile).

genkeyconfig(outfile, **kwargs)

Generate a key configuration for SiWx91x devices.

keytotoken(keyfile, outfile=None, key_type=None, **kwargs)

Convert a PEM public key to a token file for flashing. (Replaces the deprecated ebl keyconvert / gbl3 keyconvert.)

rpsinfo(filename, **kwargs)

Show information about an RPS application/key file.

signcert(filename, signature, cert_type, outfile, verify_keyfile=None, **kwargs)

Sign a delegate certificate using an external signature.

usage(filename, map_filename=None, include_sections=[], exclude_sections=[], **kwargs)

Show flash/RAM usage of an ELF application. map_filename provides the device memory layout; include_sections/exclude_sections scope the statistics.

verifysign(filename, verify_keyfile, **kwargs)

Verify a file's signature using the public key in verify_keyfile.


commander.serialSerialCommand

Operations over a serial connection. All accept serialport to select the port.

getopn(serialport="", **kwargs)

Get the OPN (Ordering Part Number) via serial.

load(filename, fixedspeed=False, serialport="", **kwargs)

Load an image via serial. fixedspeed=True uses a fixed speed.

lock(token_file="", key_file="", userdata="", serialport="", **kwargs)

Lock the device via serial, optionally supplying a token file, key file, and user data.

unlock(token_file="", key_file="", userdata="", serialport="", **kwargs)

Unlock the device via serial (same parameters as lock).


commander.mfg917Mfg917Command

Provision and calibrate manufacturing data on SiWx91x devices. Every method shares a common set of interface parameters:

Parameter Meaning
serialport Serial port
baudrate Baud rate
serialinterface Use the serial interface
closeinterface Close the interface afterward
host Host address
skipinit Skip initialization
pinset Pin set

Calibration methods commonly add storeinflash / storeinefuse (where the result is stored), prompt (set False for --noprompt), and internalant / vmcu18 flags.

setupinterface(...)

Set up the serial/network interface for subsequent mfg917 operations.

info(...)

Show device information.

init(..., mbr=None, data=None)

Initialize the device using MBR/data files.

provision(..., mbr=None, keys=None, data=None, profile=None, listprofiles=False)

Provision the device (MBR, keys, data, named profile). listprofiles=True lists available profiles.

provisionotpkeys(..., symmetrickey=None, publickey=None, prompt=True)

Provision OTP keys (symmetric and/or public key).

protectconfig(protection, ..., symmetrickey=None, privatekey=None, protectlength=None, sha=None, prompt=True)

Protect configuration with a key and SHA, at the given protection level/length.

read(region, ..., list_regions=False, range=None, position=None, outfile=None, property_field=None)

Read a region (or list_regions=True to enumerate). Optionally constrain by range/position, write to outfile, or select a single property_field.

write(region, ..., list_regions=False, address=None, position=None, data=None, crc=True, prompt=True)

Write to a region from data. crc=False--nocrc.

erase(region, ..., list_regions=False, range=None, position=None)

Erase a region (or list regions). Optionally scope by range/position.

dump(filename, ...)

Dump device data to filename.

fwupgrade(filename, ...)

Upgrade the device firmware from filename.

dpdtraining(..., storeinflash=False, storeinefuse=False, prompt=True, vmcu18=False)

Run DPD (Digital Pre-Distortion) training.

evmoffset(..., storeinflash=False, storeinefuse=False, prompt=True, internalant=False, off0=None, off1=None, off2=None, off3=None, off4=None)

EVM offset calibration. off0off4 set per-antenna offsets.

gain(..., storeinflash=False, storeinefuse=False, prompt=True, ch1=None, ch6=None, ch11=None, ch14=None, vmcu18=False)

Gain calibration, per channel (ch1, ch6, ch11, ch14).

xocal(..., storeinflash=False, storeinefuse=False, offset_khz=None, ctuneoverride=None, prompt=True, internalant=False)

XO (crystal) calibration. offset_khz sets the frequency offset; ctuneoverride overrides CTUNE.

radio(..., channel=None, power=None, phy=None, burst=True, start=False, stop=False, internalant=False, vmcu18=False)

Radio test/calibration. Configure channel, power, and phy; start/stop control transmission; burst=False--noburst.

Clone this wiki locally