Page 1 of 1

Pico freezes very regularly

Posted: Mon Mar 07, 2022 1:28 pm
by APinto
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!

Re: Pico freezes very regularly

Posted: Tue Mar 08, 2022 9:29 am
by pythoncoder
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.

Re: Pico freezes very regularly

Posted: Tue Mar 08, 2022 12:48 pm
by APinto
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.

Re: Pico freezes very regularly

Posted: Wed Mar 09, 2022 3:16 am
by yjchun
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.

Re: Pico freezes very regularly

Posted: Thu Mar 10, 2022 11:28 am
by pythoncoder
See my comment to the second issue: the code runs OK and it seems to be an IDE problem.

Re: Pico freezes very regularly

Posted: Thu Mar 10, 2022 1:12 pm
by yjchun
pythoncoder wrote:
Thu Mar 10, 2022 11:28 am
See my comment to the second issue: the code runs OK and it seems to be an IDE problem.
You're right. I verified that too. Thank you.

Re: Pico freezes very regularly

Posted: Mon Mar 14, 2022 8:21 pm
by Delebel
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.... : (