New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(RP2040) tud_connected() and tud_mounted() stay true after disconnected #2478
Comments
I'm seeing the same behaviour here too. I'm trying to figure out why sending MIDI notes to the host randomly stops working until I unplug and re-plug the USB, but as in the issue report, once connected tud_connected() and tud_mounted() continue to report that they are connected even when the USB cable is unplugged. |
On the PI Pico, depending on your use case, this issue may be worked around by sensing VBUS instead; GPIO 24 is hardwired for that on the Pico. (WL_GPIO 2 on the PicoW) This will only work if VBUS is fed exclusively by USB though. |
Good to know; but in my case the +v USB pin is cut and the Pico (actually Seeed XIAO RP2040) is externally powered so this wouldn't be a suitable workaround. |
Without VBUS there is no way to do disconnection detection.
You should use |
Operating System
Linux
Board
Raspberry Pi Pico
Firmware
What happened ?
tud_connected() and tud_mounted() correctly return FALSE before USB is connected, and TRUE when connected. However, they continue to return TRUE indefinitely after USB is no longer connected.
How to reproduce ?
Debug Log as txt file (LOG/CFG_TUSB_DEBUG=2)
usb log.txt
Screenshots
No response
I have checked existing issues, dicussion and documentation
The text was updated successfully, but these errors were encountered: