-
Notifications
You must be signed in to change notification settings - Fork 48
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 peripheral support #135
Conversation
@usbalbin I have mostly ripped this implementation from the F3 repo. However I'm not sure if it is not working correctly or if I have a hardware issue since the G4 board I'm using doesn't feature a USB connector. If you have the ability to test using the example that would be great. Otherwise wait until I can get my hands on the correct hardware before merging. |
src/usb.rs
Outdated
const EP_MEMORY_ACCESS_2X16: bool = true; | ||
|
||
fn enable() { | ||
critical_section::with(|_| unsafe { |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
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.
What is the different between critical_section::with
(requiring a new dependency) and cortex_m::interrupt::free
as used in src/serial/usart.rs?
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.
If there would be no downside, I would prefer to avoid the extra dependency
I do not have access to such hardware right now. Might in several months, maybe, but not now. BTW, thanks! |
Awesome! Correct me if I am wrong, have not looked into USB, but I believe I read about some sort of clock recovery system in #50 for running without a crystal in case that helps. |
I have switched my project over to use embassy which is why I haven't done anything more with that PR. As far as I remember with a bit of cleanup it should be good to go in if someone wants to use the work from it. I'm happy to answer questions or assist with that if someone wants to take it over. |
@usbalbin with the correct hardware, all is working now. |
@usbalbin this is ready to merge. The failing CI is unrelated. |
Great! Perhaps not a huge deal, but would you mind having a look at my earlier comment :) |
@usbalbin sorry didn't see that. Fixed now. |
Thanks a lot for this! |
Adds the required implementation to support USB device with
usb-device
andstm32-usbd
.