Embedded Engineering: Why Firmware Updates Are the Hardest Deploy You Will Ever Do
A web deploy that goes wrong is a bad afternoon. You roll back, restart a few servers and write an incident report. The machines are still there, and you can still reach them.
A firmware update that goes wrong can leave a device that won't start. It might be on a factory floor, in a car, in a hospital or on a pole by the road. Nobody can SSH in, and the fix may need a person with a cable, or a replacement device.
That difference changes every part of how you ship.
You Are Replacing the Thing That Runs the Update
On a server, the deploy tool runs on one machine and the new code lands on another. If the new code is broken, the tool is still there to undo it.
On a device, the update writes over the software that is doing the writing, often including the code that decides what to boot next. If the new image is bad, there may be nothing left that knows how to recover.
A server deploy replaces the application. A firmware update can replace the only thing that knows how to fix the device.
This is why the bootloader is treated so carefully. It's the one piece that must always work, so many teams update it rarely, if ever.
Power Can Disappear Mid-Write
A server rarely loses power halfway through a deploy. A device does it all the time: a battery runs flat, someone unplugs it, a car is switched off.
If the device was halfway through overwriting its only copy of the firmware, it's left with half an old image and half a new one. Neither will boot.
The standard answer is to never overwrite the working copy. The device keeps two slots. It writes the new image into the slot it isn't running from, checks it, and only then switches.
Android has worked this way since 2016. Its A/B updates keep a working system on the disk throughout the update. If an update fails to apply, the user keeps running the old version. If it applies but fails to boot, the device falls back to the previous slot. Pixel phones shipped with it in October 2016, and Chromebooks use the same update engine.
Two slots cost storage, which is expensive on small devices. Teams that can't afford them need another way to keep a recovery path, such as a small, separate recovery image that's never updated in the field.
Rollback Has to Be Automatic
On a server, rollback is a decision a person makes after looking at dashboards. A device in the field has no person nearby and often no dashboard.
So the device has to decide for itself. A common pattern is a trial boot:
- The bootloader starts the new image, marked as unconfirmed.
- The new firmware runs its own health checks: it boots, connects and does its core job.
- Only if those pass does it mark itself as good.
- If it crashes, hangs or reboots too many times first, a watchdog or the bootloader falls back to the old image.
The hard part is defining "healthy." A device that boots but can no longer reach the update server will never receive the fix. Connectivity has to be part of the check, not an afterthought.
Security Pulls in the Opposite Direction
Every device must refuse firmware that isn't yours. Updates are signed, and the device checks the signature before installing anything. Without that, the update channel becomes the easiest way to take over your fleet.
Security also limits rollback. If an old version had a serious vulnerability, an attacker would love to push the device back to it. So many devices enforce anti-rollback rules that refuse to run versions older than a recorded minimum.
That means the version you can safely roll back to shrinks over time. A bad release that also raises the minimum version can leave you with no safe place to go back to. Raising that minimum is a decision to make deliberately, not something that happens on every build.
The Fleet Is Not Your Test Lab
Your servers are nearly identical. Your devices are not. They come in different hardware revisions, with different flash chips and sensors, some with ten-year-old components and some patched in the field.
They also aren't reachable on your schedule. Some connect once a day, some once a month, some over metered cellular links where every megabyte costs money. A device that was offline during three releases may need to jump several versions at once, so that path has to be tested too.
Rolling out in stages is the only sane approach:
- Start with your own test devices, then a small slice of the real fleet.
- Watch boot success, check-in rates and the share of devices that confirm the new version.
- Pause automatically if confirmations drop or rollbacks rise.
- Keep each stage running long enough to include devices that only connect occasionally.
Design the Update Before the Product
Most of what makes firmware updates safe has to be decided before the first device ships: slot layout, storage size, a bootloader that can fall back, signing keys, version rules. None of it can be added later to hardware already in the field.
A web team can fix its deploy pipeline next sprint. An embedded team gets one chance, at design time, to make sure every future update can fail safely.
Treat the first firmware you ship as the one that has to rescue every version after it.
Enjoyed this post?
Stay in the loop
New posts + weekly digest, straight to your inbox.
Create a free account
- Save posts to your vault
- Like posts & build history
- New-post alerts
No comments yet. Be the first to comment!