-
Couldn't load subscription status.
- Fork 1.2k
Add USBHost #4321
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
base: main
Are you sure you want to change the base?
Add USBHost #4321
Conversation
|
Here's a commit that restores the ability to compile with the log feature: AlexCharlton@46c9d8c This fix had been reverted because I had originally added the |
|
And another commit that fixes It incorrectly assumed that interface descriptors would always come immediately after config descriptors. Embassy's own descriptor builder may stick an interface association descriptor before any interface descriptors, though. Since the IAD isn't actually needed to parse IDs (and since this iterator is also used to parse configurations from potentially unknown sources), I simply made it so that we skip over any non-interface descriptors, which is also what the previous interface iterator did. |
|
One additional fix for this branch: AlexCharlton@3ef6a05
|
ce948c2 to
f49b455
Compare
|
Rebased and took in AlexCharlton's fixes. |
|
I recently attempted to port the stm32g0 example from this PR to stm32f4 (otg). I'm testing on the stm32f446re Nucleo board which has two USB peripherals both OTG, I'm focusing on the OTG_FS one. I saw that this PR includes what appears to be an implementation for host mode for STM32 otg peripherals (embassy-usb-synopsys-otg/src/host.rs) in addition to the usb_v4. The usb_v4 implementation has an example "examples/stm32g0/src/bin/usb_host_keyboard.rs" I see the feature flags in "embassy-stm32/src/usb/mod.rs" automatically select the _version mod to used based on the board capability (via mechanism in build.rs I think?) which automatically enables or disables cfg attributes But couldn't quite find how to create that otg parameter configured as host, that it seems to expect. I'd love any advice or thoughts on how the usb_host driver interface should be unified, or at least made ergonomic, whether the board peripherals are usb or otg. |
Nevermind, I stand corrected. |
…isochronuous channels
Use stat_tx and stat_rx instead of nak() flag
Examples for stm32g0 not build.
Proper implementation is only provided for embassy-rp. embassy-stm32 only gets a stub.
26711da to
7cdcaa7
Compare
|
I've rebased onto main. It might be better to merge main into this branch. This way I would avoid rewriting others commits and not risk attributing my errors to others if I make any during rebase. It seems to me that this would also play nicer with github. Test: Examples for rp and stm32g0 build fine. |
I'm not sure a blanket statement about STM32s can't be made regarding USB peripherals. The reference manual and block diagram for the STM32F446 show two separate USB OTG peripherals: |
|
Yep, appears I was mistaken - thanks @jakerr, I wonder why I thought that. Looked at the block diagrams for a few of the chips I worked with again and it looks like they're distinct controllers; doesn't look like the pins overlap either. |
I'm opening new pr since author of previous one has become unresponsive.
Previous PR: #4032
I've rebased code form the previous pr.
This code is WIP.
Currently there are a lot of warnings due to missing doc-strings and the like.