Firmware Update Strategies
Safely updating embedded devices in the field. A/B partitioning, rollback strategies, and secure firmware delivery explained.
Safely updating embedded devices in the field. A/B partitioning, rollback strategies, and secure firmware delivery explained.
The cardinal rule: A device must always be able to recover to a working state. If an update fails, the device should boot the previous firmware, not become a brick.
The most reliable approach uses two firmware partitions. The device boots from partition A while updates are written to partition B. After a successful update, the device switches to partition B. If the new firmware fails, it can fall back to partition A.
An alternative for storage-constrained devices. A small recovery partition contains minimal firmware that can download and flash the main firmware.
Firmware updates are an attack vector. Without security, attackers can install malicious firmware. Essential security measures:
All firmware images are cryptographically signed. The bootloader verifies signatures before accepting updates. Only firmware signed with your private key will be installed.
Each stage of boot verifies the next. ROM bootloader verifies first-stage bootloader, which verifies second-stage, which verifies firmware. If any stage fails verification, boot stops.
Encrypt firmware images to prevent reverse engineering and protect intellectual property. Each device decrypts using its unique key.
Downloads should use TLS. Certificate pinning prevents man-in-the-middle attacks. Verify server identity before downloading.
Do not push updates to all devices at once. Roll out to a small percentage first, monitor for problems, then gradually expand. If issues appear, stop the rollout before affecting the entire fleet.
Target specific devices for early updates - internal test devices, cooperative customers, or devices with telemetry enabled. Learn from canaries before broad deployment.
Group devices by hardware revision, configuration, or customer. Update groups independently, applying updates only to compatible devices.
Know what is happening during updates. Track:
High failure rates indicate problems with the update or with specific device populations. Investigate before continuing rollout.
Reliable firmware updates require multiple layers: resilient update mechanisms (A/B partitioning), security (code signing, secure boot), and operational controls (staged rollout, monitoring). The goal is zero bricked devices - every device should recover from any failure.
Design update capability from the start. Retrofitting reliable updates into a device designed without them is difficult. The extra storage and bootloader complexity is worth it when you have thousands of devices in the field.
A device must always be able to recover to a working state: if a firmware update fails, it should boot the previous firmware rather than become a brick. A/B partitioning is the most reliable way to achieve this, because the device keeps a working copy while the new firmware is written elsewhere. Power failure, corrupt downloads and bad firmware are the usual causes of failed updates.
A/B partitioning keeps two firmware partitions. The device runs from partition A while the new firmware is written to partition B, then reboots into B. If B boots successfully it becomes active, and if it fails, a watchdog reboots the device into A. This is power-safe and rolls back automatically, but needs twice the storage for firmware images and more complex bootloader logic.
Devices with little storage can use a recovery partition: a small partition holding minimal firmware that can download and flash the main firmware. The update is downloaded to a staging area, the device reboots into recovery, and recovery writes the update to the main partition. If the main firmware fails, recovery can download it again. The recovery partition must never be updated and should stay minimal.
Protect firmware updates by cryptographically signing every image and having the bootloader verify the signature before installing it, so only firmware signed with your private key is accepted. Keep signing keys in a hardware security module (HSM), use separate development and production keys, and sign the entire image. A secure boot chain, encrypted images and downloads over transport layer security (TLS) add further protection.
Firmware updates should be rolled out in stages rather than to every device at once. One pattern is 5% of devices first, 25% after 24 hours if there are no issues, and 100% after another 24 to 48 hours. Canary devices, such as internal test units, update first, and devices are grouped by hardware revision so updates reach only compatible devices. Investigate high failure rates before continuing.
Ask the author
Ask it here and it comes straight to the founder. No sales call, no obligation, and a real answer even if the answer is that you do not need us.
Kasun Wijayamanna
Founder, replies within one business day
Tell us what you are working on. We will come back with a practical recommendation and clear next steps.
Built here. Your data stays here.
Thanks for reaching out. We will get back to you within one business day.
See what else we do