ESP32S3, deep sleep wakeup and vtaskdelay()

jjones7432
Posts: 13
Joined: Thu Jul 07, 2022 7:22 pm

ESP32S3, deep sleep wakeup and vtaskdelay()

Postby jjones7432 » Wed May 22, 2024 10:11 pm

vtaskdelay() causes the GPIO# assigned in esp_sleep_enable_ext0_wakeup(GPIO#, high) to immediately go high. (Behavior is observed via o-scope.) When the device goes to deep sleep, the device is immediately awaken with the wakeup cause "ext0 wakeup".

Removing the vtaskdelay() function, the GPIO# is remains low as designed. (Behavior is confirmed via o-scope.) This allows the expected "ext0 wakeup" in deep sleep to work properly, which the GPIO# is transitioned to high. (Behavior is confirmed via o-scope.)

Please advise how to make ext0_wakup work properly with vtaskdelay().

Thanks.

ESP_Sprite
Posts: 9764
Joined: Thu Nov 26, 2015 4:08 am

Re: ESP32S3, deep sleep wakeup and vtaskdelay()

Postby ESP_Sprite » Thu May 23, 2024 1:41 am

I doubt that's actually what's happening, given that vTaskDelay has absolutely nothing to do with interrupts, wakeup sources or GPIO. Can you post the code that replicates this?

jjones7432
Posts: 13
Joined: Thu Jul 07, 2022 7:22 pm

Re: ESP32S3, deep sleep wakeup and vtaskdelay()

Postby jjones7432 » Fri Jun 07, 2024 7:15 pm

Thanks for replying.
As you suggest, after more testing, it doesn't appear to be vTaskDelay() associated.
There are two deep sleep wakeups:
1. wakeup_ext0 - This wakeup if from a sensor driving GPIO1 to force a wakeup. This wakeup is behaving as expected, performing some operations, clearing the sensor, resetting the two wakeups and going back to deep_sleep. wakeup_ext0 is not triggered unless we deliberately trigger the sensor.
2. wakeup_timer - Our problem occurs during the processing. This wakeup is triggered when the time period expires and does a lot of wifi operations. We ensure that GPIO1 is not active before the device resets both wakeups and goes to sleep. However, GPIO1 goes active immediately and wakeup_ext0 is triggered. Wakeup_ext0 finishes and does not trigger again, since GPIO1 is not triggered by the sensor.

We only have these "false" triggering during the timer_wakeup and it's only once per timer_wakeup. Both wakeups run through the same GPIO setup.

Not sure what we can post to show the behavior. The o-scope only shows that the GPIO1 was low before going to sleep but went active during sleep for the wakeup_timer.

Any suggestion is appreciated.

Who is online

Users browsing this forum: Bing [Bot] and 172 guests