Overview
The fastest way to lose trust in an AI coding tool is to watch it write a register address that doesn't exist. Generic AI tools generate plausible-looking code, and in firmware “plausible” is dangerous: a wrong bit position or an invented peripheral compiles cleanly and then bricks a boot, corrupts a bus, or worse. Hallucination Detection is the layer that checks generated values against your docs and flags anything it can't cite before it reaches your hardware.
Why firmware punishes hallucination
In web code a hallucinated API throws an error you see in seconds. In firmware the same mistake is silent. A fabricated 0x4002 offset, a clock prescaler off by one, a DMA channel that belongs to a different peripheral — none of it is caught by the compiler, and all of it surfaces as flaky hardware behavior that costs hours on a logic analyzer. The cost of a confident wrong answer is far higher here than almost anywhere else in software.
How Hallucination Detection works
Every value the agent emits — register addresses, bit fields, reset values, timing constants, peripheral names — is checked against ground truth before it lands. The system leans on the same foundations as the rest of the platform:
- Documentation grounding. Each generated value is traced back to a specific section of the reference manual, datasheet, or SVD device file. If there's no source for it, it's flagged for review rather than shipped.
- Schematic cross-check. Pin assignments and peripheral routing are validated against the actual board via Schematic Ingestion, so a GPIO the firmware claims is free really is.
- Errata awareness.Generated code is checked against vendor errata, catching the cases where the “correct” datasheet value is itself wrong for your silicon revision.
- Hardware confirmation. Where Hardware Interactionis wired up, claims are confirmed against what the chip actually did — the bus waveform, the register read-back, the live debugger state.
Confidence scoring
Not every value is equally certain, and the agent says so. Each generated value carries a confidence score based on source corroboration, documentation recency, and how specifically it matches your exact part. Anything below your configured threshold is flagged for human review rather than quietly emitted. The system is built to surface uncertainty instead of papering over it — the opposite of a generic AI tool that's confidently wrong.
What gets caught
- Invented registers and offsets that don't exist on the target part.
- Wrong bit positions within an otherwise real register.
- Fabricated timing — setup/hold values or prescalers with no documented basis.
- Cross-part contamination, where a value valid on a sibling MCU leaks into the wrong one.
- Peripheral mismatches, like a DMA channel or alternate function mapped to the wrong block.
Where it fits
Hallucination Detection runs inline with Agent Orchestration: when the closed loop generates a change, the check happens before flash, and a failed citation sends the agent back to the documentation instead of out to the board. It also produces the audit trail regulated programs need — every value tied to a source — which is what makes the same workflow safe for migrations and safety-critical work.
Who it's for
- Teams burned by generic AI that hallucinated hardware details once too often.
- Safety-critical programs that need every value traceable to a published spec.
- Engineers bringing up unfamiliar silicon, where a confident wrong answer is hardest to catch by eye.
What's next
Hallucination Detection is built into Embedder's core agent platform. The quickest way to see it work is to talk to an engineerand run it against a part you know well — then watch it push back on the parts it can't cite.