imxrt-rs / imxrt-usbd

USB device driver for i.MX RT processors
Apache License 2.0
7 stars 9 forks source link

Add high-speed support #17

Closed mciantyre closed 1 year ago

mciantyre commented 1 year ago

Closes #2. There's still no support for overlapped I/O and multiple transfer descriptors. But, we can still support a high-speed device.

Additional commits help when designing USB devices, including

I tested these features through imxrt-log (imxrt-rs/imxrt-hal#121).

By default, the driver supports high speed. Users can throttle the speed with a different constructor. To help with testing, the Teensy 4 examples have a compile-time flag to switch between full and high speed.

mciantyre commented 1 year ago

Here's the results from the usb-device test class against a high-speed driver. See comments on #6 to compare against a full speed driver.

If you're trying to reproduce these results, it helps to have https://github.com/rust-embedded-community/usb-device/pull/107 available in your test harness.

running 10 tests
test control_request ... ok
test control_data ... ok
test control_data_static ... ok
test control_error ... ok
test string_descriptors ... ok
test interface_descriptor ... ok
test bulk_loopback ... ok
test interrupt_loopback ... ok
test bench_bulk_write ... ok
  16 transfers of 65536 bytes in 0.049s -> 171.018Mbit/s
test bench_bulk_read ... ok
  16 transfers of 65536 bytes in 0.071s -> 118.569Mbit/s
0 failed, 10 succeeded

ALL TESTS PASSED!
teburd commented 1 year ago

Looks very nice!