Page 1 of 1

Problem with esp_reset_reason()

Posted: Sat Feb 08, 2025 3:40 pm
by Largomatic
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.......

Re: Problem with esp_reset_reason()

Posted: Sun Feb 09, 2025 2:37 pm
by ahsrabrifat
Try to call esp_reset_reason() very early in setup(), before initializing peripherals or WiFi. Some peripherals may interfere with the stored reset reason.

Re: Problem with esp_reset_reason()

Posted: Mon Feb 10, 2025 6:41 am
by Largomatic
Thank you very much, it helped.

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