embassy-rs / embassy

Modern embedded framework, using Rust and async.
https://embassy.dev
Apache License 2.0
5.57k stars 774 forks source link

embassy-usb API changes required for mass storage bulk-only transport #2837

Open simpkins opened 7 months ago

simpkins commented 7 months ago

I have been looking at support for the USB mass storage class, and I think some API changes may be required in order to properly implement the bulk-only protocol. In particular, the error handling behavior for this protocol requires stalling the endpoints, and also overriding behavior for the standard endpoint CLEAR_FEATURE control message in some cases (to ignore attempts by the host to clear the endpoint STALL flag when the device is in a state where it is waiting for reset recovery). The spec for the protocol can be found here: https://usb.org/document-library/mass-storage-bulk-only-10

This is somewhat low priority for me, but I figured I would open an issue just to keep track of some of the APIs that seem like they would be needed:

The bulk-only transport protocol is superseded these days by the UAS protocol, which doesn't ever stall endpoints for error handling. However, UAS appears to require operating at high speed or super speed, so bulk-only transport seems like it is potentially still necessary for devices that only support full-speed operation.

Murmele commented 5 days ago

Is there any plan to implement mass storage bulk only?