Closed
Description
Consider these three different situations:
- During program execution, the ESP gets reset by shorting RST to ground.
- During deep sleep, the ESP gets woken up by externally shorting RST to ground.
- The ESP has GPIO16 connected to RST and it gets up from deep sleep when the built-in timer goes off.
Expected:
ESP.getResetReason() should return different values in these situations, allowing you to distinguish 2 from 3 as well as from 1.
Observed:
ESP.getResetReason() returns "External System" in case 1, but it returns "Deep-Sleep Wake" both in cases 2 and 3, so they are not distinguishable.
I know that the way automatic wakeup works is that GPIO16 goes low, hence driving RST to ground exactly as you would do by physically shorting it to ground before the timer goes off, but there are plenty of ways you can internally accomplish the result of getting 3 different values for the 3 different sistuations. There is a built-in RTC that you are talking to after all, which keeps running during deep sleep.