What is Over-the-air update?

Updating a device's firmware via wireless communication, often using two flash slots so the device can still boot if an update fails.

Field: Embedded Systems & Firmware

Japanese name: OTA更新

The update flow

The device receives new firmware over a wireless link and writes it to an area separate from the one it is running from. It then checks that the data is intact (a hash) and comes from the right author (a signature). If both pass, it tells the bootloader to start from the new image next time and reboots. The update is confirmed only after the new firmware has been seen to run correctly.

The two-slot scheme

Flash memory is commonly split into two slots, A and B, and the new image is written to the slot that is not running. If power is lost while writing, the running slot is untouched. If the new slot fails to boot, the bootloader switches back to the old one (rollback). The drawback is needing almost twice the flash, so small microcontrollers combine this with delta updates, which send only the changed parts, or with compression.

What safety requires

If images could be written without checking a signature, an attacker could install their own program, so the bootloader verifies the signature with a public key it holds. To stop a return to an old version with known weaknesses, the device records the version number and refuses older ones. The link is encrypted, and battery-powered devices write only when the charge is sufficient. Cars must comply with the United Nations regulation on software update management (UN R156).

Try it: questions about Over-the-air update

In devices updated over the air (OTA), why is flash divided into two firmware slots (A and B)?

  1. ATo run the same program in both slots simultaneously for double speed
  2. BTo use one slot for storing the user's photos
  3. CSo new firmware can be written to the other slot, and if anything fails the device can still boot from the original slot
Show answer and explanation

Answer: C. So new firmware can be written to the other slot, and if anything fails the device can still boot from the original slot

Writing directly over the running firmware leaves the device unbootable if power or communication is lost midway. With two slots, the new firmware is written to the unused slot, verified, and only then is the boot slot switched. If the new version fails to boot, the bootloader reverts to the original slot. It needs twice the flash, but updates become safe.

FAQ

What happens if power is lost during an update?

With two slots, the slot that was running is still there, so the next boot uses the old firmware and the update can be retried. A scheme that overwrites the running area directly risks a device that can no longer boot.

Can the bootloader also be updated over the air?

Some designs allow it, but a failed bootloader write leaves no way to recover, so it is either never updated or protected by a careful scheme such as keeping a backup copy.

Books on Embedded Systems & Firmware Ad

Learn hands-on: parts and kits

Building real circuits is a good way to check what you learned in the questions.

As an Amazon Associate I earn from qualifying purchases.

This page was drafted with AI and fact-checked by a separate AI review before publication. Our Editorial policy explains how we write and check content. If you spot an error, please tell us on our Contact page.

Back to the glossary