Connected IoT products may operate in the field for:
- years,
- millions of device-hours.
During that lifetime, manufacturers need to:
- fix bugs,
- patch vulnerabilities,
- add features,
- improve performance.
Over-the-Air firmware updates make this possible without physically accessing every device.
But an OTA update system must solve two problems:
How do we deliver the new firmware?
and
How do we make sure the new firmware is safe and authentic?
Fundamentals and Technology Overview
What Is OTA?
OTA means:
Over-the-Air update.
Firmware is delivered through a wireless or network connection.
Common transports include:
- Wi-Fi,
- cellular,
- Bluetooth,
- Ethernet through a gateway.
OTA Architecture
A typical architecture includes:
- update server,
- device communication stack,
- download manager,
- secure storage,
- bootloader,
- rollback logic.
Update Server
The server stores:
- firmware binaries,
- metadata,
- version information,
- signatures.
Device Manifest
A manifest may contain:
- version,
- hardware compatibility,
- image size,
- cryptographic hash,
- signature.
Download
The device downloads the candidate firmware.
The image may be stored in:
- external Flash,
- inactive internal bank.
Firmware Authentication
Before execution, verify:
- digital signature,
- hash,
- trusted signer.
Secure Boot
Secure boot ensures the device executes only authenticated firmware after reset.
OTA security should therefore be integrated with:
- boot-time verification.
Encryption
Firmware may also be encrypted to protect:
- proprietary algorithms,
- model weights.
Authentication is mandatory for trust.
Encryption is optional depending on confidentiality requirements.
A/B Update
An A/B architecture keeps two firmware slots.
Slot A
Current firmware.
Slot B
New candidate.
The device boots the new image only after successful installation.
Why A/B Is Safer
If the new firmware fails:
- boot,
- health check
the system can return to the previous image.
ST's secure update guidance recommends dual-slot architectures for safer OTA because they support rollback.
Single-Slot Update
Single-slot designs overwrite the current image.
Advantages:
- less Flash.
Disadvantage:
- higher risk of bricking if power fails.
Power-Loss Resilience
OTA systems should survive a reset during:
- download,
- programming,
- metadata update.
Atomic Metadata
Boot-selection metadata should be updated atomically so a partial write cannot leave the device in an undefined state.
Connectivity and System Integration
Rollback
Rollback means:
- return to previous known-good firmware
if the new image fails.
Anti-Rollback
Anti-rollback prevents an attacker from intentionally installing an old vulnerable firmware.
These are different concepts.
Rollback
Reliability feature.
Anti-Rollback
Security feature.
Version Counters
NXP's i.MX RT700 secure update mechanism uses secure version counters in OTP to prevent downgrade attacks.
Signed Containers
NXP uses signed/encrypted firmware containers for secure field updates.
These can include:
- firmware,
- version metadata,
- update commands.
Secure Element
A secure element can protect the public key or credential used to verify the firmware signature.
Microchip demonstrates secure download firmware updates using the ATECC608A.
MCU With Integrated Wireless
A wireless MCU can:
- download,
- verify,
- install
the update itself.
Host MCU + Wireless Companion
A separate radio module can download firmware for a host MCU.
This can simplify radio certification and platform reuse.
Delta Update
A delta update transmits only the differences between firmware versions.
This reduces:
- bandwidth,
- update time.
It adds:
- patching complexity,
- temporary storage needs.
Full Image Update
A full update is simpler to verify and recover but transfers more data.
Update Scheduling
Devices may update only when:
- idle,
- charging,
- connected to reliable network.
Fleet Rollout
Do not update every device simultaneously.
Use staged rollout:
- test group,
- small percentage,
- larger percentage,
- full fleet.
Health Check
After booting new firmware, verify:
- application starts,
- critical peripherals work,
- network returns.
Only then mark the image as permanent.
Boot Count
A bootloader may track failed boots.
After a threshold, it automatically returns to the previous image.
Implementation, Testing, and Optimization
Secure Update vs Secure Install
Secure install protects firmware during manufacturing.
Secure OTA protects firmware during field lifecycle.
Both need:
- authenticity,
- integrity.
TrustZone
TrustZone can isolate:
- update verification,
- key management
from normal application software.
IoT Regulation
Long-lived connected devices increasingly need a maintainable update mechanism for vulnerability remediation.
Bandwidth
Large firmware images can be expensive over:
- cellular,
- LoRa-class links.
Choose update architecture based on network capacity.
Battery Impact
Downloading and writing Flash consumes significant energy.
Battery devices may update only when:
- sufficient charge remains.
Flash Endurance
Repeated updates cause Flash erase/program cycles.
Plan wear appropriately.
Secure Recovery
If both application slots fail, the device should have a minimal recovery image protected by the hardware root of trust.
Common Mistake: Unsigned Firmware
TLS protects transport but does not prove the stored firmware image is approved.
Always authenticate the image itself.
Common Mistake: No Rollback
A bad release can disable the fleet.
Common Mistake: No Anti-Rollback
Attackers can reinstall older vulnerable signed firmware.
Common Mistake: No Power-Failure Test
Many update bugs appear only when power is removed mid-write.
OTA Workflow
- Check update metadata.
- Verify hardware compatibility.
- Download image.
- Verify hash/signature.
- Write inactive slot.
- Set candidate boot flag.
- Reboot.
- Run health check.
- Commit or roll back.
- Record update status.
Conclusion
OTA updates are not simply file downloads.
A production-grade OTA system combines:
- secure transport,
- signed firmware,
- secure boot,
- A/B storage,
- rollback,
- anti-rollback,
- fleet management.
The key principle is:
the device must remain recoverable even if the update, power supply or network fails.