Session
Open and inspect a debug session against the resolved board.
connectdisconnectget_board_infoget_stateNever hard fault again
Hard Fault is a local embedded-debug agent built on pyOCD. Bring your own model — Codex, Claude, or an OpenAI / Anthropic API key — and it flashes images, reads UART, and drives SWD on your board, behind safety guardrails.
$ brew install uv$ pip install uv$ pip install uv$ git clone https://github.com/JasonPeng2019/Firmware-CLI$ cd Firmware-CLI$ uv sync$ uv run pyocd-debugSafe enough to hand a model a debug probe.Every mutating action passes a gate, and watchers stop a runaway before it can brick a board.
Guardrails →// the loop
Every run cycles Connect → Decide → Act → Verify until the board meets its green criteria — or a guardrail stops it.
Resolve the board from its YAML — target, probe, baud, recover policy — and open an SWD session with a tracked run id.
The model plans the next action from compact run memory: structured decisions in, one governed action out.
Flash an image, run a build, write to UART, or step the core — every action routed through the brain gate.
Check UART boot text and green criteria, then persist evidence and events to the run log.
↻ the loop repeats until green criteria pass
// capabilities
Open and inspect a debug session against the resolved board.
connectdisconnectget_board_infoget_stateDrive the core exactly as you would by hand at the bench.
haltresumestepresetRead and write core registers and memory, including block reads.
read_core_registerwrite_core_registerread_memorywrite_memoryFlash validated images and capture serial output for verification.
flash_firmwareread_serialBoard-policy-aware unlock for supported recover modes.
unlock_recoverEvery operation is an MCP tool — wire the same governed actions into your own client or agent.
set_breakpointremove_breakpointread_memory_block// guardrails
A model can iterate on a fix, but it cannot silently loop on a destructive action or brick a board without an explicit, validated request.
Flashing validates its input before touching the board — a tracked baseline or a valid .elf/.hex succeeds; a missing path or bad suffix refuses.
Recovery is board-policy aware: it needs explicit confirmation where a recover_mode exists, and refuses outright where none is tracked.
Scoped watchers stop a run thrashing on a broken op — and only that op. Disconnecting and reconnecting clears the block.
// benchmark
The current turnkey corpus runs end-to-end on the scoped board pair — nRF52833-DK and Nucleo-L476RG — with the Codex backend.
// hardware
Bring-up, Stage 0 validation, and the benchmark suite are proven on these targets. New boards are added as a YAML definition plus a runbook.
nrf52833dkofficial pairnucleo_l476rgofficial pairnrf52840dkalternate profile// providers
Pick one of four backends. Your own subscription or keys — credentials are never proxied or repackaged; you authenticate the official vendor CLI yourself.
codex-cliWhatever Codex auth you configured — a ChatGPT/Codex subscription or Codex API key.
claude-cliA Claude subscription or ANTHROPIC_API_KEY. Not bundled Claude access.
openai-apiRequires an explicit model via --model or PYOCD_TURNKEY_MODEL.
anthropic-apiRequires an explicit model; stateless at the Messages API layer.