hn.today

We broke an Over-The-Air update on the ESP32 on purpose

groundrun.io4 points0 comments
Screenshot of We broke an Over-The-Air update on the ESP32 on purpose

Over-The-Air updates on an ESP32-C6 were stress-tested by intentionally interrupting firmware downloads to validate that a device never bricks and can recover to the target version automatically. The experiment used the ESP-IDF dual-partition OTA pattern (ota_0/ota_1) so updates download to the inactive slot and the bootloader only switches when a new image confirms itself; a deliberate second reset after a successful update verified no lingering PENDING_VERIFY state. Three interruption methods were exercised mid-download - software-triggered reboot, hardware reset-pin pulse, and complete power cut - while measuring recovery behavior and timing, and trials included both rollback enabled and disabled settings.

Every one of eighteen interruption trials completed successfully: the device booted back to the original firmware, rejoined the network, retried the OTA, and finished on the new version with no manual intervention, relying on ESP-IDF’s rollback to prevent bricking. Recovery time clustered by interruption type more than by rollback setting: hard power cuts recovered fastest (~99.6s rollback enabled, 93.5s disabled), software resets and reset-pin toggles took ~155-166s. Varying when the cut occurred lengthened recovery roughly in proportion to how much of the download had to be redone (baseline 89s; recovery at 25/50/75% produced ~157.5s, 183.2s, 223.2s). The results demonstrate that automated, worst-case OTA interruption testing is essential and that ESP-IDF’s partition/rollback scheme reliably protects devices in these scenarios.

Read on groundrun.io0 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Security

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.