A Cross-Model Dual-Agent Framework with Sequential Human-in-the-Loop Safety Interlocks for Zero-Config ESP32 Embedded Firmware Synthesis

Developing embedded firmware for microcontrollers such as the ESP32 usually requires prior knowledge of C++ programming, hardware pinouts, electrical constraints, and vendor-specific library rules. While Large Language Models (LLMs) can generate basic microcontroller code from natural language prompts, single-agent code generation frequently fails on real hardware due to silent pin conflicts, incompatible legacy libraries, and physical actuator violations. In this paper, we present a zero-config, dual-agent firmware synthesis framework that translates both English and code-mixed Hinglish voice or text commands into verified ESP32 C++ firmware without requiring manual configuration files. Our architecture separates firmware drafting (openai/gpt-oss-120b) from hardware safety auditing (qwen/qwen3.8-27b), enforces sequential Human-in-the-Loop (HITL) negotiation whenever dangerous silicon pins or physical limits are violated, automatically installs missing libraries via arduino-cli, and verifies execution using closed-loop UART serial acknowledgements (HW_EXECUTION_COMPLETE). Evaluated across 121 physical hardware-in-the-loop trials involving RGB LEDs, SG90 Servo Motors, and Active Buzzers, the framework achieved an 85.1% overall compilation rate (93.3% post-adaptation), an 89.4% closed-loop hardware confirmation rate, and 100.0% silicon safety enforcement across all 26/26 adversarial trap prompts (where 92.3% of raw single-agent drafts contained unsafe hardware violations).

Authors

Publication Details

Journal
Zenodo (CERN European Organization for Nuclear Research)
Published
2026-11-29
DOI
https://doi.org/10.5281/zenodo.24657207
Primary Topic
Embedded Systems Design Techniques
Type
preprint
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
preprint

A Cross-Model Dual-Agent Framework with Sequential Human-in-the-Loop Safety Interlocks for Zero-Config ESP32 Embedded Firmware Synthesis

Shubh Kumar Srivastava
1 links
Zenodo (CERN European Organization for Nuclear Research)
Embedded Systems Design Techniques
preprint

A Cross-Model Dual-Agent Framework with Sequential Human-in-the-Loop Safety Interlocks for Zero-Config ESP32 Embedded Firmware Synthesis

Shubh Kumar Srivastava
preprint en

Abstract

Developing embedded firmware for microcontrollers such as the ESP32 usually requires prior knowledge of C++ programming, hardware pinouts, electrical constraints, and vendor-specific library rules. While Large Language Models (LLMs) can generate basic microcontroller code from natural language prompts, single-agent code generation frequently fails on real hardware due to silent pin conflicts, incompatible legacy libraries, and physical actuator violations. In this paper, we present a zero-config, dual-agent firmware synthesis framework that translates both English and code-mixed Hinglish voice or text commands into verified ESP32 C++ firmware without requiring manual configuration files. Our architecture separates firmware drafting (openai/gpt-oss-120b) from hardware safety auditing (qwen/qwen3.8-27b), enforces sequential Human-in-the-Loop (HITL) negotiation whenever dangerous silicon pins or physical limits are violated, automatically installs missing libraries via arduino-cli, and verifies execution using closed-loop UART serial acknowledgements (HW_EXECUTION_COMPLETE). Evaluated across 121 physical hardware-in-the-loop trials involving RGB LEDs, SG90 Servo Motors, and Active Buzzers, the framework achieved an 85.1% overall compilation rate (93.3% post-adaptation), an 89.4% closed-loop hardware confirmation rate, and 100.0% silicon safety enforcement across all 26/26 adversarial trap prompts (where 92.3% of raw single-agent drafts contained unsafe hardware violations).

Zenodo (CERN European Organization for Nuclear Research)
Embedded Systems Design Techniques
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon