Implementing Failsafe Mechanism for Firmware Updates on ESP32
Hey guys i am building a custom ESP32-based project (using the ESP32 DevKitC v4 board, with ESP-IDF version 4.4) and want to implement a failsafe mechanism for firmware updates. I've connected GPIO0 to ground via a switch, intending to enter flash mode when the button is pressed and
During the restart process, I've captured the following logs and debug messages:
"Restarting..."
"CPU reset..."
"Boot mode: 3 (FLASH BOOT)"
"Flash booting @ 0x1000"
Despite these logs indicating a flash boot, the board doesn't enter flash mode. I've tried using
Can I force a full boot process, potentially using a direct jump to the hardware reset vector, to enter flash mode when the button is pressed and
ESP.restart() is called. However, ESP.restart() only restarts the app, ignoring the GPIO0 state.During the restart process, I've captured the following logs and debug messages:
"Restarting..."
"CPU reset..."
"Boot mode: 3 (FLASH BOOT)"
"Flash booting @ 0x1000"
Despite these logs indicating a flash boot, the board doesn't enter flash mode. I've tried using
ESP.restart() with the button pressed, but it doesn't work as expected.Can I force a full boot process, potentially using a direct jump to the hardware reset vector, to enter flash mode when the button is pressed and
ESP.restart() is called? Any insights or solutions would be greatly appreciatedSolution
Use the ESP32's RTC_CNTL_SW_SYS_RST register to perform a hardware reset @Daniel kalu , it will check the state of GPIO0 and enter flash mode if it's grounded.