-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pkg/tinyusb: Note distinction from USBUS #18834
Conversation
Murdock results✔️ PASSED def30c1 pkg/tinyusb: Note distinction from USBUS
ArtifactsThis only reflects a subset of all builds from https://ci-prod.riot-os.org. Please refer to https://ci.riot-os.org for a complete build for now. |
Although I'm working on an abstraction layer that will allow to use RIOT's usbdev drivers with the tinyUSB stack and tinyUSB drivers with USBUS, the stacks will be different and will coexist. The note helps the user to understand this. Thanks. |
A criss-cross adapter would be awesome, I'm looking forward to that -- then, that note would read differently, and the docs would say anyway how to select the backend. (Also, then, I'd love to implement the UsbDevice Rust trait on one of them, or on the one that comes out on top if only one can be used atop the other). |
You can of course do what you like, but I don't quite see the use case for that. |
If I understand correctly tinyUSB already provides support for all the
hardware supported by usbdev, same for USB classes.
If it turns out that tinyUSB outperforms our current one on all metrics
(dylad mentioned it being heavier) and thus replaces USBUS, that's just
as valid an outcome for me. My main point is that while there's no clear
roadmap and two APIs, people who might do stuff with USB might rather
wait to see things settle than bet on the wrong API and later rewrite
their code. (This PR is just about documenting the status quo; if we
continue roadmap discussions we might want to ping @bergzand to join
in).
|
Yes, and a few more device classes are supported. When I ported the tinyUSB package, my intention was not to replace USBUS but to use tinyUSB device drivers for MCUs that do not have The disadvantages of tinyUSB that I see are:
|
to put numbers on that: With the CDC ACM stdio test tinyUSB requires 2776 bytes more ROM on |
🤔 The question is, what's better, less RAM or less ROM? |
I have to add something to my statement. Although tinyUSB supports more device classes than USBUS, a lot of work has to be done integrate them into RIOT. To have same functionality as with USBUS, we need at least:
IMHO, one of the biggest problems with tinyUSB is the approach they use for implementing the descriptors that in tinyUSB the application is responsible for. The descriptors are assembled as a single byte array using some macros according to the device classes, interfaces and endpoints used by the application. Usually, each application has to implement the descriptors and their handling from scratch over and over again. In PR #18835, I tried a generic approach for common use cases where the descriptors of different device classes are conditionally compiled in using these descriptor macros according to selected device class modules and (in future) according to further Kconfig variables. Unfortunately, this approach is quite limited:
|
Contribution description
Users who find tinyusb in the documentation might be misled into thinking that this is what backs the USB features advertised around RIOT, or think that one of the stacks can use the other. This adds text to the docs to say that they are distinct and incompatible.
Testing procedure