embassy/embassy-usb-synopsys-otg
Matt Johnston e2ceb2b1f7 otg: Improve IN write performance
chunks_exact() can be handled by the compiler more efficiently.
Previous code was making a memcpy call for each 4 byte chunk slice.
Hoisting the fifo out of the loop avoids recalculating the pointer each
time.

In my benchmark I see a jump from ~13 megabyte/sec to ~25MB/sec after
this change (opt-level=3). opt-level = "z" goes 9MB/s to 18MB/s.

The benchmark was on a stm32h7s3l8, 600mhz clock, 512 byte bulk writes,
data in DTCM. The benchmark isn't just USB writes, also has some
unrelated memcpys for packet construction.
2025-07-15 16:40:37 +08:00
..
2025-07-15 16:40:37 +08:00
2025-05-22 13:29:55 +08:00

Embassy USB driver for the Synopsys USB OTG core

This crate implements embassy-usb-driver for Synopsys USB OTG devices.

It contains the "core" of the driver that is common across all chips using the Synopsys OTG IP, but it doesn't contain chip-specific initialization such as clock setup and GPIO muxing. You most likely don't want to use this crate directly, but use it through a HAL that does the initialization for you.

List of HALs integrating this driver:

If you wish to integrate this crate into your device's HAL, you will need to add the device-specific initialization. See the above crates for examples on how to do it.