-
Notifications
You must be signed in to change notification settings - Fork 139
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
USB support #144
USB support #144
Conversation
the addresses look like MMIO registers
or at least they seem to work
to ensure the external oscillator has been enabled
We have a test repo with a few tests that you can port and run on your hardware: https://github.com/Disasm/stm32-usbd-tests |
For some reason, this driver doesn't work with the default EP0 size (8 bytes). Also a serial loopback example (based on https://github.com/Disasm/usb-otg-workspace/blob/master/example-f429zi-board/examples/serial.rs#L63-L85) fails to pass stress-testing. |
Rebasing the |
|
||
unsafe { | ||
if ep_addr.index() == 0 { | ||
regs.tasks_ep0stall.write(|w| w.tasks_ep0stall().set_bit()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh.
regs.tasks_ep0stall.write(|w| if stalled { w.tasks_ep0stall().set_bit() } else { w.tasks_ep0stall().clear_bit() });
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I went with:
regs.tasks_ep0stall.write(|w| w.tasks_ep0stall().bit(stalled));
@nrf-rs/nrf52 I've rebased this and plan to push this PR + my local fixup diff to close out this PR. I have a few "Particle Xenon" boards with 52840's on them, as well as that weird MDK thing that I previously added a bsp for in this org, so I'm able to test this and confirmed that the device enumerates and responds:
|
Awesome! Happy to take a look. |
My fixup diff on top of this is minor; I'll just push it and if you spot something I'm around to act on it! |
Please wait for CI to pass before pushing to master |
Too late... but I'm running those tests locally and fixing up now :) |
I'm going to run test_class as well as the serial benchmark soon |
Tested, the behavior is the same as mentioned in #144 (comment) |
Fixes compilation by pointing to current versions and takes in @unrelentingtech's fork of usb-device and suggestion in nrf-rs#144 (review) I folded in the hello world portion from japaric's PR summary text. refs: rust-embedded-community/usb-device#51 closes: nrf-rs#144
Fixes compilation by pointing to current versions and takes in @unrelentingtech's fork of usb-device and suggestion in nrf-rs#144 (review) I folded in the hello world portion from japaric's PR summary text. refs: rust-embedded-community/usb-device#51 closes: nrf-rs#144
Fixes compilation by pointing to current versions and takes in @unrelentingtech's fork of usb-device and suggestion in nrf-rs/nrf-hal#144 (review) I folded in the hello world portion from japaric's PR summary text. refs: rust-embedded-community/usb-device#51 closes: nrf-rs/nrf-hal#144
Fixes compilation by pointing to current versions and takes in @unrelentingtech's fork of usb-device and suggestion in nrf-rs/nrf-hal#144 (review) I folded in the hello world portion from japaric's PR summary text. refs: rust-embedded-community/usb-device#51 closes: nrf-rs/nrf-hal#144
295: USB support r=Dirbaio a=Disasm This PR is based on #144 and previous attempts. Co-authored-by: Jonas Schievink <[email protected]> Co-authored-by: Jorge Aparicio <[email protected]> Co-authored-by: Wez Furlong <[email protected]> Co-authored-by: Vadim Kaushan <[email protected]>
this PR builds on top of @jonas-schievink PR (#133)
I have managed to get a CDC ACM (using the
usbd-serial
crate) device enumerated and got some output out from it using the following program (snippet):(don't forget to send a newline or
cat
won't print anything)However, I'm not getting reliable enumeration (*). I still need to dig deeper into that issue but would appreciate other people testing out this branch.
(*) though this may be mainly caused by how I'm terminating my embedded application: I'm halting the device without first disconnecting it from the USB bus; this seems to make the host USB controller very sad (it power cycles the USB bus a few times and never gets an answer from the device (because it's halted))
P.S. this branch depends on this Jonas' fork of usbd-device (which handles the nrf52 quirk of handling SET_ADDRESS requests entirely in hardware). Use the following patch before you try out this branch: