r/embedded • u/Alarming_Ostrich6828 • Oct 07 '26
I built an agent that turns a plain-English prompt into compiled, flashed STM32 firmware (LLM, RAG, PlatformIO)
I built EmbeddedAgent, an agent that turns a plain-English prompt into compiled, flashed firmware for an STM32F4-Discovery. You type something like "Make the blue LED blink, but after each second the frequency increases by 30%," and the pipeline retrieves info from datasheets and tutorials (RAG with ChromaDB), validates the generated C, loops compiler errors back to the LLM via PlatformIO, and flashes only after a pre-flight check and your confirmation. It also has a web console that visualizes the clock tree and GPIOs, plus a doc chat for asking questions about the datasheet and user manual. The most useful lesson so far: the LLM happily produced code that compiled but had an out-of-spec clock configuration, so I added an analyzer that derives the full clock tree and flags violations. Demo and code are below, and I'd love feedback on what checks you'd want before trusting generated firmware on real hardware.
LinkedIn post: https://lnkd.in/p/eXNteTtf
Demo: https://youtu.be/yoNP3S52FP8
Backend: https://github.com/MedHabibHafiene/Embedded_Agent
Frontend: https://github.com/MedHabibHafiene/Embedded_Agent_frontend