ZeroClaw’s hardware subsystem lets the agent directly control microcontrollers and SBCs by exposing each board’s capabilities as tools (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/openagen/zeroclaw/llms.txt
Use this file to discover all available pages before exploring further.
gpio_read, gpio_write, adc_read, and more). The connection between ZeroClaw and a peripheral follows a defined Peripheral trait so new boards can be added without changing the agent loop.
Two modes of operation
Edge-native (standalone)
ZeroClaw runs directly on the device (ESP32, Raspberry Pi). The runtime spins up a local gRPC/nanoRPC server and communicates with peripherals over GPIO, I2C, and SPI. No host is required. Workflow:- User sends a message: “Turn on LED on pin 13”
- ZeroClaw fetches board-specific docs from the local datasheet index (RAG pipeline)
- LLM synthesizes the action using retrieved register maps and pinout data
- GPIO is toggled; result returned to the user
- Optimized code is persisted for future identical requests
Host-mediated (development and debugging)
ZeroClaw runs on a host machine (macOS, Linux) and controls the target over USB, J-Link, or Aardvark. This is the standard path for STM32 Nucleo and other MCUs without WiFi. Workflow:- User asks: “What readable memory addresses are on this USB device?”
- ZeroClaw identifies the connected hardware via VID/PID
- Performs memory mapping and returns available address spaces
- User can then flash firmware or issue GPIO commands
| Aspect | Edge-native | Host-mediated |
|---|---|---|
| ZeroClaw runs on | Device (ESP32, RPi) | Host (Mac, Linux) |
| Hardware link | Local (GPIO, I2C, SPI) | USB, J-Link, Aardvark |
| Use case | Production, standalone | Dev, debug, introspection |
STM32 Nucleo-F401RE setup
The Nucleo-F401RE ships with a built-in ST-Link debugger over USB, so no separate debug probe is needed. ZeroClaw includes Embassy-based firmware (firmware/nucleo/) and a flash-nucleo subcommand that builds and flashes it in one step.
Prerequisites
- Nucleo-F401RE board with USB-A to Mini-USB cable
probe-rsCLI for flashing:cargo install probe-rs-tools --locked
The
probe-rs crate is a library; the CLI tools are in probe-rs-tools. Install probe-rs-tools, not probe-rs.Flashing firmware
Connect the Nucleo
Connect the board to your Mac or Linux host via USB. The ST-Link appears as a USB device; no additional driver is needed on modern systems.
Flash via ZeroClaw
From the repository root:This builds
firmware/nucleo targeting thumbv7em-none-eabihf and runs probe-rs run --chip STM32F401RETx. The firmware starts immediately after flashing.flash-nucleo is available in repo builds only, not in crates.io installs. If you installed from crates.io, build from source: cargo run --features hardware -- peripheral flash-nucleoFind the serial port
- macOS
- Linux
What’s included for Nucleo-F401RE
| Component | Location | Purpose |
|---|---|---|
| Firmware | firmware/nucleo/ | Embassy Rust — USART2 at 115200 baud, gpio_read, gpio_write |
| Serial peripheral | src/peripherals/serial.rs | JSON-over-serial protocol (shared with Arduino and ESP32) |
| Flash command | zeroclaw peripheral flash-nucleo | Builds firmware and flashes via probe-rs |
Serial protocol
Communication between ZeroClaw and the firmware uses newline-delimited JSON:Board info without flashing
ZeroClaw can read chip information over USB without any firmware on the board. From the CLI:hardware_board_info to return chip name, architecture, and memory map. With the probe feature enabled it reads live data via USB/SWD; without it, it returns static datasheet information.
Raspberry Pi GPIO
ZeroClaw runs natively on Raspberry Pi and accesses GPIO through rppal or sysfs. No separate firmware is needed.Build with RPi GPIO support
Configuration
gpio_read and gpio_write tools over the Pi’s physical pins.
USB device discovery
ZeroClaw uses nusb for USB enumeration. It maps VID/PID to known boards (architecture, name, transport) via a built-in registry.probe-rs memory introspection
With theprobe feature, ZeroClaw can read live chip data over USB/SWD using probe-rs:
hardware_board_info agent tool uses probe-rs when the feature is present, falling back to static datasheet data otherwise.
Serial port peripheral (tokio-serial)
Serial communication for all boards (STM32, ESP32, Arduino) is handled bysrc/peripherals/serial.rs using tokio-serial. The same JSON-over-serial protocol works across all supported boards — only the board value in config changes.
Peripheral trait: extension points
To add a new board, implementPeripheral from src/peripherals/traits.rs:
- ZeroClaw reads
peripherals.boardsfrom config - Creates a
Peripheralimpl for each board and callsconnect() - Collects all tools from connected peripherals and merges them with the default tool set
- The agent loop calls
gpio_write,sensor_read, etc. — these delegate to the peripheral impl - On shutdown,
disconnect()is called on each peripheral
docs/contributing/adding-boards-and-tools.md in the repository for the step-by-step guide on registering new boards and datasheets.
Troubleshooting
"flash-nucleo" subcommand not recognized
"flash-nucleo" subcommand not recognized
This command is only available in repo builds. Build from source:
"probe-rs not found"
"probe-rs not found"
Install the CLI tools crate (not the library):
"No probe detected"
"No probe detected"
Ensure the Nucleo is connected and try a different USB cable or port. The board must be powered (the ST-Link LED should be on).
"Serial port not found" on Linux
"Serial port not found" on Linux
Add your user to the Verify with
dialout group, then log out and back in:zeroclaw peripheral list after reconnecting."GPIO commands ignored"
"GPIO commands ignored"
Check that the
path in config.toml matches your actual serial port. Run zeroclaw peripheral list to see what ZeroClaw has detected.