ESP32 OTA Rollback Does Not Revert
DodaTech
Updated 2026-06-26
1 min read
In this tutorial, you'll learn about ESP32 OTA Rollback Does Not Revert. We cover key concepts, practical examples, and best practices.
The Problem
ESP32 firmware update fails but does not roll back to the previous working version.
Quick Fix
Wrong
// No rollback support configured
Corrupt firmware stays active. ESP32 does not boot correctly.
Right
esp_ota_set_boot_partition(factory_partition);
esp_ota_mark_app_invalidated();
esp_restart();
// On next boot, ESP-IDF detects invalid app and rolls back
Previous firmware loaded. System recovered from bad update.
Prevention
Enable CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE in menuconfig. Mark app valid after successful boot. Test OTA with development board first. Use factory partition as fallback. Monitor boot count for automatic rollback.
DodaTech engineers apply these same patterns across Doda Browser, DodaZIP, and Durga Antivirus Pro for production IoT reliability.
FAQ
Built by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro