The closed loop. Agents build firmware in PlatformIO. Agents verify the firmware in a simulator.
Category: Whitepaper
An AI agent writes firmware. The agent builds the firmware with PlatformIO. The agent runs the firmware on a deterministic digital twin. The digital twin is the LabWired simulator. The agent reads the result. The agent corrects the firmware that the agent wrote. The loop uses no hardware.
The loop does not close
AI agents that write code are now good enough to write embedded firmware. The agents cannot run the firmware. For web code, an agent writes code. The agent executes the code. The agent reads the output. The agent tries again. The loop takes seconds. For embedded firmware, the loop does not close. You need a specific board to know that the firmware works. You need a probe that flashes the firmware. You need a person to connect the wires. The person watches a UART. The agent cannot see the result.
You cannot close the loop with real hardware. Hardware is serial. One board does one job at a time. Hardware is not deterministic. Some bugs depend on timing. Those bugs do not reproduce. You can damage the hardware. The third attempt of the agent should not damage a power stage. A closed loop needs a fast simulator. The simulator must be deterministic. The simulator must run jobs in parallel. The simulator must be disposable. A bench is not fast. A bench is not deterministic. A bench does not run jobs in parallel. A bench is not disposable.
The closed loop
flowchart LR
A["Agent writes /<br/>edits firmware"] -- "build · PlatformIO" --> B["firmware.elf"]
B -- "run · LabWired sim<br/>(deterministic)" --> C["structured result<br/>result.json · UART · VCD · PC history"]
C -- "agent reads & diagnoses" --> A
Caption: Each pass through the loop takes seconds. The pass needs no board. The pass needs no probe.
Each step is headless. A headless step has no display. A script can start each step. An agent can run the loop with no person present. An agent can run fifty loops in parallel across boards and configurations.
Why LabWired is the simulator
- Deterministic by construction. The same firmware binary gives the same result on every run. The observations of an agent are reproducible. Reproducible observations are necessary for an agent to reason about cause and effect.
- Structured observability. Each run emits machine-readable output. The output is
result.json, a UART log, a VCD trace, and PC history. The agent uses this structured data. The agent does not use a screenshot. - An MCP server, built in. The open-source core includes a Model Context Protocol server. The server exposes
simulate,validate_system,list_boards, and more. An agent controls the simulator directly. - Real cores, validated peripherals. LabWired has instruction-level models of ARM Cortex-M, RISC-V, and Xtensa. LabWired diffs the peripheral blocks against physical silicon on a hardware-oracle bench.