Skip to content

ESP.getResetReason() doesn't allow to distinguish between timer wakeup and physical reset during deep sleep #7067

Closed
@php4fan

Description

@php4fan

Consider these three different situations:

  1. During program execution, the ESP gets reset by shorting RST to ground.
  2. During deep sleep, the ESP gets woken up by externally shorting RST to ground.
  3. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    waiting for feedbackWaiting on additional info. If it's not received, the issue may be closed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions