Pico hangs, is non responsive after machine.soft_reset() #18938
Replies: 3 comments 8 replies
-
|
I would suggest using If that does not help, please share (a link to) your minimal code sample. |
Beta Was this translation helpful? Give feedback.
-
|
Please try to replicate the situation without using Thonny. Use simple terminal emulators like mpremote or Putty or screen instead. Thonny is not good in fail situations. |
Beta Was this translation helpful? Give feedback.
-
|
Another interesting data point ... I added another py file that is just: something.py boot.py main.py When I run that with Thonny, the Pico does a soft reset, runs boot.py, but does not run main.py: main.py was not called, I suspect because it was not at the root of the calling tree. Moving on, I wrote a more elaborate main.py that adds a line to config if it exists and does its own machine.soft_reset() if config had less than 10 lines (watchdog). If config did not exist, it is created and I import the something.py file which immediately does a soft_reset() which does the reset as expected. It seems that machine.soft_reset() results in main.py running only when main.py had been at the root of the calling tree. This does not explain (to me at least) why my minimal code sample (above) "ruins" the Pico to the point of having to nuke it. I'm not trying machine.reset() as I'm tired of nuking... |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
First - this is a Pico 2W, so I don't know that the RP2040 applies, but its all that I found for the Pico.
My application is configuring the WiFi, I prompt the user to select an SSID and provide the password, I then write the pair to a config file and reboot (machine.soft_reset())- expecting the Pico to restart, read the config file and attach to the WiFi. However, the Pico just seems to "brick", no response, no AP wifi as if to get another ssd/pwd, and Thonny does not see it. I have unplugged the Pico for a long time (10+ minutes) and back in, no difference. I've had to nuke it, reinstall MP (latest version), and then it seems to be happy again. It would seem my method (get new said/pw and reboot into that) is viable, any insights to what is happening?
Anticipating .... I use Thonny because it is simple and after hopping from project to project in my career, I found myself using simple (vi) as that is always available.
Beta Was this translation helpful? Give feedback.
All reactions