Always get 0 pins as ext1 wakeup source from deep sleep.

borai7588
Posts: 4
Joined: Sun Jul 15, 2018 7:07 pm

Always get 0 pins as ext1 wakeup source from deep sleep.

Postby borai7588 » Sun Jul 15, 2018 7:28 pm

Hello,

I am configuring 2 pins (GPIO32,33) as ext1 wakeup source from deep sleep with mode = ALL_LOW (i.e wakeup when both pins are LOW), the chip wakes up as expected when the configured pins are both LOW, but I have a problem I always get 0 as a return from esp_ext1_wakeup_status() trying to know which one caused the wakeup or even if both did.

I know that this function returns 0 when the wakeup reason is any thing other than DeepSleep , but I always have the wakeup cause as ESP_SLEEP_WAKEUP_EXT1 as returned by this function esp_sleep_get_wakeup_cause and DEEPSLEEP_RESET as return from this function rtc_get_reset_reason(0)

I am setting the "Delay for deep sleep stub" option = 2000, I even increased it to 5000

I don't have this problem when setting wakeup mode to "ANY_HIGH".
Last edited by borai7588 on Mon Jul 16, 2018 8:27 am, edited 1 time in total.

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

Re: Always get 0 from as ext1 wakeup source from deep sleep.

Postby WiFive » Mon Jul 16, 2018 2:53 am

If the mode is ESP_EXT1_WAKEUP_ALL_LOW then don't you already know that they are ALL LOW?

borai7588
Posts: 4
Joined: Sun Jul 15, 2018 7:07 pm

Re: Always get 0 from as ext1 wakeup source from deep sleep.

Postby borai7588 » Mon Jul 16, 2018 8:20 am

WiFive wrote:If the mode is ESP_EXT1_WAKEUP_ALL_LOW then don't you already know that they are ALL LOW?
Well, I need to Know which pin cased the wakeup when going LOW. I know I can do it the other way around using "ANY_HIGH" but that's the way the hardware is setup... and esp32 documentation does not mention that it is not possible.

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

Re: Always get 0 pins as ext1 wakeup source from deep sleep.

Postby WiFive » Tue Jul 17, 2018 3:08 am

Since they all have to be low to wake up do you mean the last pin to go low? I don't think that would be stored in any registers.

borai7588
Posts: 4
Joined: Sun Jul 15, 2018 7:07 pm

Re: Always get 0 pins as ext1 wakeup source from deep sleep.

Postby borai7588 » Tue Jul 17, 2018 8:28 am

WiFive wrote:Since they all have to be low to wake up do you mean the last pin to go low? I don't think that would be stored in any registers.
Ok, well it sounds logical what you say, but I find it strange that this is not mentioned in the description of API esp_sleep_get_ext1_wakeup_status

it mentions that it will return 0 only in case the wakeup source is not DeepSleep. or at least that what I understood.

Thanks

Who is online

Users browsing this forum: No registered users and 20 guests