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

usbus/hid: fix ep_out readiness #17230

Merged
merged 1 commit into from Nov 18, 2021

Conversation

dylad
Copy link
Member

@dylad dylad commented Nov 17, 2021

Contribution description

This PR corrects the readyness of the OUT endpoint for HID.
Before that, EP was configured as waiting for OUT data during the initialization phase.
Unfortunately, during the enumeration phase, the USB endpoint is reset and thus, the endpoint configuration is lost.
Somehow, nRF52 and SAM0 usbdev implementation are able to workaround this issue but this should be fixed on HID side.

Testing procedure

Flash tests/usbus_hid and follow the test procedure.

Issues/PRs references

None.

@github-actions github-actions bot added Area: sys Area: System Area: USB Area: Universal Serial Bus labels Nov 17, 2021
@benpicco benpicco added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Nov 17, 2021
Copy link
Member

@bergzand bergzand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack, tested on nucleo-f746zg. Fixes the issue for me

@bergzand bergzand merged commit 8159f73 into RIOT-OS:master Nov 18, 2021
@dylad dylad added this to the Release 2022.01 milestone Nov 18, 2021
@dylad dylad deleted the pr/usbus/hid/fix_ep_out_readyness branch November 18, 2021 08:26
@Ollrogge
Copy link
Contributor

This PR breaks functionality of tests/sys_fido2_ctap. Readding the call of usbdev_ep_xmit to _init fixes the issue.
I don't understand the relationship between signaling to be ready for data from HOST and the SET_IDLE request. Could you explain?

@dylad
Copy link
Member Author

dylad commented Nov 19, 2021

I don't understand the relationship between signaling to be ready for data from HOST and the SET_IDLE request.

Strictly speaking, there is no relation between them. In fact, tests/usbus_hid wasn't working on ST hardware and I also had issue with an ongoing usbdev implementation I am working on.
I move the ep_xmit function here, as a workaround, to ensure OUT endpoint are ready to accept data after a USB reset. Not the best place I guess but the idea was just to be able to fix broken platform.
I was unaware of the existence of FIDO, and that it uses HID otherwise I would have give it a try before hand.
If a call to usbdev_ep_xmit() fixes tests/sys_fido2_ctap, then let revert part of this PR.
Would you mind open a PR for that ? Otherwise I can probably do it during the weekend.

@benpicco benpicco changed the title usbus/hid: fix ep_out readyness usbus/hid: fix ep_out readiness Jan 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: sys Area: System Area: USB Area: Universal Serial Bus CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants