You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now on PC run this, redirecting to whatever serial port the Pico is on:
cat /dev/zero | pv > /dev/ttyACM0
Expected result: the LED blinks whenever a character is received, for as long as you leave cat running. (Note it will appear to be always on and dim, because this happens very fast.)
Actual result: the LED stops blinking / turns off after about 1 to 10 seconds. pv shows that data is no longer moving - the port is stalled because it thinks the buffer is full. But the pico is deadlocked inside getchar() presumably because it thinks the buffer is empty. If you run cat again, it will blink again, for a while, and then lock up again.
This seems easier to reproduce in real code on a RP2350, but example code fails on RP2040 as well.
The text was updated successfully, but these errors were encountered:
While attempting to debug this I accidentally left the Pico halted in the debugger which triggers the "XHCI died" linux bug, disabling all USB ports on the host computer and forcing a reboot. After the reboot I could no longer reproduce the serial locking up. I didn't even reflash the Pico after rebooting so it is definitely the same firmware. So this seems like a Linux serial port bug.
To reproduce, build and flash this code to a Pico (not Pico W because the LED won't blink):
Now on PC run this, redirecting to whatever serial port the Pico is on:
Expected result: the LED blinks whenever a character is received, for as long as you leave
cat
running. (Note it will appear to be always on and dim, because this happens very fast.)Actual result: the LED stops blinking / turns off after about 1 to 10 seconds.
pv
shows that data is no longer moving - the port is stalled because it thinks the buffer is full. But the pico is deadlocked insidegetchar()
presumably because it thinks the buffer is empty. If you runcat
again, it will blink again, for a while, and then lock up again.This seems easier to reproduce in real code on a RP2350, but example code fails on RP2040 as well.
The text was updated successfully, but these errors were encountered: