-
Notifications
You must be signed in to change notification settings - Fork 9
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
Port change should not re-initialize endpoints #23
Comments
Any news on this? Otherwise I can try to understand the documentation of the USB peripheral, and try to come up with something. |
@mciantyre What's the point of Trying to understand the code to come up with a sensible solution. |
Nothing on my end. If you're looking for a starting point, I'd start with something like this. This passed the expected test cases from the usb-device test suite.
My interpretation of the RM is that we should only enable (non-zero) endpoints once we're configured. We might not need this with driver tweaks, but I never tested without it. |
It seems to work for me. Is there a reason why we shouldn't merge mciantyre@1d51056 as-is? Also, it seems that the |
"I don't know when the device is configured" - Ok I think I get it now - I didn't realize that the driver has no way of knowing the the That said - where exactly did you read that requirement? I didn't find it in the Also, the current way of dealing with that will set us up for failure later - if the transition to |
Should I clone your change and open a PR for it, or will you do it directly? Your fix works on my project, so I'm happy to +1 it. |
That's my issue: I can't easily reproduce and test this. If it works for you, we can move forward with #24.
I interpreted the We also need to tickle the TX / RX data toggle reset during configuration.
Good point. I'll link to #4 so we can consider this when handling suspend. |
imxrt-usbd/src/driver.rs
Lines 405 to 408 in a2f2ce5
This branch in
poll()
tried to re-initialize (disable) endpoints under two conditions:However, we take this branch when exiting suspend. If we disable endpoints when exiting suspend, we break USB device functions.
This branch isn't properly handling the deconfiguration aspect of the problem; port change doesn't imply deconfiguration. Port change may imply device reset, but we already have dedicated code paths for that. So, we should be able to move this into a reset handling / driver initialization routine.
There's more troubleshooting and discussions in threads here.
The text was updated successfully, but these errors were encountered: