Problem with esp_reset_reason()

Largomatic
Posts: 2
Joined: Sat Feb 08, 2025 7:07 am

Problem with esp_reset_reason()

Postby Largomatic » Sat Feb 08, 2025 3:40 pm

Hi, i try to get esp_reset_reason(void) on ESP32S3.

the problem is when I run the command esp_restart() or ESP.restart(), I always get response "POWERON_RESET" instead of "SW_RESET". No matter it's a real board or a Wokwi simulator

I try attach #include "esp_system.h", but this didn't change anything.

Any suggestion.......

ahsrabrifat
Posts: 56
Joined: Sat Jan 18, 2025 2:31 pm

Re: Problem with esp_reset_reason()

Postby ahsrabrifat » Sun Feb 09, 2025 2:37 pm

Try to call esp_reset_reason() very early in setup(), before initializing peripherals or WiFi. Some peripherals may interfere with the stored reset reason.

Largomatic
Posts: 2
Joined: Sat Feb 08, 2025 7:07 am

Re: Problem with esp_reset_reason()

Postby Largomatic » Mon Feb 10, 2025 6:41 am

Thank you very much, it helped.

Wokwi still doesn't work, but that doesn't matter to me.

Who is online

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