Page 1 of 1

deep sleep and light sleep

Posted: Tue Mar 10, 2020 9:03 pm
by bgfortran
Hi all,
curruntly a am creating project which there is a functuanality for batery safe. I have a following function:

Code: Select all

void SleepMode::goToDeepSleep() {
    Log.notice(F("Going to sleep..." CR));
   esp_bluedroid_disable();
   esp_bt_controller_disable();
   esp_wifi_stop();
    // Configure the timer to wake us up!
   esp_sleep_enable_timer_wakeup(DEEP_SLEEP_TIME * 60L * 1000000L);
   //esp_light_sleep_start();
   esp_deep_sleep_start();
}
I am wandering why i use esp_deep_sleep_start() my program restart from setup() method but with esp_light_sleep_start() the program continues from loop()?

Also i have a following message with esp_deep_sleep_start()

Code: Select all

rst:0x5 (DEEPSLEEP_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:2
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:6364
entry 0x400806b8
Is it a some problem?

Re: deep sleep and light sleep

Posted: Wed Mar 11, 2020 3:39 am
by WiFive
Deep sleep is shutdown/restart but light sleep is suspend/resume.