USB "fast buffer switching" on stm32 usbfs devices #6352
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds support for "fast buffer switching" on the USB peripheral of stm32f1, stm32g0, and stm32f0 devices.
This feature can improve the USB transfer rates on these devices. It's unlikely to be noticed on traditional emulated serial over USB setups, but it can have a notable impact when using USB to CANBUS bridge configurations.
When the micro-controller is configured to behave as a canbus adapter, the gs_usb linux kernel protocol requires many small USB packets to be transferred. Optimizing the USB buffer handling can notably improve overall transfer rates. In particular, I've found that, prior to these changes, the USB to CANBUS bridge setup was bottlenecked by USB transfers on some machines (such as the rpi3) - thus preventing those setups from utilizing the full bandwidth of 1Mbit/s canbus.
-Kevin