Hello,
I'm using a Pico running the latest nightly MicroPython release. I am also having this problem with the latest stable release.
The board freezes randomly from time to time. Sometimes when I upload a file it stalls and I eventually get a timeout. Other times when code is running, the code continues running normally but I can't do anything else like stopping the code, resetting, etc. It's as if the board lost communication with the PC (Windows 10).
The only option when this happens is to unplug the USB connection and start again. This happens 1/3 of the times I try to upload a file or run code from the IDE. I'm using Vusual Studio Code with the Pico-Go module, all updated.
Is anyone experiencing the same? Thank you!
Pico freezes very regularly
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: Pico freezes very regularly
I have done a lot of work with several Picos and never seen this. However I use Linux with rshell or mpremote. I suggest giving the official mpremote a try: upload a few files and see if it falls over. This would point to whether the fault is with your hardware or the software tools.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: Pico freezes very regularly
Thank you, I'll give it a go. I really like the Visual Studio Code integration though, it would be a shame if I had to change!
I suspect that the USB link gets into a weird state and the only way to fix it is to power down the board and relink. But I can't find a way to debug it.
I suspect that the USB link gets into a weird state and the only way to fix it is to power down the board and relink. But I can't find a way to debug it.
Re: Pico freezes very regularly
I am having frequent hang as well. Cannot connect to REPL and cannot break out from a loop with CTRL-C. Since then I
- Do not run main loop in main.py. Expose run() function to manually start from REPL.
- Use SWD to upload frozen code.
- Connect reset switch to rp2.
Related issues:
https://github.com/micropython/micropython/pull/8040
https://github.com/micropython/micropython/issues/8332
Didn't investigate it further since I am happy in my current setup.
- Do not run main loop in main.py. Expose run() function to manually start from REPL.
- Use SWD to upload frozen code.
- Connect reset switch to rp2.
Related issues:
https://github.com/micropython/micropython/pull/8040
https://github.com/micropython/micropython/issues/8332
Didn't investigate it further since I am happy in my current setup.
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: Pico freezes very regularly
See my comment to the second issue: the code runs OK and it seems to be an IDE problem.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: Pico freezes very regularly
You're right. I verified that too. Thank you.pythoncoder wrote: ↑Thu Mar 10, 2022 11:28 amSee my comment to the second issue: the code runs OK and it seems to be an IDE problem.
Re: Pico freezes very regularly
I get a similar problem when trying to use PyCharm. I used a very simple blink.py as a start and as you mentioned it works once when the Pico is has just been connected but fails for subsequent run/debug attempts no matter if I do Crtl-D or Crtl-C I tried. I have been using Thonny but wanted to move to a more comprehensive IDE for development and learning. I also gave Visual code a try but after several attempts to load 1/2 dozen packages I never got passed go. The sheer size of the environment is just too daunting for me. It might be great for advanced users but I'm certainly not one of them. Using a windows platform is certainly not very compatible but the jump to Linux will entail even more of a learning curve. For now I might have to settle for Thonny.... : (