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

Monitor the serial output

nanoflash monitor shows what the application of a board writes to its serial port and sends what you type.

$ nanoflash monitor --board hardware/nano33ble/manifest.toml
monitoring /dev/ttyACM0 at 115200 baud; Ctrl-C quits
connected to /dev/ttyACM0
boot

Choose the port and the speed

  • The port is --port, else the only one that suits the board (--board gives its USB identities), else the only USB serial port.
  • The port opens at 115200 baud. --baud-rate changes it.
  • In a Cargo package with [package.metadata.nanoflash], the board of the package is used without --board. Without a board, the monitor still works.

The notes go to standard error, and the output of the board goes to standard output, byte for byte. You can redirect the output to a file.

Type to the board

  • Line mode (default): each line of standard input goes to the board with \n at its end. When standard input ends, the monitor goes on showing the output.
  • Raw mode (--raw): standard input must be a terminal. Each key goes to the board as the terminal encodes it, without waiting for the end of the line. The terminal goes back to its state when the command ends.

Ctrl-C quits in both modes, and the exit code is 0.

Restart the board first

--reset first resets the board into its application through its bootloader, so that you see the output from the start. It needs the protocol of the board: pass --board, or use a port with a known USB identity.

When the board restarts

When the board leaves (a reset, or a sketch that restarts its USB device), the monitor waits up to 30 s for the same device and opens it again. If the device does not come back, the exit code is 2. Exit code 1 is an input error, such as --raw without a terminal.

Get JSON lines

--json prints one JSON object per line of output, each with its time (RFC 3339, UTC), and the events connected, disconnected and error. A failure is the last line.

$ nanoflash monitor --port /dev/ttyACM0 --json
{"timestamp":"2026-11-24T09:30:01.250Z","event":"connected","port":"/dev/ttyACM0"}
{"timestamp":"2026-11-24T09:30:01.412Z","line":"boot"}
{"timestamp":"2026-11-24T09:30:09.870Z","event":"disconnected"}

Command line lists every record.