I have a situation where the ESP.restart does not properly reset the ESP32 NodeMCU-32s, 38 pin board. It does do a restart, but some of the data is corrupted instead of being cleared out when the sketch runs anew. However, if I press the hard EN/RST button, all is fine. Unfortunately this board does not allow use of the ESP.reset function which would clear all data and start a "fresh" run of the sketch.
I tried to use the GPIO2 pin, and others, to force the EN/RST to LOW and it does reset the ESP, B-U-T it will keep the EN/RST LOW and does not go back HIGH on reboot as stated, so it's caught in a restart loop. Also, if GPIO2 is connected to EN/RST the button is nonfunctional as it's being held HIGH by GPIO2.
And in either of these situations, I am unable to upload any modified sketch until I remove the connection from GPIO2 to EN/RST.
Can't get a clean restart via software
Re: Can't get a clean restart via software
I have a few questions...
- I assume by "ESP.restart" function, you mean `esp_restart()`? When you say "ESP.reset" function, which API function exactly are you referring to?
- What is (or what is the nature of) the data that is corrupted?
- What exactly was your approach to connecting an output to EN/RST? What you'd want I think is a GPIO that has a pull-up. You would set it low to do the reset, then on reboot it should go back to high (assuming it doesn't default to low by the ESP).
Re: Can't get a clean restart via software
you don't want to tie a gpio pin directly to EN. When you try to flash the device it wont be able to pull EN low, because your GPIO pin is pulling it high. It would be better to use a NPN or Fet. Have your gpio pin drive the NPN or Fet and then have the output connect to the EN line.
Who is online
Users browsing this forum: No registered users and 97 guests