Page 1 of 1

Changing exception vector to cause RTC WDT reset

Posted: Sat Nov 07, 2020 8:55 am
by damithpavithra
Hello,
I have a problem with ESP32 which randomly throw double exceptions and then stuck. While i was searching for a solution, i encountered this phrase from a github issue. The phrase is "we will modify the DoubleException vector to cause an RTC watchdog reset instead of entering the panic handler. This will provide less information but will be a better safeguard against the device being locked up".
Link to the issue is https://github.com/espressif/esp-idf/issues/3810.
I want to know how to do this changing vector thing.

Thank you

Re: Changing exception vector to cause RTC WDT reset

Posted: Sat Nov 07, 2020 5:54 pm
by lbernstone
Changing the error from a double exception to a wdt timeout is still an error.
Double exception means you have used up so much memory that there isn't enough left to run the panic routine. This is not random. You are not managing your memory properly. This typically means that you are passing around large structures between functions, which causes them to be duplicated over and over. Pass pointers, not strings.

Re: Changing exception vector to cause RTC WDT reset

Posted: Sun Nov 08, 2020 2:38 am
by ESP_Sprite
Either that, or it's a hardware issue; most likely a power supply problem in that case. You don't normally get double exceptions.

Re: Changing exception vector to cause RTC WDT reset

Posted: Sun Nov 08, 2020 4:57 am
by damithpavithra
Does double exception occures only when itis unable to run panic handler?(except hardware issues).
You say it is due to running out of memory. So if that the case, ,running memory monitoring functions like stackhighwatermark, freeheap in each task should show the memory overflow when it happened, right?.
I use arduinoJson library in arduino ide. It uses dynamic memory allocation for json strings. Could that be the problem?. But documentation says it take care of the dynamic allocation.
.
In my code i pass struct pointers as you said. Not the whole struct.
Finally, if i am unable to find a way around this, is it ok to use external watchdog ic to hard reset the esp32?

Thank you.