Insight
OTA without bricking fleets: A/B slots, health checks, and rollback
A software-first checklist for field updates on embedded Linux and MCU products — signed images, boot health, and fail-closed rollback before you scale a fleet.
- Software
- OTA
- Embedded Linux
- Firmware
Framing note: Operational patterns for over-the-air updates on gateway and device fleets. Illustrative engineering notes for TriXCore — not a customer deployment report.
Shipping v1 is easy. Shipping v1.1 to a thousand devices that must keep working is a different product. Most “OTA bugs” are process bugs: unsigned payloads, single-bank flash, or success defined as “download finished.”
Define success as healthy boot, not file copy
An update is successful only when:
- The new slot is cryptographically verified (signature + expected key)
- The bootloader marks the slot active after a health check, not after flash write
- The device reaches a known-good userspace state within a watchdog window
- Telemetry (or a local marker) confirms the new version string
If any gate fails, boot the previous slot. Fail closed.
Prefer A/B (or equivalent) over in-place mutation
On embedded Linux gateways and many MCU platforms with dual banks:
- Keep a confirmed-good slot always bootable.
- Write only the inactive slot; never erase the running image mid-update.
- Use a boot counter / “tryboot” style mechanism so a crash-loop rolls back automatically.
- Separate bootloader updates from rootfs/app updates — chain them deliberately.
Single-bank “download then overwrite” schemes need an exceptional recovery story (hardware strap, local UART, return-to-base). Budget that honestly or do not ship them to remote sites.
Payload hygiene
- Sign every artifact; verify on device with pinned keys (not “TLS to a CDN is enough”).
- Version metadata: semantic or monotonic build IDs, compatibility range for hardware revisions, minimum bootloader version.
- Delta vs full images: deltas save bandwidth; full images save you when deltas fail. Support both or document the recovery path.
- Rate-limit fleets: canary cohort → regional wave → full. A bad image at 100% is an outage with logistics.
Health checks worth automating
Pick checks that match the product, then make them boring and mandatory:
- Process or systemd unit set required for the device’s job
- Network attach or backhaul handshake within N seconds
- Critical sensor / radio self-test if the device is useless without them
- Free storage and writable state partitions
A green LED after flash is not a health check.
Ops surface area
OTA is a product feature. Give yourself:
- Per-device version inventory
- Abort / pause controls mid-wave
- Clear mapping from image hash → git revision → changelog
- A documented brick recovery path for the 0.1% that still need it
If you cannot answer “what rolls back, who signed it, and how do we stop the wave,” you are not ready to press update on the fleet.