From e816b814a09ec859b292e1112620d9f7b16ab343 Mon Sep 17 00:00:00 2001 From: Thomas Quinot Date: Sat, 7 Mar 2026 20:37:55 +0100 Subject: [PATCH] Additional info on exiting safeboot mode --- .../2026-03-07-esp32-reverse-polarity-recovery.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/_source/_posts/2026-03-07-esp32-reverse-polarity-recovery.md b/_source/_posts/2026-03-07-esp32-reverse-polarity-recovery.md index a8c60b6..7e5d5df 100644 --- a/_source/_posts/2026-03-07-esp32-reverse-polarity-recovery.md +++ b/_source/_posts/2026-03-07-esp32-reverse-polarity-recovery.md @@ -76,7 +76,8 @@ esptool --baud 115200 write-flash 0x0 tasmota32-FR.bin ### 3. Diagnosing the safeboot loop -After reflashing, the device booted but the web interface was unresponsive. Serial console output revealed: +After reflashing, the device booted but the web interface was unresponsive (IP pinged but empty HTTP answer from http://192.168.4.1/). +Serial console output revealed: ``` Project tasmota - Tasmota Version 15.3.0(release-safeboot)-3.3.7(2026-02-19T13:53:54) @@ -85,6 +86,8 @@ WARNING This version does not support persistent settings The erase operations had wiped the OTA selection flag at `0xe000`, causing the bootloader to fall back to the safeboot partition instead of the main firmware. +The safeboot firmware is a special trimmed down version of Tasmota used during OTA upgrades. It specifically does not include the _initial configuration_ web page. + ### 4. Full PlatformIO reflash A complete PlatformIO rebuild and reflash restored all partition components including the OTA flag: @@ -127,3 +130,13 @@ The board made a **full recovery** with no permanent damage: - Partial flash erase operations can corrupt the OTA selection flag, causing unexpected safeboot behaviour - A full PlatformIO reflash is the safest way to restore a complete and correct partition layout - Consider adding reverse polarity protection (Schottky diode or P-channel MOSFET) on power inputs in future designs + +## Alternate exit path from Safeboot + +I could have reset the safeboot flag using: +``` +esptool write-flash 0xe000 ~/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin +``` + +This just rewrites the OTA selection flag directly, telling the bootloader to boot the main firmware partition — without touching anything else. A full reflash would not have been necessary. +From within the safeboot console, there isn't a direct command to flip the flag — that's intentional, since the whole point of safeboot is to force you through the OTA web interface to upload known-good firmware before returning to normal boot.