OpenBoot
Draft: this page is not reviewed yet.

OBLink bring-up and troubleshootingDraft

This page assumes OpenBoot is installed on the board as its boot object and that a host is cabled to the board's debug USB port. For the daemon itself see OBLink host daemon.

Start order#

  1. Start oblinkd on the host first.
  2. Power on or restart the board.
  3. Wait for the arrival event: python3 -m oblink ctl wait-arrival since=-1 timeout=120.

The order matters because of how the hold window decides, in the plain-USB hold mode (see Boot flow for how the mode is chosen). After the board's USB controller sees a bus reset, the host has the handshake window (4 seconds) to open the serial port, which raises DTR. The daemon opens the port as soon as the device appears. A host that opens the port later, or not at all, gets the verdict dark: the boot continues as configured, the debug core is never started, and there is no link for that boot. The daemon being up before the board starts removes the race.

The hold verdict#

The verdict is printed on the console and recorded in one line that the monitor's info command shows. The line has this shape (the values differ per boot):

hold: verdict=<dark|debug> mode=<n> hpm0_status=<hex> vdm=<0|1> usbrst=<n> reset_ms=<ms|-> hs=<0|1> gadget=<up|failed|not-started> why=<reason> ...
Field Meaning
verdict debug: a host was present and the monitor runs. dark: nothing was held.
mode The hold mode in force (see Boot flow).
usbrst Number of USB bus resets seen.
reset_ms When the first bus reset arrived, in milliseconds after the gadget came up.
hs 1 if the DTR handshake was seen.
gadget Whether the USB gadget came up.
why The reason: for example bus_reset_and_dtr, reset_no_handshake, no_bus_reset_in_window or plug_absent.

Reading the common cases:

  • why=no_bus_reset_in_window: the host never reset the bus within the connect window (1.5 s by default). Check the cable, and that the host port is a data port.
  • why=reset_no_handshake: a bus reset arrived but nobody opened the serial port in time. The daemon was not running, or another program held the port.
  • gadget=failed: the gadget did not come up on this boot.

The console line hold: oblink: bus reset but no handshake in <ms> ms, dark appears in the second case.

Reading the console#

Everything printed before the host attached is kept in the persistent log ring. When the host handshakes, the device replays that ring as text after the HELLO reply, so the hold summary and the boot log are readable even if the host arrived late. python3 -m oblink ctl replay asks for the replay again, and the monitor's log command prints the tail of the ring.

Push and sideload workflow#

A development image is loaded without removable media in four steps.

  1. Wait for the window. The monitor line sideload window reports the receive window as window=<base>+<size> ready=<0|1>; wait for ready=1.
  2. Push. python3 -m oblink ctl push-image path=<file>. The device's CRC-32 is compared with the host's; a mismatch fails the push and drops the held prefix.
  3. Check. crc32 win <length> must print the image's CRC-32. Then sideload image win <length> [full|kc] check crc=<crc> validates the layout without starting it.
  4. Hand over. sideload image win <length> [full|kc] crc=<crc> starts the new image. The link goes away and comes back when the new image's debug core is up; wait for the arrival event, then check info: the build line must be the image you pushed.

full selects the object that includes the firmware package behind the image; kc selects the kernel-collection layout. The exact sizes each layout expects are in the sideload image line of the monitor's help output.

Nothing in a pushed image runs until step 4. The held prefix survives a USB re-enumeration, because it is in DRAM, and is dropped when the board boots the image or resets.

To leave the held state, reboot restarts the board (an SMC restart first on images built with SMC_RESTART, the SoC watchdog as the fallback; reboot wdt uses the watchdog only); boot auto ends the hold and lets the stored settings decide what starts.

Health fields#

The monitor's info command prints these lines (the daemon's info operation also parses them into fields):

Line Meaning
build Build id of the running image.
chip Chip id.
debug cpu The CPU running the debug core, and its MPIDR.
main The main core's stage and the age of its last heartbeat.
hold The one-line hold record shown above.
ctx Execution context of the main core and its age.
uptime Seconds since boot.
usb Whether the gadget is configured, plus reset, restart and timeout counters.
console Console bytes dropped because the transmit queue was full.
crashes Number of crashes recorded.
serror Whether an SError is pending.

The one-line milestone summary ms is the quick health check of a run: it prints the main stage, the heartbeat age, faults, crashes, SError, whether the EL2 layer is resident, whether guest kernel vectors have been seen, how many secondary cores are on, whether the virtual keyboard is configured, the uptime, and off=1 once the guest has shut itself down. wait <milestone> holds the reply until mainloop, uefi, kernel or kbd is reached.

The daemon's status operation shows the host's view: arrival and removal counters, the last HELLO reply (state, capabilities, window, build id), and the frame, bad-CRC and text counters of the decoder.

When nothing arrives#

Symptom Check
wait-arrival times out The cable and the port. The vbus-cycle operation replugs the port when uhubctl is set up. A different host may hold the device (a browser tab with WebUSB access, for example); close it.
The device arrives, no reply to HELLO The board is not in the hold, or the image has no OBLink. The console text still appears; read it with console-tail.
The monitor does not answer The debug core is not running (verdict dark) or the image is wedged. A silent monitor is a stop for hardware runs; see Hardware runs.
The port disappears during a push Normal on a USB drop. The push resumes from the held prefix after the next arrival.

Not verified#

  • The exact wording of the log lines can differ between builds; the reasons listed are the ones in the current code.
  • The browser-tab note comes from experience on one host and has not been reproduced systematically.