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

Allow wider range of USB maxPacketSize values #441

Merged
merged 1 commit into from
May 30, 2021

Conversation

ianrrees
Copy link
Contributor

This is important for isochronous endpoints, which reserve bandwidth on the USB as opposed to bulk endpoints which use whatever bandwidth is available. Isochronous transfers on full-speed USB can have maximum packet sizes anywhere between 1B and 1023B (not just powers of 2), but for instance bulk ones need to be either 1B, 2B, ... 32B, or 64B.

I've opened rust-embedded-community/usb-device#71 in usb-device to propose checking for valid endpoint sizes there, since that code will be the same across all implementations.

(note the old alloc_ep() code made buffers at least 64B - I couldn't find a reason for that, and it seems to work fine for smaller ones)

The USB specification's allowed endpoint maxPacketSize values vary
depending on the type of endpoint.  In the isochronous case, it is
important to allow sizes in between the ones encoded in the hardware, to
efficiently use the bus bandwidth allocated for periodic transfers.
@bradleyharden
Copy link
Contributor

I'm going to merge this. Let me know if you hear anything from the usb-device repo.

@bradleyharden bradleyharden merged commit a4e38e4 into atsamd-rs:master May 30, 2021
jbeaurivage pushed a commit to jbeaurivage/atsamd that referenced this pull request Jun 2, 2021
The USB specification's allowed endpoint maxPacketSize values vary
depending on the type of endpoint.  In the isochronous case, it is
important to allow sizes in between the ones encoded in the hardware, to
efficiently use the bus bandwidth allocated for periodic transfers.
kaizensparc pushed a commit to kaizensparc/atsamd that referenced this pull request Dec 24, 2021
The USB specification's allowed endpoint maxPacketSize values vary
depending on the type of endpoint.  In the isochronous case, it is
important to allow sizes in between the ones encoded in the hardware, to
efficiently use the bus bandwidth allocated for periodic transfers.
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.

2 participants