The happy path is the easy part

Downloading an image and rebooting into it is straightforward. The hard part is what happens when the power drops at 80 percent, the image is corrupt, or the new firmware boots but cannot connect to the network.

If those cases need a technician, the product does not have an update strategy. It has a release ritual.

Rule of thumb

An update is done when a bad image can recover without anyone touching the device.

List the failure points

Walk through the update and write down every place it can stop. Be pessimistic.

  • Power loss during download, verification or copy.
  • Network failure after the manifest is accepted.
  • A corrupt or unsigned image.
  • Boot succeeds but the application crashes on first start.
  • Rollback image is missing or older than the recovery policy allows.

Each failure point needs a defined behavior. "It should not happen" is not a behavior.

Slots and signatures

Two firmware slots are the standard answer for a reason. One slot runs, the other receives the update. A signed manifest binds version, hash and target hardware so a wrong image cannot be flashed by accident.

Decide how many rollback versions you keep. One is often enough. More than one costs flash and adds test complexity.

Rollback must be automatic

A watchdog that marks the image good only after the application reaches a defined healthy state is more reliable than a manual flag. If the application never gets there, the bootloader returns to the previous slot on the next power cycle.

Define "healthy" precisely. Booting is not healthy. Connecting and completing one application loop is a better signal.

Test by cutting power

Build a hardware-in-the-loop rig that can cut power at each failure point. Run it on every release candidate. It sounds excessive until the first time it catches a regression before a field rollout.

Also test the factory path. A device that cannot be recovered on the bench will slow down production eventually.

Release gate

Before a release is allowed out, you should be able to answer three questions. Can a bad image be rejected? Can a power loss be survived? Can a bricked device be recovered without a site visit?

If any answer is uncertain, the release is not ready. This is a product decision, not just a firmware detail.

This note describes a method, not a product recommendation. If you want help reviewing your update path, send us a short description.