Page 1 of 1

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

Posted: Sun Jul 15, 2018 7:28 pm
by borai7588
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".

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

Posted: Mon Jul 16, 2018 2:53 am
by WiFive
If the mode is ESP_EXT1_WAKEUP_ALL_LOW then don't you already know that they are ALL LOW?

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

Posted: Mon Jul 16, 2018 8:20 am
by borai7588
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.

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

Posted: Tue Jul 17, 2018 3:08 am
by WiFive
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.

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

Posted: Tue Jul 17, 2018 8:28 am
by borai7588
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