esp_wake_deep_sleep not running?
Posted: Mon Apr 15, 2019 10:25 pm
Hi,
I have an application with a esp_wake_deep_sleep in a file called rtc_wake_stub.c. this is the sugnature of the stub: 'void esp_wake_deep_sleep(void);'
It seems like while I can enter and wake up from deep sleep correctly, I cannot seem to get the stub to run. I have a while loop which just blinks the LED to test, and this is not run. MY stub does start by calling 'esp_default_wake_deep_sleep();' asap.
Also, calls to ets_printf do not cause anything to be printed to console.
I am entering deep sleep like this:
What else do I need to do to get this stub to run? Surely I've messed up somewhere, but I can't find anything in the docs that I've missed to make this work
I have an application with a esp_wake_deep_sleep in a file called rtc_wake_stub.c. this is the sugnature of the stub: 'void esp_wake_deep_sleep(void);'
It seems like while I can enter and wake up from deep sleep correctly, I cannot seem to get the stub to run. I have a while loop which just blinks the LED to test, and this is not run. MY stub does start by calling 'esp_default_wake_deep_sleep();' asap.
Also, calls to ets_printf do not cause anything to be printed to console.
I am entering deep sleep like this:
Code: Select all
void Power_DeepSleep(const enum SLEEP_LEVEL sleep_level)
{
// Power down radios
esp_bluedroid_disable();
esp_bt_controller_disable();
esp_wifi_stop();
// Sleep the board
ToggleVescPower(false);
ToggleSleepBoard(true);
ToggleCanEnable(false);
// We always want to wakeup for the button (falling edge)
rtc_gpio_pullup_en(POWER_BUTTON_GPIO);
esp_sleep_enable_ext0_wakeup(POWER_BUTTON_GPIO, 0);
if (sleep_level == SLEEP_LEVEL_LIGHT)
{
// For light sleep, we need to wake up for...
// USB DCP
//esp_sleep_enable_ext1_wakeup(DCP_UFP_GPIO, ESP_EXT1_WAKEUP_ALL_LOW);
// Timer
esp_sleep_enable_timer_wakeup(DEEP_SLEEP_TIME);
}
// If there is not a USB DCP device plugged in, or we are deep sleeping, turn off the buck
if (!DcpUfpIsConnected() || (sleep_level == SLEEP_LEVEL_DEEP))
{
printf("Buck disable for sleep\r\n");
ToggleBuck(false);
}
// Keep power GPIO state held
rtc_gpio_hold_en(BUCK_EN_GPIO);
rtc_gpio_hold_en(VESC_POWER_EN_GPIO);
rtc_gpio_hold_en(SLEEP_GPIO);
rtc_gpio_hold_en(CAN_EN_GPIO);
// Enter deep sleep, we don't return from this
esp_deep_sleep_start();
}