Deep Sleep Stub function? Sleep mode optimization TG0WDT_SYS_RESET
Posted: Fri Apr 17, 2020 2:56 am
Anyone able to get the deep sleep wake stubs working for Arduino?
https://docs.espressif.com/projects/esp ... -stub.html
I am trying to reduce the wake up time of ESP32. Right now with no code and setting up sleep I am at 200ms. I would like to wake up from sleep run simple code and go back to sleep without going through a full reboot. I think I am getting a WDT reset after the RTC_IRAM_ATTR function for some reason. Any help would be great! Thanks
I have this function:
void RTC_IRAM_ATTR esp_wake_deep_sleep(void) {
esp_default_wake_deep_sleep();
esp_set_deep_sleep_wake_stub(&esp_wake_deep_sleep);
esp_sleep_enable_timer_wakeup(5 * 1000000);
// esp_task_wdt_reset();
esp_deep_sleep_start();
}
end of my setup code:
esp_set_deep_sleep_wake_stub(&esp_wake_deep_sleep);
esp_sleep_enable_timer_wakeup(TIME_TO_SLEEP * uS_TO_S_FACTOR);
esp_deep_sleep_start();
Output:
rst:0x5 (DEEPSLEEP_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
ets Jun 8 2016 00:22:57
rst:0x7 (TG0WDT_SYS_RESET),boot:0x13 (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:9720
ho 0 tail 12 room 4
load:0x40080400,len:6352
entry 0x400806b8
https://docs.espressif.com/projects/esp ... -stub.html
I am trying to reduce the wake up time of ESP32. Right now with no code and setting up sleep I am at 200ms. I would like to wake up from sleep run simple code and go back to sleep without going through a full reboot. I think I am getting a WDT reset after the RTC_IRAM_ATTR function for some reason. Any help would be great! Thanks
I have this function:
void RTC_IRAM_ATTR esp_wake_deep_sleep(void) {
esp_default_wake_deep_sleep();
esp_set_deep_sleep_wake_stub(&esp_wake_deep_sleep);
esp_sleep_enable_timer_wakeup(5 * 1000000);
// esp_task_wdt_reset();
esp_deep_sleep_start();
}
end of my setup code:
esp_set_deep_sleep_wake_stub(&esp_wake_deep_sleep);
esp_sleep_enable_timer_wakeup(TIME_TO_SLEEP * uS_TO_S_FACTOR);
esp_deep_sleep_start();
Output:
rst:0x5 (DEEPSLEEP_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
ets Jun 8 2016 00:22:57
rst:0x7 (TG0WDT_SYS_RESET),boot:0x13 (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:9720
ho 0 tail 12 room 4
load:0x40080400,len:6352
entry 0x400806b8