ESP.restart() does't trigger complete boot after Update()

marchingband
Posts: 46
Joined: Wed Mar 13, 2019 9:20 pm

ESP.restart() does't trigger complete boot after Update()

Postby marchingband » Mon Jan 03, 2022 1:34 am

I have some code that runs Update() from data stored in eMMC. The process works great, but the call to ESP.Restart() doesn't cause a successful boot. Resetting the ESP32 after this, the new firmware boots perfectly.

  1.     if(Update.end()){
  2.         if(Update.isFinished()){
  3.             sdmmc_host_deinit();
  4.             delay(1000);
  5.             ESP.restart();
  6.         } else {
  7.             log_e("Update.isFinished() : false");
  8.         }
  9.     } else {
  10.         log_e("Update.end() : false");
  11.     }

Verbose log:

rst:0xc (SW_CPU_RESET),boot:0x3f (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0018,len:4
load:0x3fff001c,len:1216
ho 0 tail 12 room 4
load:0x40078000,len:10944
load:0x40080400,len:6388
entry 0x400806b4


Then the boot process freezes at "entry 0x400806b4".
Any idea how I can get the boot process to complete, without having to manually restart using the reset button or cycling the power?
Thanks!

marchingband
Posts: 46
Joined: Wed Mar 13, 2019 9:20 pm

Re: ESP.restart() does't trigger complete boot after Update()

Postby marchingband » Tue Jan 04, 2022 2:38 am

Does anyone have any ideas how I could debug this event better?

marchingband
Posts: 46
Joined: Wed Mar 13, 2019 9:20 pm

Re: ESP.restart() does't trigger complete boot after Update()

Postby marchingband » Tue Jan 04, 2022 9:58 pm

I am using an ESP32 WROVER-B module on a custom PCB.
Does this look like it could be a power issue?

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: ESP.restart() does't trigger complete boot after Update()

Postby WiFive » Tue Jan 04, 2022 10:37 pm

Code: Select all

boot:0x3f (SPI_FAST_FLASH_BOOT)
Do you have flash voltage set to 3.3v in efuse?

marchingband
Posts: 46
Joined: Wed Mar 13, 2019 9:20 pm

Re: ESP.restart() does't trigger complete boot after Update()

Postby marchingband » Wed Jan 05, 2022 1:04 am

yes i burned the fuses for 3.3v flash.
I have the 16MB flash version of the WROVER-B.

ullixesp
Posts: 83
Joined: Wed Oct 16, 2019 9:34 am
Location: Germany

Re: ESP.restart() does't trigger complete boot after Update()

Postby ullixesp » Wed Jan 05, 2022 9:07 am

I had my own share of confusion and problems around the ESP.restart() and ended up using a watchdog timer forced reset to trigger a full ESP32 reset. Solved all my problems.

Code: Select all

// needed for the forced reset
#include <esp_int_wdt.h>
#include <esp_task_wdt.h>

void forcedReset(){
// use the watchdog timer to do a hard restart
// It sets the wdt to 1 second, adds the current process and then starts an
// infinite loop.
  esp_task_wdt_init(1, true);
  esp_task_wdt_add(NULL);
  while(true);  // wait for watchdog timer to be triggered
}

marchingband
Posts: 46
Joined: Wed Mar 13, 2019 9:20 pm

Re: ESP.restart() does't trigger complete boot after Update()

Postby marchingband » Sat Jan 08, 2022 1:03 am

Amazing, thanks so much @ullixesp, I will try this out!

Who is online

Users browsing this forum: No registered users and 49 guests