PICO and PICO2 crash when unplugging and replugging USB #17682
Replies: 4 comments 7 replies
-
I think this is to be expected. I have encountered similar behaviour with other MicroPython targets when powered from an external supply. For reliable debugging direct the REPL to a UART and use an FTDI adaptor. This approach also enables debugging applications which use deepsleep. |
Beta Was this translation helpful? Give feedback.
-
I'm pretty sure that I had a simple demo running on a rp2 makerboard that kept running reliably while plugging/unplugging the board. It used async, or it could be that the USB CDC hardware was just better buffered on that board |
Beta Was this translation helpful? Give feedback.
-
@Josverl
It's disconnecting the hub and reconnecting it. Disconnecting and reconnecting the PICO into the hub is OK. So it seems that this introduces some USB status packets which are not handled gracefully at all. |
Beta Was this translation helpful? Give feedback.
-
I have a Pico running a simple test program when it boots up. The test script is frozen into the firmware and started by the main.c before the REPL loop. Pulling the USB hub out of the Linux PC did not cause the Pico board to perform a hard reset.
The
Yes, I can also connect and get output with mpremote. Of course; Ctrl+C and Ctrl+D do not work. Can the hard-reset happen due to the REPL loop? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
With the PICO(2) plugged into a powered hub, it should be possible to cut the connection between PC and Hub. That works fine with a lot of devices, doesn't play well with PICO(2) running Micropython.
When cutting the connection between PC and Hub, it has been verified (measured) that the µC still gets the 5V from the hubs power supply.
Sometimes Micropython crashed upon cutting the connection, sometimes not.
If it survives the disconnect and continues blinking, then it'll get killed upon reconnection.
Testprogram includes ASCII drawing and a dmesg log.
Even without the print (ie. not using the USB CDC) it still crashes.
Beta Was this translation helpful? Give feedback.
All reactions