-
Notifications
You must be signed in to change notification settings - Fork 7.6k
ESP.restart() kills only loop thread instead of restarting the board? #1270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I think you are not doing your xtasks properly and are getting endless loops that the watchdog kills. Have a look at https://desire.giesecke.tk/index.php/2018/02/07/using-the-multitasking-capabilities-of-the-esp32-freertos/ (@beegee-tokyo) |
These watchdog message appear the first time after calling ESP. restart(). The other threads are still looping as expected afterwards, as I can see by their debug output. The only blocked thread I can see is the loop thread and I assume that is got blocked in ESP. restart() and is therefore not reaching the delay() statement. What if my assumption is correct? Would ESP. reset() be a better option? |
There is no ESP.reset in ESP32. I think it is just an alias for restart. I use the watchdog timer to do a hard restart like this:
It sets the wdt to 1 second, adds the current process and then starts an infinite loop. |
Is my understanding of this example correct: Interesting idea to commit suicide... |
@lbernstone what headers are you including to use the hard reset
thanks :p |
These includes should help:
|
I tried and it works like a charm ! Thank you ! |
I encounter this error please help me >>>stack>>> ctx: cont last failed alloc call: 4020ADF1(1052) ets Jan 8 2013,rst cause:2, boot mode:(1,6) ets Jan 8 2013,rst cause:4, boot mode:(1,6) wdt reset |
Thank you very much! |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This stale issue has been automatically closed. Thank you for your contributions. |
Hardware:
Board: ESP32 DEV Board (DoIt)
Core Installation/update date: Feb 15 2018
IDE name: eclipse
Flash Frequency: 40Mhz
Upload Speed: 115200
Description:
Hi, I am having periodically issues with my wifi net. Sometimes my ESP32 looses it wifi connection:
E (562420949) wifi: esp_wifi_disconnect 847 wifi not start
I try a wifi connect in this case, if this doesn't help I intended to restart my ESP32, see loop () below.
My console log shows exactly one line
Restart after XXX
but the system did not restart.
Instead I get couple of lines like:
Is it possible that ESP.restart() is blocked by something (e.g. broken wifi connection) and that this just stops the loop() thread instead of the hole ESP32?
In some demo sketches I saw a delay(xxx) after the ESP.restart(). I didn't saw any reason for this and didn't include it. Am I missing something?
Best Regards
Michael
Sketch:
...leaving out some additional code (e.g. MQTT handling stuff)
The text was updated successfully, but these errors were encountered: