-
Notifications
You must be signed in to change notification settings - Fork 205
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
USB Failed to read device descriptors and general instability #809
Comments
This could be a result of this issue - rust-embedded-community/usb-device#153 Sorry I've not gotten back in to this stuff, just keep finding interesting distractions! There's an old branch of atsamd-rs here which I believe implements the fixes but it's a bit fiddly as you need to use the same usb-device across the HAL and any USB class implementations - I suggest using Cargo's patch functionality. |
We have also discussed on Matrix, but the fact that clocks weren't setup is also a likely cause - the USB peripheral needs a stable and precise clock source, which can come from either:
neither of which are enabled in the default clocking setup. |
True, but enabling the Pclk for USB seems to work 60% of the time (Im using my own branch with #808 so that USB can work with the V2 API)
Output:
Dmesg output:
So it appears to be working 60% of the time quickly, and when it doesn't work, after the PC re-probes, it then detects it So actually yes, @ianrrees after reading the linked issue, it appears to be that issue I'm facing rather than unstable clocks |
@ianrrees i was able to test your test usb-device crate with the latest atsamd crate (Manually patched), it works perfectly |
I don't think we need to track this here anymore since the clocking aspect of this is not a HAL issue, and the usb-device aspect is already being worked (slowly) upstream. |
When using the USB peripheral with default clocking state (Not tested at 120Mhz), it appears the USB implementation is extremely buggy. Linux reports multiple issues when trying to enumerate SAME51J20A connected via USB. However, after some time (Too long for my screencast), it eventually does detect the USB device correctly that SAME is implementing (In my case, CDC Serial)
Screencast_20250108_091941.webm
The text was updated successfully, but these errors were encountered: