Skip to content

USB - Enable Multi-Packet Rx and Tx - #1009

Merged
jbeaurivage merged 5 commits into
atsamd-rs:masterfrom
rnd-ash:multi-packet-usb
May 31, 2026
Merged

USB - Enable Multi-Packet Rx and Tx#1009
jbeaurivage merged 5 commits into
atsamd-rs:masterfrom
rnd-ash:multi-packet-usb

Conversation

@rnd-ash

@rnd-ash rnd-ash commented May 21, 2026

Copy link
Copy Markdown
Contributor

Summary

As an improvement to #963, this PR fully enables the USB Peripheral's Multi-Packet Tx/Rx feature.

This allows for a speed up of mainly Bulk-Transfers (Getting approx 900KBps with a 64 packet size and 512 byte Endpoint buffer size - Up from 600KBps), whilst reducing the number of CPU interrupts from 13,000/sec to 1000/sec.

Tx Multi-Packet support is automatically enabled should the outgoing data size be greater than the USB Packet size.

Rx Multi-Packet support has to be manually enabled per endpoint with the new UsbBus's configure_out_endpoint_multipacket_rx function. This is in order to keep default behaviour where any amount of data in an Rx Endpoint triggers a interrupt.

Since endpoint allocation size is now calculated at compile time (Since #963), I have removed some logic that calculates this at runtime, since it is no longer required.

There is also a new usb-buffer-16k feature flag to the crate. This is for completion, allowing for up to a 1024 byte endpoint buffer.

@jbeaurivage
jbeaurivage merged commit 610a5e1 into atsamd-rs:master May 31, 2026
109 checks passed
@github-actions github-actions Bot mentioned this pull request May 31, 2026
rnd-ash added a commit to rnd-ash/atsamd that referenced this pull request Jul 3, 2026
* Add 16KB buffer for USB option (1024 bytes per EP)
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