crosspad_console
Read and monitor the CrossPad STM32 bridge console through the crosspad-hil daemon to capture boot logs, panics, and PerfMon output, wait for expected patterns, and snapshot device diagnostics.
Instructions
[ESP HW] Read the STM32-bridge console of a CrossPad (boot log, panics, PerfMon) through the crosspad-hil daemon. open returns a con_N handle (DTR/RTS stay deasserted so opening never reboots the board; reset=true pulses reset on purpose); read {since_seq, wait_ms, match, limit} returns {lines: [[seq, line]], next_seq, lines_lost}; expect {patterns, reject, timeout_ms} returns which pattern hit first (or which reject) with 20 lines of context; reset; snapshot (parsed fatals, reboots, markers, heap, cdc_drops); close. Handles expire after 30 min idle. The full log is persisted to hil_logs/ and linked as crosspad://device/{id}/console/log, never inlined.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"action": "<action>"
},
"name": "crosspad_console"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | read: max lines inline (default 200, hard cap 2000); the full log is the resource_link | |
| match | No | read: regex; only matching lines are returned | |
| reset | No | open: pulse reset (DTR/RTS, works through the STM bridge) right after opening so the log starts at boot | |
| action | Yes | open → con_N handle; read/expect/reset/snapshot/close act on that handle | |
| device | No | Device id (dev_xxxx) or a port path; omit when exactly one CrossPad is connected | |
| handle | No | Console handle from action=open (con_<n>) | |
| log_to | No | open: explicit log file path; default hil_logs/console_<device>_<ts>.log | |
| reject | No | expect: regexes that end the wait as a failure (e.g. 'Guru Meditation') | |
| wait_ms | No | read: block up to this long for new lines | |
| patterns | No | expect: regexes; the first to appear wins | |
| since_seq | No | read: return lines with seq >= this (from a previous next_seq) | |
| timeout_ms | No | expect: default 30000 |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ts | No | ||
| hit | No | ||
| seq | No | ||
| docs | No | ||
| hint | No | ||
| next | No | ||
| port | No | ||
| tool | No | ||
| error | No | ||
| lines | No | ||
| action | No | ||
| device | No | ||
| fatals | No | ||
| handle | No | ||
| notice | No | ||
| context | No | ||
| details | No | ||
| log_uri | No | ||
| outcome | No | ||
| reboots | No | ||
| success | Yes | ||
| log_path | No | ||
| next_seq | No | ||
| rejected | No | ||
| snapshot | No | ||
| cdc_drops | No | ||
| elapsed_s | No | ||
| truncated | No | ||
| lines_lost | No | ||
| elicitation | No | ||
| confirmation | No |