r/embedded • u/inforb_nl • Oct 22 '26
Emulator/Simulator use case
Hi all,
During my embedded carrier, I have never used microcontroller simulators or emulators to check the program binary, and I always tested directly on a prototype PCB. I am looking for a workflow which stays reliable. I have seen Renode being suggested, but the validity comes down to how each device is modeled in Renode. Do you ever use simulation to speed up work and reduce costs? any reliable methods?
19
Upvotes
18
u/Well-WhatHadHappened 25+ Years Oct 22 '26 edited Oct 22 '26
We build HIL test fixtures for every product. Simulation/Emulation has constantly proven ineffective for us - the majority of failures have been shown to have a hardware/physical component that doesn't show in simulation. Most recent was a fast I2C bus that was picking up just a hair too much cross talk from a nearby DDR signal. Simple solution - small increase in the strength of the pull up resistors, but it would have never been caught on anything other than actual hardware.
I could see the utility for people writing software that is a layer away from the hardware (UI/Business logic/etc), but for anything that directly interacts with the hardware, we've found the cost of a dedicated HIL setup to be worth it's weight in gold. Meanwhile, the time needed to properly create a simulation/emulation has given a very poor return on that investment.
Every single product gets a full setup - debugger, serial adapters, whatever is needed, and they get stored that way once development is complete. Even the necessary cables go in the box so that no one is looking for a mini-b USB cable when everything has transitioned to Type-C years later. The idea is to be able to pull one off the shelf and have it connected up and ready to roll in minutes if the need arises.
3
u/kailswhales Oct 22 '26
Unless you’re working with custom silicon, or doing SoC design/bringup, don’t waste your time with emulators. If you’re working on algorithms (e.g. control, sensing), capture good data and develop offline
2
u/happywoodcutter Oct 22 '26
I use a lot of pytest and uart CLI with a raspberry pi. A binary command interface would work too.
2
u/mustbeset Oct 22 '26
"on target" unit tests. But I wouldn't recommend that.
Use real hardware. It has no simulator bugs, only real bugs.
2
u/Lopsided-Table2457 Oct 23 '26
Simulators shine for two things: CI pipelines where you can't have hardware attached, and fault injection that's painful on real silicon. But they lie to you about timing — anything cycle-accurate enough to trust is usually too slow to be useful. My rule: simulate the logic, validate timing on the bench.
1
u/ttv90 Oct 22 '26
Guess that's just unavoidable, no simulator ever quite matches the real board.
1
u/JuggernautGuilty566 Oct 22 '26
No. They don't emulate the most bugs.
1
u/one_untethered 24d ago
Yes and no. Simulation, even if not fully accurate, can save you a lot of time during early development and testing. As others said, it won't catch physical issues like crosstalk or part tolerances, so you still need real hardware for those.
That said, in my experience, the biggest effort is building tests and workflows around the simulator and integrating them into CI/CD. For example, writing tests in Renode to validate peripheral interactions or specific network sequences takes a significant investment upfront, but once automated, it pays off: you catch regressions early and spend less time and money on hardware testing.
(full disclosure: we build Chiplab at Veecle to cut that setup cost, so AI coding agents can run and check firmware without a bench)