Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Command line

The pages in this part cover the command-line tool, one group of commands to a page. Each section gives what to type, what it prints, and what it refuses. This page covers finding a device and naming one.

Listing devices

Connect a board in its boot or recovery mode, then list the detected devices:

pyrographer list
2207:350e  loader        bus 003 address 12  (bcdUSB 0201)

list --blocks also lists the machine’s own disks, which Block devices covers.

list needs no permission to open a device, because it reads everything it prints from descriptors the operating system has already cached. Discovery scans by vendor ID, so it finds any Rockchip SoC in device mode, including a part pyrographer has no entry for.

The mode column is a claim, read from the low bit of bcdUSB. An odd flag means a loader, and pyrographer trusts it. An even flag means either the BootROM or a loader that does not set the flag. The RK3576 SPL loader and the RK3588 usbplug loader both leave it even.

The device-bound commands settle an even flag by asking. They open the board and send one probe command, which a running loader answers. A BootROM presents the same bulk endpoints with nothing serving them, so it fails the probe. The command then refuses, names the mode as maskrom, and points to db.

A board that answers the probe is running a loader, even when pyrographer refuses the answer. The command then reports that refusal, and not maskrom, because an upload would not fix it.

Choosing between boards

If one board is connected, every device-bound command acts on it without being told which. If more than one is connected, name the board with --device and the bus and address that list prints:

pyrographer list
2207:350e  loader        bus 003 address 12  (bcdUSB 0201)
2207:350e  loader        bus 003 address 14  (bcdUSB 0201)
pyrographer info --device 003:14

The bus and address distinguish two identical boards, which share a product ID.

--device also names a block device by its node, as in --device /dev/sdb. The leading slash distinguishes the two forms. pyrographer never chooses a block device by default, so --device is the only way to select one.