I Implement Over-the-air (ota) Firm… AI recommendations | Parse
How can I implement over-the-air (OTA) firmware updates for a fleet of embedded devices?
Data as of Sep 26, 2026 · Based on 343 AI responses from ChatGPT Search and Google AI Mode · See how Parse measures this
AWS IoT is the best fit when you need a cloud update server to host firmware, manage device cohorts, and orchestrate staged rollouts. If you want a provider to handle hosting and delivery with less setup, Golioth is recommended, though evidence shows less emphasis on deployment orchestration.
Best when you need a secure cloud update server to host firmware, manage device cohorts, and orchestrate staged rollouts; evidence cites AWS IoT for server-side deployment and staging. Tradeoff: setup and cloud dependency.
Over-the-air (OTA) update best practices for industrial IoT and ...https://mender.io/resources/reports-and-guides/ota-updates-best-practices
6%
OTA Firmware Updates for IoT & Embedded Deviceshttps://memfault.com/ota-firmware-updates/
4%
Over-the-air (OTA) updates - Internet of Things (IoT) Lenshttps://docs.aws.amazon.com/wellarchitected/latest/iot-lens/over-the-air-ota-updates.html
4%
OTA Update Checklist for Embedded Devices in 2025https://memfault.com/blog/ota-update-checklist-for-embedded-devices/
4%
Over the air updates (OTA): best practices for device safety - IOT Insiderhttps://www.iotinsider.com/industries/security/over-the-air-updates-ota-best-practices-for-device-safety/
3%
Over-The-Air (OTA) Firmware Updates | Tutorials on Electronics | Next Electronicshttps://www.next.gr/tutorials/iot-and-embedded-systems/over-the-air-ota-firmware-updates-tutorial
2%
Implementing Over-The-Air (OTA) updates for embedded Linux and Android systemshttps://antmicro.com/blog/2022/07/ota-updates-for-embedded-linux-and-android-systems
2%
5 Best Practices for Over-the-Air (OTA) Updates | Beningohttps://www.beningo.com/5-best-practices-for-over-the-air-ota-updates/
2%
OTA Firmware Updates | Getting Started | Particlehttps://docs.particle.io/getting-started/cloud/ota-updates/
2%
How to Update Embedded Firmware Over-The-Air (OTA)https://predictabledesigns.com/how-to-update-embedded-firmware-over-the-air-ota/
2%
Question: How can I implement over-the-air (OTA) firmware updates for a fleet of embedded devices?
A production OTA system is best thought of as a secure deployment pipeline plus a fail-safe boot/update mechanism, not simply “download a new .bin file.”
A solid architecture looks like this:
Developer
│
▼
CI/CD ──► Build firmware ──► Sign artifact
│
▼
OTA backend / CDN
│
deployment + targeting
│
┌───────────────┴───────────────┐
▼ ▼
Device A Device B
OTA client OTA client
│ │
TLS/auth TLS/auth
│ │
▼ ▼
Bootloader Bootloader
A/B slots A/B slots
┌──────┐ ┌──────┐
│ FW A │ │ FW A │
├──────┤ ├──────┤
│ FW B │ │ FW B │
└──────┘ └──────┘
The device normally executes A. The OTA client downloads the new image into B, verifies it, marks B as the next boot target, and reboots.
On the first boot, the new firmware must prove that it successfully initialized. Only then does the bootloader permanently commit B. Otherwise, the bootloader returns to A.
This A/B approach protects against failures such as power loss during installation or a firmware image that boots incorrectly. It's a common pattern in robust OTA systems.
Implementing over-the-air (OTA) firmware updates for an embedded fleet requires a robust architecture combining a dual-bank flash memory layout, a secure bootloader, cryptographic image verification, and a reliable device management backend
Question: How can I implement over-the-air (OTA) firmware updates for a fleet of embedded devices?
For embedded Linux, the same concept is commonly implemented with two root filesystem partitions. Mender, for example, writes the new image to the inactive partition and rolls back if the new system doesn't successfully boot and commit.
2. Cryptographically sign every firmware image
Don't rely on TLS alone.
You want two separate protections:
TLS protects the connection while downloading.
Firmware signatures establish that the binary itself was produced by you and hasn't been modified.
Keep the signing private key out of ordinary developer machines. Ideally, signing happens through a controlled CI/CD process backed by an HSM or equivalent key-management system.
The device should contain only the public verification key or certificate chain. Hardware-backed key storage can provide another layer of protection.
Also include:
Firmware version
Hardware/model identifier
Image size
Cryptographic hash
Signature
Minimum bootloader version
Optional minimum hardware revision
Release metadata
3. Prevent firmware downgrade attacks
Suppose an attacker obtains a perfectly valid firmware image from six months ago that contains a vulnerability.
A valid signature doesn't make that image safe.
Have the bootloader enforce a monotonic version/security counter:
X.509 device certificates are one common approach for IoT fleets. AWS's guidance similarly recommends unique device identities and credentials rather than shared fleet credentials.
Ideally, private device keys are generated/stored in a secure element, TPM, or other hardware-backed storage when your hardware supports it.
5. Separate the OTA client from the bootloader
A useful division is:
OTA client
Contacts server
Authenticates device
Determines whether an update exists
Downloads it
Resumes interrupted downloads
Verifies metadata/hash
Places image into inactive slot
Tells bootloader to attempt update
Reports success/failure
Bootloader
Validates firmware signature
Checks compatibility/version policy
Selects boot slot
Tracks boot attempts
Rolls back failed images
That separation means a compromised or buggy application doesn't get unrestricted authority to replace the bootloader's security decisions.
6. Design for unreliable networks
Assume the connection will disappear halfway through the download.
Your update protocol should support:
HTTP range/resumable downloads or equivalent
Chunked downloads
Hash/checksum validation
Retries with exponential backoff
Power-loss recovery
Persistent download state
Sufficient free flash/storage
Verification before activation
Don't make an interrupted download equivalent to a failed firmware installation.
For cellular devices in particular, also consider bandwidth and data costs. Full-image updates are simple and robust, while delta updates can substantially reduce bandwidth at the cost of additional complexity.
7. Don't update the whole fleet simultaneously
Your backend should support staged deployments.
For example:
Firmware 2.7.0
└── Internal test devices 20
│
▼
Canary fleet 100
│
▼
1% of production
│
▼
10% of production
│
▼
25%
│
▼
100%
At each stage, monitor:
Download failures
Installation failures
Boot failures
Rollback rate
Device connectivity
Application health
Crash/reset rates
Battery consumption
Relevant application-specific metrics
Automatically pause the rollout if failure rates exceed your thresholds.
Fleet deployment systems such as AWS IoT Jobs explicitly support controlled deployment/rollback patterns, while OTA guidance recommends gradual rollouts rather than updating every device simultaneously.
8. Use device groups and compatibility constraints
Don't send one generic firmware to every device.
Your update manifest might look conceptually like:
model = sensor
hardware_revision = C
region = US
current_version < 2.7.0
This becomes particularly important when you have multiple MCU types, board revisions, bootloader versions, or product generations.
9. Keep application data separate from firmware
Don't overwrite configuration and user/device state when replacing firmware.
For example:
Flash
├── Bootloader
├── Firmware A
├── Firmware B
├── Device identity
└── Persistent data
├── configuration
├── calibration
└── application state
Your firmware update should be able to replace either firmware slot without destroying persistent data.
For Linux systems, this separation is also important because replacing an entire root filesystem can otherwise remove files that applications expect to persist.
10. Pick the implementation according to your hardware
MCU / RTOS
If you're using something like Zephyr, a strong starting point is MCUboot plus an OTA management layer. MCUboot provides image verification and A/B-style slot management; Mender, for example, integrates its MCU client with Zephyr and MCUboot for atomic OTA updates and rollback.
Embedded Linux
For Linux devices, an image-based A/B system is usually attractive.
Options include:
Mender
RAUC
SWUpdate
OSTree-based systems
A custom U-Boot + A/B implementation
Mender, for example, provides a device client and server architecture with A/B root filesystem updates and rollback.
Cloud backend
You can either build the control plane yourself or use an OTA fleet-management service.
A managed architecture might be:
CI/CD
│
├── Build
├── Test
├── Sign
└── Publish
│
▼
OTA service
│
┌────┴────┐
│ │
device device
AWS IoT Jobs is one example of a service providing fleet targeting and OTA job management.
Mender is another example, with a server/client architecture and support for both embedded Linux and, through its MCU integration, constrained microcontrollers.
A practical implementation plan
I'd build it in this order:
Bootloader
Signature verification
A/B slots
Version protection
Boot-attempt counter
Automatic rollback
Local updater
Download firmware
Resume interrupted downloads
Validate hash/signature
Write inactive slot
Request reboot
Report result
Device identity
Unique device credentials
TLS
Secure credential storage
Artifact pipeline
Reproducible firmware build
Automated tests
Firmware signing
Artifact repository
OTA backend
Device inventory
Firmware versions
Device groups
Deployment jobs
Status reporting
Staged rollout
Test → canary → percentage rollout → full fleet
Automatic pause/rollback criteria
Observability
Update state per device
Failure reason
Current/previous firmware
Boot failures
Rollbacks
Connectivity
The key design principle
Never make “downloaded successfully” mean “updated successfully.”
A robust lifecycle is:
AVAILABLE
↓
DOWNLOADING
↓
DOWNLOADED
↓
SIGNATURE VERIFIED
↓
INSTALLED IN INACTIVE SLOT
↓
PENDING REBOOT
↓
BOOTING NEW IMAGE
↓
HEALTH CHECK
├── FAIL → ROLLBACK
│
└── PASS → COMMIT
That state machine, combined with cryptographic verification, A/B storage, rollback, unique device identity, and staged fleet deployment, gives you the foundation of a production-grade OTA system.
If you tell me your MCU/SoC (e.g. ESP32, STM32, nRF52, i.MX), RTOS/Linux choice, connectivity (Wi-Fi/cellular), and approximate fleet size, I can lay out a concrete OTA architecture and flash partition map for it.
For example:
Flash
├── Bootloader
├── Firmware A
├── Firmware B
├── Device identity
└── Persistent data
├── configuration
├── calibration
└── application state
Your firmware update should be able to replace either firmware slot without destroying persistent data.
For Linux systems, this separation is also important because replacing an entire root filesystem can otherwise remove files that applications expect to persist.
10. Pick the implementation according to your hardware
Implementing over-the-air (OTA) firmware updates for a fleet of embedded devices requires a robust, secure, and fault-tolerant architecture. If an update fails mid-way, you don't want a fleet of expensive, unrecoverable "brick" devices in the field.
Here is a clear, structured roadmap to building a reliable OTA pipeline:
Hardware & Memory Architecture (Dual-Bank Flash)
Dual-Bank (A/B) Partitioning : Divide your non-volatile storage (Flash) into two separate application partitions: Bank A (Active/Running) and Bank B (Inactive/Staging). The bootloader boots from Bank A while the new firmware downloads safely into Bank B.
The Bootloader : Keep your primary bootloader small, secure, and rarely changed. It is responsible for verifying the integrity of the newly flashed image, swapping the active pointer, and handling rollbacks if the new firmware crashes.
Fallback/Rollback Mechanism : If the new firmware fails its health check or fails to report a "success" status to the bootloader within a watchdog timeout window, the bootloader automatically reverts to the previous working image (Bank A).
Security & Cryptography
Cryptographic Signing : Never push unsigned binaries. Sign your firmware images on your build server using a private key (e.g., using Ed25519 or RSA-3072). The embedded device verifies the signature with an embedded public key before applying the update.
Transport Security : Use strict TLS (1.3) for downloading images over Wi-Fi, Cellular, or Ethernet to prevent man-in-the-middle tampering or snooping.
Encrypted Images : If your firmware contains proprietary algorithms or sensitive keys, encrypt the binary payload itself and decrypt it on-the-fly or inside a secure element/microcontroller flash controller.
Backend & Fleet Management Infrastructure
Device Registry & Metadata : Maintain a database of your fleet tracking each device's hardware revision, current firmware version, and cryptographic identifier (like a UUID or hardware-bound certificate).
Delta Updates : For constrained bandwidth (like Cellular/NB-IoT), generate binary diffs (using tools like bsdiff) so devices download only the changed bytes rather than a full monolithic image, saving data and time.
Phased Rollouts (Canary Deployments) : Avoid updating the entire fleet at once. Push updates to a 1% canary group, monitor telemetry for errors or crash loops, and scale up to 10%, 50%, and 100% progressively.
Open-Source & Managed Ecosystem Tools
MCUboot : A secure bootloader for 32-bit microcontrollers that natively supports dual-image swappable slots and signature verification.
AWS IoT Jobs / Azure Device Update : Cloud-managed frameworks that handle device grouping, rollout scheduling, and security for connected fleets.
Mender or Balena : End-to-end open-source and commercial OTA update software specifically engineered for Linux-based or RTOS embedded edge devices.
To help tailor this design, let me know:
What microcontroller or processor family (e.g., ESP32, STM32, ARM Cortex-A Linux) are you using?
What is your connectivity medium (Wi-Fi, Cellular, LoRaWAN, Ethernet)?
.
To build a production-grade OTA pipeline, you must structure the implementation across distinct hardware, software, and cloud layers.
Core Architecture Components
A/B (Dual-Bank) Partitioning : Split your non-volatile flash memory into two separate application slots (Slot A and Slot B). While the device runs actively on Slot A, the incoming new firmware downloads safely into Slot B. Once verified, the bootloader switches execution to Slot B, preventing a bricked device if a power loss occurs mid-download.
Primary Bootloader : A minimal, locked-down piece of code executed at startup. The bootloader checks the integrity of the active slot, handles swapping logic, and performs automatic rollbacks to the stable fallback partition if the newly booted firmware crashes or fails a self-test.
Cryptographic Signing : Sign every compiled binary image on your build server using asymmetric cryptography (such as RSA or ECDSA). Store the public key securely on the device chip (e.g., in hardware root-of-trust or secure elements) so the bootloader can reject unsigned or altered binaries before execution.
Transport and Device Management : Use lightweight IoT communication protocols like MQTT, HTTPS, or CoAP to stream packages. You can build a custom server or integrate with commercial and open-source device management tools like Mender or Eclipse hawkBit to handle campaign rollouts.
Implementation Workflow
Step
Phase
Action & Engineering Requirement
1
Partitioning
Configure the memory map in your linker script to reserve space for Bootloader, Application A, Application B, and non-volatile configuration storage.
2
Transport
Set up an agent daemon on the device to securely poll or receive notification cues from your server regarding a pending manifest update.
3
Verification
Download the binary chunk-by-chunk, calculate a local SHA-256 hash, and verify the cryptographic signature against the embedded public key.
4
Activation
Write the validated payload to the inactive flash bank, update the bootloader metadata flag to swap boot targets, and trigger a controlled software reset.
5
Validation
Run a post-installation health check on the new firmware. If the app fails to ping the watchdog or confirm operational status within a set window, force a rollback.
Best Practices for Fleet Management
Implement Atomic Updates : Ensure updates either succeed entirely or abort cleanly without leaving partial, corrupted binaries in the active execution path.
Staged Rollouts : Never push a new firmware build to your entire fleet at once. Target a canary group (1% to 5% of devices), monitor telemetry and error logs for anomalies, and only then proceed with a wide release.
Robust Observability : Track metrics like update success rates, download drop-offs, and reset loops via your cloud platform to catch fleet-wide edge-case regressions instantly.
A robust OTA system for an embedded fleet should be designed as secure boot + signed firmware + fail-safe installation + controlled fleet rollout, rather than simply “download a binary and flash it.”
Recommended architecture
┌─────────────────────┐
│ Firmware CI/CD │
│ build + test + sign │
└──────────┬──────────┘
│
signed image
│
┌──────────▼──────────┐
│ Firmware repository │
│ object storage/CDN │
└──────────┬──────────┘
│ HTTPS
│
┌────────────────────▼────────────────────┐
│ OTA service │
│ device inventory / jobs / rollout │
└────────────────────┬────────────────────┘
│ MQTT/HTTPS
┌─────────────┴─────────────┐
│ │
┌─────▼─────┐ ┌─────▼─────┐
│ Device A │ ... │ Device N │
│ OTA agent │ │ OTA agent │
│ bootloader│ │ bootloader│
└───────────┘ └───────────┘
1. Put a secure bootloader underneath the application
The bootloader should verify that an image is:
cryptographically authentic
intact
compatible with the hardware
sufficiently new
authorized to run
For MCU-class devices, MCUboot is one established option. It supports signed images and upgrade/rollback mechanisms, including a test boot followed by confirmation of the new firmware.
A typical flash layout is:
+-----------------------+
| Bootloader | <-- immutable/protected
+-----------------------+
| Application slot A | <-- currently running
+-----------------------+
| Application slot B | <-- downloaded update
+-----------------------+
| Persistent data |
+-----------------------+
This A/B scheme is extremely valuable. Don't overwrite the only known-good application image while performing an OTA update.
2. Sign firmware in CI/CD
Your build pipeline should produce something like:
Then sign the image/metadata with a release signing key.
The device should have only the public verification key (or a chain of trust); the private signing key should never exist on the device.
Also implement anti-rollback. Otherwise an attacker who obtains an old but validly signed vulnerable firmware image could potentially downgrade a device. MCUboot, for example, supports version/security-counter-based downgrade prevention.
3. Have the device ask whether an update exists
Don't necessarily push a several-megabyte binary directly over your command channel.
The device then downloads the image, preferably over HTTPS.
For constrained devices, MQTT-based block transfer can also make sense. AWS's OTA implementation, for example, supports HTTP and MQTT delivery and separates notification, downloading, cryptographic verification, and installation.
4. Download into the inactive slot
The device should:
Check that enough storage is available.
Download into slot B.
Verify the complete image hash.
Verify the firmware signature.
Verify hardware/product compatibility.
Verify version/security counter.
Mark slot B as a pending/test image.
Reboot.
Critically, don't erase slot A until the new firmware has successfully booted.
5. Make the first boot a trial
The bootloader/application state machine should look approximately like:
update available
│
▼
Download image
│
▼
Verify image
│
▼
Boot new image
│
┌─────┴─────┐
│ │
self-test OK crash/watchdog
│ │
▼ ▼
CONFIRM ROLLBACK
│
▼
normal boot
The application should confirm the new firmware only after passing meaningful health checks, such as:
initialization succeeds
flash/filesystem is healthy
communications work
critical peripherals respond
configuration can be loaded
watchdog operates normally
MCUboot explicitly supports this test/confirm/revert pattern.
6. Treat fleet deployment separately from firmware delivery
This is where many OTA implementations become dangerous.
Cloud fleet-management systems such as AWS IoT Device Management provide rollout controls, failure thresholds, device groups, and monitoring for this purpose.
You can store a small download-progress record in persistent storage.
For cellular devices especially, also consider:
bandwidth limits
battery state
data costs
update windows
maximum retry count
8. Separate firmware identity from device identity
Every device should have a unique cryptographic identity, for example:
device certificate/private key
↓
authenticated
↓
OTA service
The OTA service should know:
device ID
hardware revision
current firmware
region
deployment group
last successful update
last failed update
That lets you say:
Deploy firmware 2.7.4 only to sensor-v3, hardware revisions C/D, excluding devices currently reporting low battery.
This is much safer than broadcasting a firmware URL to every device.
9. Design for power loss
Assume the device loses power at every possible point:
during download
during flash write
after flash write
during reboot
during first boot
during confirmation
Your state machine should still result in either:
known-good firmware
or
new firmware + ability to revert
Never require the network to recover a device after a failed update. The recovery mechanism must be local to the device.
10. Keep application data separate from firmware
Don't casually erase:
configuration
calibration
device identity
keys/certificates
user data
when installing firmware.
Use separate flash partitions or a carefully designed migration mechanism:
Bootloader
Firmware A
Firmware B
Device credentials
Configuration
Application data
OTA metadata
If firmware 2.7 changes the configuration schema, make migrations explicit and preferably reversible.
A practical technology stack
For a typical MCU product, one reasonable stack is:
Layer
Example
Bootloader
MCUboot
RTOS
Zephyr / FreeRTOS
Transport
HTTPS, optionally MQTT
Firmware storage
S3/object storage + CDN
Fleet management
AWS IoT Jobs or equivalent
MCUboot is OS-independent and supports several embedded operating systems and MCU platforms.
If you're already using AWS IoT, AWS's OTA Update Manager can create OTA updates targeting device groups, deliver via MQTT/HTTP, and integrate signing and IoT Jobs.
The key security rule
The most important principle is:
Never trust the update server alone. The device itself must cryptographically decide whether an image is allowed to execute.
Even if your cloud account, CDN, network, or update metadata is compromised, an attacker should not be able to make the device execute an unsigned or unauthorized firmware image.
If you tell me your MCU/SoC (e.g. ESP32, STM32, nRF52/nRF53), RTOS/Linux, connectivity (Wi-Fi/cellular/LoRaWAN), and approximate fleet size, I can lay out a concrete flash layout, bootloader state machine, signing scheme, cloud architecture, and implementation skeleton for that platform.
A production OTA system is best designed as a secure update pipeline + a fail-safe boot/update mechanism + fleet rollout controls. The exact implementation depends heavily on whether your devices run embedded Linux or a microcontroller RTOS.
A service such as aws.amazon.com provides the fleet-management/job portion, while alternatives such as Mender provide both server and device-side OTA infrastructure. AWS IoT Jobs, for example, can send jobs instructing devices to download/install firmware and report their status.
2. Make the firmware cryptographically signed
Don't rely on HTTPS alone.
Your release pipeline should produce something like:
Verify the manufacturer's digital signature using a public key embedded/protected on the device.
Check hardware compatibility.
Check that the version/security counter is acceptable.
Only then install it.
For example, MCUboot supports signed images and downgrade prevention using version/security-counter mechanisms.
Keep the signing private key off the device and preferably out of ordinary developer workstations. Your CI/CD release process should be the only thing authorized to produce production-signed firmware.
3. Use A/B firmware partitions
This is probably the most important reliability feature.
For a Linux device:
Flash
┌─────────────────────┐
│ Bootloader │
├─────────────────────┤
│ Root filesystem A │ ← currently running
├─────────────────────┤
│ Root filesystem B │ ← install update here
├─────────────────────┤
│ Persistent data │
└─────────────────────┘
The device downloads the new image into the inactive partition. It doesn't overwrite the currently working firmware.
Then:
A running
↓
download firmware
↓
verify signature/hash
↓
install into B
↓
boot B
↓
health check
↓
mark B good
If power disappears during the download or installation, A remains intact.
If B boots but crashes repeatedly, the bootloader should automatically return to A.
This is the model used by systems such as Mender and RAUC; Mender explicitly uses redundant A/B partitions for fail-safe OS updates, while RAUC supports atomic redundant-system updates and cryptographic bundle verification.
For an MCU, a bootloader such as MCUboot can provide the equivalent two-slot mechanism. Mender's Zephyr integration, for example, combines a device-side client with MCUboot's two-slot update mechanism and rollback behavior.
4. Separate "download" from "activate"
Your OTA agent should behave roughly like this:
if (!update_available())
return;
download_to_inactive_slot();
if (!verify_hash())
fail();
if (!verify_signature())
fail();
if (!compatible_with_hardware())
fail();
if (!version_is_allowed())
fail();
mark_slot_pending();
reboot();
Then automatically stop the rollout if failure rates exceed your threshold.
AWS IoT Device Management, for example, supports fleet grouping, rollout velocity and failure thresholds for OTA deployments.
6. Give every device useful metadata
Your OTA service should know at least:
device_id
hardware_model
hardware_revision
current_firmware
bootloader_version
region
environment
last_seen
battery_level
update_status
This lets you target:
hardware_model == "sensor-v2"
AND hardware_revision == "B"
AND current_firmware < "3.7.2"
AND environment == "production"
rather than accidentally sending a firmware image intended for one hardware revision to the entire fleet.
AWS's continuous OTA mechanism, for example, supports targeting devices using metadata attributes.
7. Design for bad networks
The update process should tolerate:
Wi-Fi/cellular disconnections
device power loss
partial downloads
server failures
intermittent connectivity
devices being offline for weeks
Useful techniques include:
resumable downloads
chunked downloads
checksums
download-to-inactive-slot
retry with exponential backoff
randomized polling/jitter
CDN/object storage for firmware
update bandwidth limits
persistent update state
Don't have 50,000 devices all wake up at exactly midnight and request a 20 MB image.
8. Protect against rollback attacks
There's an important distinction between:
"Rollback automatically if the new firmware crashes."
and:
"Allow anyone to install an old, vulnerable firmware."
You want the first but generally not the second.
Use a monotonically increasing security counter or equivalent anti-downgrade mechanism. MCUboot, for example, supports security counters for preventing installation of images below the trusted version.
Ideally you have a protected recovery mechanism—such as a factory image, ROM bootloader, hardware recovery interface, or redundant bootloader strategy—so a failed bootloader update doesn't permanently brick the device.
For embedded Linux, frameworks such as RAUC and Mender can handle substantial portions of this update architecture.
10. Choose the implementation based on your device
Embedded Linux
A practical stack could be:
Yocto/Buildroot
+
U-Boot
+
RAUC or Mender
+
HTTPS/object storage
+
OTA management server
Mender is particularly oriented toward fleet management and supports managed deployments, while RAUC is a lightweight update client/bundle system.
MCU / RTOS
A typical architecture is:
FreeRTOS / Zephyr
+
MCUboot
+
A/B flash slots
+
HTTPS/MQTT
+
OTA service
For MCUboot-based systems, the bootloader performs image validation and manages the slot transition/rollback.
Cloud-managed fleet
If you're already heavily invested in AWS, a reasonable architecture is:
CI/CD
↓
Code signing
↓
S3
↓
AWS IoT Jobs
↓
Device OTA agent
↓
A/B bootloader
AWS's OTA agent model explicitly expects the device to download the firmware, verify its digital signature, install it, and report the job result.
11. A good minimum production design
If I were designing a new fleet today, I'd make these requirements non-negotiable:
Component
Requirement
Transport
TLS
Firmware authenticity
Digital signature
Integrity
Cryptographic hash
Storage
A/B slots
Boot
Secure/verified boot
Failure handling
Automatic rollback
Downgrade protection
The key principle is: an OTA system shouldn't merely make firmware downloadable; it should make an interrupted, malicious, incompatible, or broken update fail safely.
If you tell me your MCU/SoC (e.g. ESP32, STM32, nRF52, Raspberry Pi), OS/RTOS, connectivity (Wi-Fi/cellular/etc.), approximate fleet size, and whether you have a cloud backend, I can sketch a concrete architecture and implementation—including partition layout, bootloader flow, manifest format, and device-side OTA code.
Then automatically stop the rollout if failure rates exceed your threshold.
AWS IoT Device Management, for example, supports fleet grouping, rollout velocity and failure thresholds for OTA deployments.
Implementing over-the-air (OTA) firmware updates for an embedded fleet requires a robust dual-bank memory architecture, cryptographic signing, and a reliable device management backend to prevent bricking devices in the field.
Core Implementation Architecture
Dual-Bank (A/B) Partitioning : Allocate your non-volatile flash memory into two separate application slots (Bank A and Bank B). The bootloader executes the active image while the OTA client downloads the new firmware binary into the inactive bank, executing an atomic switch upon success.
A Fallback/Rollback Mechanism : Program your primary bootloader to verify the integrity and health of a newly booted image. If the application crashes repeatedly or fails a health check post-update, the bootloader automatically reverts to the previous working partition.
Cryptographic Verification : Sign every firmware image using private-public key cryptography (such as Ed25519 or ECDSA) during your CI/CD build process. The embedded device must use a hardcoded public key—often stored in a hardware Root of Trust or secure element—to verify the signature before writing or booting the image.
Transport and Update Client : Implement a lightweight client protocol (such as MQTT, HTTPS, or specialized device management agents) for the device to poll or receive payloads from a secure cloud platform.
Fleet Management Server : Deploy a backend distribution system (such as AWS IoT Device Management, Mender , or Memfault ) to manage staged rollouts, target specific hardware groups, and monitor deployment health metrics.
Step-by-Step Deployment Workflow
Build and Sign : Compile your application binary and generate a cryptographic signature hash (e.g., SHA-256) of the image.
Staged Upload : Push the validated artifact package to your secure server repository or OTA orchestration platform.
Notification and Download : The device client queries the server (via scheduled polling or broker alert) and downloads the update into the inactive flash bank over an encrypted TLS connection.
Integrity Check : The device validates the file checksum and verifies the digital signature against the stored public key.
Atomic Swap and Reboot : The bootloader flags the new bank as active, reboots the system, and runs initial smoke tests before finalizing the slot commitment.
If you'd like to narrow this down, tell me:
What is your target hardware (e.g., bare-metal microcontroller vs. embedded Linux)?
Which connectivity protocol are you using (Wi-Fi, cellular, BLE)?
I can provide a tailored architecture recommendation or configuration example.
Implementing over-the-air (OTA) firmware updates for a fleet of embedded devices requires a robust, secure, and fault-tolerant architecture. A failure mid-update can "brick" a device, making physical recovery expensive or impossible.
Here is a structured guide on how to design and implement an end-to-end OTA update system for embedded devices.
1. Core Architectural Patterns
Choose a partitioning scheme that prevents the device from becoming inoperable during an interrupted update.
Dual-Bank (A/B) Partitioning (Recommended): The flash memory is divided into two identical application partitions (Bank A and Bank B) plus a small bootloader partition. The active bank runs the current firmware, while the update is downloaded into the inactive bank. Once verified, the bootloader switches the active flag. If the new firmware crashes or fails validation, the bootloader safely rolls back to the previous working bank.
Single-Bank Partitioning: The new image is written directly over the running firmware or stored in an external flash/EEPROM chip before being applied. This is cost-effective for memory-constrained devices but carries a higher risk of bricking if power is lost during the flash-writing process.
A Secure Bootloader: This is the root of trust. The bootloader must be lightweight, immutable (or locked against unauthorized modification), and responsible for verifying the integrity and authenticity of the firmware image before jumping to it.
2. The Implementation Workflow
Image Generation & Signing:
Compile your firmware binary and generate a cryptographic hash (e.g., SHA-256).
Sign the hash using a private key via an asymmetric cryptography algorithm like ECDSA (secp256r1) or RSA-3072 . The device stores only the public key to verify the signature.
Package the binary, version metadata, and signature into a structured update container (using formats like JSON/CBOR headers combined with binary payloads).
Transport & Distribution:
Use lightweight, reliable protocols suited for IoT, such as MQTT or HTTPS , to securely transfer the firmware chunk-by-chunk or as a single stream.
Implement resume capabilities or chunk-level acknowledgment if operating over flaky cellular or Wi-Fi connections.
Secure Download & Verification:
Store the incoming binary in the inactive memory bank or external storage.
Verify the image by checking the cryptographic signature against the embedded public key before altering any boot flags.
Activation & Rollback:
Set the bootloader configuration to boot from the new image on the next reset.
On first boot, the new firmware must run a self-test (verifying peripherals, cloud connectivity, etc.) and send a "commit" signal back to the bootloader. If the commit signal isn't received within a specific timeout (e.g., three boot cycles), the bootloader rolls back to the stable golden image.
3. Essential Security Best Practices
Confidentiality: If your firmware contains proprietary algorithms or keys, encrypt the payload on the server using symmetric encryption (like AES-256) and decrypt it on the device during or prior to flashing.
Anti-Rollback Protection: Store the minimum allowed firmware version number in secure, one-time programmable (OTP) non-volatile memory or protected flash. This prevents an attacker from rolling a device back to an older version with known security vulnerabilities.
Unique Device Credentials: Ensure each device has unique cryptographic identifiers and authentication tokens to prevent unauthorized or rogue devices from pulling firmware updates meant for other hardware revisions.
4. Existing Tools and Frameworks
Building an entire OTA infrastructure from scratch is a massive engineering undertaking. Consider leveraging open-source or managed solutions:
Open-Source Frameworks:
MCUboot : A secure bootloader for 32-bit microcontrollers that supports dual-image swappable slots and integrates heavily with Zephyr and Mynewt.
Mender : An open-source OTA software updater designed specifically for embedded Linux and microcontroller-based IoT devices.
UpdateHub : A robust enterprise-grade solution for managing firmware updates on embedded Linux systems.
Cloud Platforms:
: Offers built-in secure, scalable, and monitored OTA rollout features for fleets.
Zephyr Project
A robust OTA system is best designed as two separate problems:
Device-side update safety — can the device authenticate, install, boot, and recover from a firmware image safely?
Fleet-side orchestration — can you roll that image out gradually, monitor it, and stop/rollback if something goes wrong?
1. Use a bootloader that supports authenticated updates
For MCU-class devices, MCUboot is a strong starting point. It provides a secure-boot/update framework and supports signed images, test boots, rollback, and downgrade protection.
Don't consider the update downloaded merely because the HTTP transfer completed. Verify the complete artifact before allowing the bootloader to select it.
5. Give every device a unique identity
Each device should have a unique cryptographic identity, rather than a shared fleet password.
For large IoT deployments, an OTA job service can provide this orchestration. For example, AWS IoT Jobs lets a backend issue jobs to individual devices and track their progress, while the device downloads and validates the firmware.
You can build an equivalent system yourself if you don't want a cloud-specific dependency.
6. Don't deploy to the entire fleet at once
This is probably the most important fleet-management rule.
OTA success rate
boot failure rate
rollback rate
crash rate
battery consumption
network reconnect rate
application health
device-specific error codes
Then automatically pause if thresholds are exceeded.
A modern fleet-management implementation can even treat deployment as a sequence of waves and roll back affected devices when health metrics deteriorate.
7. Separate firmware version from hardware compatibility
Critically, signing should happen after the firmware has passed your release gates.
You don't want an accidentally signed artifact to become an authorized production image.
9. Design for recovery from day one
Ask what happens if each of these occurs:
Failure
Desired behavior
Power loss during download
Resume download
Power loss during flash write
Old image remains bootable
Network disappears
Retry later
Corrupt firmware
Reject it
Wrong signature
Reject it
Incompatible hardware
Reject it
If you can't answer these before implementation, the OTA design isn't finished.
A concrete stack
If you're using a typical embedded MCU + RTOS, I'd consider:
Device
Zephyr/FreeRTOS/etc.
MCUboot
A/B firmware slots
TLS
Device certificate/private key
Persistent OTA state
Watchdog
Health/self-test
Signed firmware
Backend
HTTPS or MQTT
Object storage for firmware binaries
Device registry
OTA job service
Deployment groups
Telemetry/metrics
Rollout controller
Release infrastructure
CI/CD
Reproducible builds
Automated hardware testing
Production signing service/HSM
Artifact/version database
For example, AWS IoT Jobs provides a ready-made fleet orchestration layer: jobs tell devices what update to perform, devices report progress/status, and firmware can be hosted in S3 with signing and TLS protecting the delivery path.
The key principle
I'd design the system around this invariant:
At every point during an OTA update, the device must have a path back to known-good firmware.
That leads naturally to:
signed image → inactive slot → verify → trial boot → health check → confirm → rollback if necessary → staged fleet rollout.
If you tell me your MCU/SoC (e.g. ESP32, STM32, nRF52/nRF53), RTOS, connectivity (Wi-Fi/LTE/BLE), and approximate fleet size, I can give you a concrete OTA architecture and flash layout for that platform.
Critically, signing should happen after the firmware has passed your release gates.
You don't want an accidentally signed artifact to become an authorized production image.
9. Design for recovery from day one
Ask what happens if each of these occurs:
Failure
Desired behavior
Power loss during download
Resume download
Power loss during flash write
Old image remains bootable
Network disappears
Retry later
Corrupt firmware
Reject it
Wrong signature
Reject it
Incompatible hardware
Reject it
If you can't answer these before implementation, the OTA design isn't finished.
A concrete stack
If you're using a typical embedded MCU + RTOS, I'd consider:
Device
Zephyr/FreeRTOS/etc.
MCUboot
A/B firmware slots
TLS
Device certificate/private key
Persistent OTA state
Watchdog
Health/self-test
Signed firmware
Backend
HTTPS or MQTT
Object storage for firmware binaries
Device registry
OTA job service
Deployment groups
Telemetry/metrics
Rollout controller
Release infrastructure
CI/CD
Reproducible builds
Automated hardware testing
Production signing service/HSM
Artifact/version database
For example, AWS IoT Jobs provides a ready-made fleet orchestration layer: jobs tell devices what update to perform, devices report progress/status, and firmware can be hosted in S3 with signing and TLS protecting the delivery path.
requires a robust, secure, and fault-tolerant architecture spanning the device firmware, secure bootloaders, and cloud infrastructure
Here is a structured blueprint to implement an enterprise-grade OTA update system:
The Dual-Bank (A/B) Partitioning Strategy
Partition your flash memory into two application slots (Bank A and Bank B) alongside a persistent bootloader partition.
While the device runs on Bank A, the active update downloads and writes the new image into Bank B.
Once validation checks pass, the bootloader flips the active pointer to boot from Bank B on the next reset. If Bank B fails to boot, the bootloader automatically rolls back to Bank A.
The Secure Bootloader (First-Stage)
Keep the bootloader code minimal, immutable (or hardware-locked via secure elements/fuse bits), and responsible for integrity checks.
Before jumping to a new firmware image, the bootloader must verify a cryptographic signature (e.g., ECDSA or RSA-2048/4096) attached to the binary using a public key hardcoded or stored in OTP (One-Time Programmable) memory.
Backend & Fleet Management Infrastructure
Artifact Management: Store cryptographically signed firmware binaries securely (e.g., AWS S3 or Google Cloud Storage) behind a CDN.
Device Registry & Campaigns: Maintain a device database tracking current hardware and firmware versions. Use phased rollout campaigns (canary deployments) to push updates to 1% → 10% → 100% of the fleet to catch regressions early.
Communication Protocol: Utilize lightweight, reliable protocols like MQTT (via TLS) or HTTPS for telemetry reporting and update notification payloads.
Robustness & Error Handling
Delta Updates: For bandwidth-constrained cellular or low-power devices, use binary diff algorithms (like bsdiff ) to send only the difference between the running version and the target version, drastically reducing payload size.
Power-Loss Resilience: Ensure atomic state transitions. If power cuts out mid-write, the system must recover cleanly to the previous working partition.
Rollback Triggers: Implement a "health check" confirmation handshake. After booting into a new firmware version, the application must successfully reach out to the cloud or verify local peripherals for a set window (e.g., 5 minutes) before "committing" the update; otherwise, it triggers a forced reboot rollback.
If you'd like, let me know:
What microcontroller/processor family (e.g., ESP32, STM32, Cortex-A Linux) you are using
Your connectivity medium (Wi-Fi, Cellular, BLE, LoRaWAN)
Whether you have a cloud provider preference (AWS, Azure, GCP, or self-hosted)
I can help you dive deeper into specific architectural trade-offs or protocol choices.
A robust OTA system for embedded devices is best designed as a secure update pipeline + a resilient bootloader + fleet rollout controls. The exact implementation depends on whether you're using an MCU, embedded Linux, ESP32, etc., but the architecture is broadly the same.
Your signing infrastructure should keep the private signing key off the build machines that compile ordinary firmware. Ideally, production signing requires a protected signing service/HSM and explicit authorization.
The device contains the corresponding trusted public key, or a certificate chain rooted in a key stored in protected hardware.
AWS's OTA documentation similarly recommends digitally signing firmware so devices can detect modification, and its OTA system supports signature verification on the device.
4. Separate control plane from firmware transfer
Don't send a multi-megabyte firmware binary through your device-management messaging protocol unless there's a good reason.
The device downloads the file in chunks, verifies it, and installs it.
AWS IoT's OTA architecture follows essentially this separation: IoT Jobs handles update notification/control while firmware can be downloaded over HTTP or MQTT.
Device downloads 98%
↓
power disappears
↓
device reboots
The device should simply boot the existing firmware and resume or discard the incomplete update.
Likewise:
new firmware installed
↓
device reboots
↓
power disappears during first boot
The bootloader should still have enough persistent information to determine that the new image wasn't confirmed and revert to the previous known-good image.
This is one of the biggest reasons to use A/B slots and a capable bootloader.
Every device should have a unique identity/credential.
For example:
Device
│
├── device ID
├── private key
└── certificate
Ideally, the private key lives in a secure element or hardware-backed keystore rather than ordinary flash.
The device's cloud credentials should authorize only what that device needs to do. In particular, don't give every device permission to publish arbitrary fleet-management commands.
This is much more useful than simply logging "OTA failed."
A practical technology stack
If you're starting from scratch, a reasonable stack is:
Layer
Example
Bootloader
MCUboot / vendor secure boot
Firmware
C/C++ / Rust
Update transport
HTTPS
Device control
MQTT
Artifact storage
S3/GCS/Azure Blob
Device registry
IoT platform or your database
For example, AWS IoT Jobs is specifically designed to send remote operations—including firmware updates—to individual devices or groups and track their execution.
AWS also provides an embedded OTA library that handles notification, download, cryptographic verification, self-testing, and update status reporting, which can save substantial implementation effort on supported platforms.
The minimum secure design
If you want the shortest version, I would not ship an OTA system without these seven properties:
Signed firmware
Secure boot / authenticated boot
A/B or equivalent atomic update mechanism
Automatic rollback
Anti-downgrade protection
Resumable downloads
Staged fleet rollout with automatic abort
Those turn OTA from "download a new .bin file and reboot" into a system that can survive bad firmware, unreliable networks, power loss, compromised networks, and large-scale deployments.
Device downloads 98%
↓
power disappears
↓
device reboots
The device should simply boot the existing firmware and resume or discard the incomplete update.
Likewise:
new firmware installed
↓
device reboots
↓
power disappears during first boot
The bootloader should still have enough persistent information to determine that the new image wasn't confirmed and revert to the previous known-good image.
This is one of the biggest reasons to use A/B slots and a capable bootloader.
Every device should have a unique identity/credential.
For example:
Device
│
├── device ID
├── private key
└── certificate
Ideally, the private key lives in a secure element or hardware-backed keystore rather than ordinary flash.
The device's cloud credentials should authorize only what that device needs to do. In particular, don't give every device permission to publish arbitrary fleet-management commands.
This is much more useful than simply logging "OTA failed."
A practical technology stack
If you're starting from scratch, a reasonable stack is:
Layer
Example
Bootloader
MCUboot / vendor secure boot
Firmware
C/C++ / Rust
Update transport
HTTPS
Device control
MQTT
Artifact storage
S3/GCS/Azure Blob
Device registry
IoT platform or your database
For example, AWS IoT Jobs is specifically designed to send remote operations—including firmware updates—to individual devices or groups and track their execution.
AWS also provides an embedded OTA library that handles notification, download, cryptographic verification, self-testing, and update status reporting, which can save substantial implementation effort on supported platforms.
The minimum secure design
If you want the shortest version, I would not ship an OTA system without these seven properties: