Skip to content
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] Init USB out endpoints on transfer start #316

Merged

Conversation

KarlK90
Copy link
Contributor

@KarlK90 KarlK90 commented Mar 2, 2022

@hanya I found an error in the USB driver, when starting new out transfers the out endpoint has to be configured immediately or otherwise a data sequence error is generated. The actual fix is on line 873 in usb_lld_start_out() Could you confirm / review my changes?

The only notable other change was the condition for detecting an short package, which in my understanding is only the case if the transfer length is under 64 Byte? Also rxpkts is an unsigned integer so can never be smaller than 0, therefore I changed the check to equals.

With these changes QMK successfully enumerates with the HID descriptors.

When starting a receive operation on an out endpoint it has to be
configured before the out interrupt occurs, or otherwise a sequence
error is the result.
@KarlK90 KarlK90 changed the title [RP2040] Fix data sequence errors on USB out endpoints [RP2040] Init USB out endpoints on transfer start Mar 2, 2022
@hanya
Copy link
Contributor

hanya commented Mar 2, 2022

Looks good for me. Thank you finding the problem in the driver.

@KarlK90
Copy link
Contributor Author

KarlK90 commented Mar 2, 2022

Looks good for me. Thank you finding the problem in the driver.

Great! 🙂

@fpoussin feel free to merge on your approval!

@fpoussin fpoussin merged commit e41721b into ChibiOS:chibios-21.11.x Mar 10, 2022
@fpoussin
Copy link
Member

LGTM, thanks!

@KarlK90
Copy link
Contributor Author

KarlK90 commented Mar 10, 2022

Great! Thanks for the merge!

@KarlK90 KarlK90 deleted the fix/rp2040_out_endpoint_errors branch March 10, 2022 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants