-
Notifications
You must be signed in to change notification settings - Fork 34
usbd: Remove debug prints and add an example for the V203 #94
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?
Conversation
The driver works for the most part, except you must for some reason use the arch-spin executor to make it work. Perhaps something is wrong in the interrupts? Do not merge in the current form!
// It needs some buffers for building the descriptors. | ||
let mut config_descriptor = [0; 256]; | ||
let mut bos_descriptor = [0; 256]; | ||
let mut msos_descriptor = [0; 256]; |
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 no msos descriptor is used, this buffer should be [0; 0]
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.
lgtm
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.
Thanks for these changes.
I have tested the example on a CH32V203C8T6 board (WeActStudio).
It works as expected but to work without the WCH-Link connected, I had to comment the println!
statement otherwise it enumerates but picocom
was stuck on connection.
Once the minor comments are addressed, this can be merged.
I think that the use of arch-spin
is not blocking.
config.manufacturer = Some("Embassy"); | ||
config.product = Some("USB-serial example"); | ||
config.serial_number = Some("12345678"); | ||
config.max_power = 100; |
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.
This is the default value, this line can be omitted.
config.product = Some("USB-serial example"); | ||
config.serial_number = Some("12345678"); | ||
config.max_power = 100; | ||
config.max_packet_size_0 = 64; |
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.
This is the default value, this line can be omitted.
// It needs some buffers for building the descriptors. | ||
let mut config_descriptor = [0; 256]; | ||
let mut bos_descriptor = [0; 256]; | ||
let mut msos_descriptor = [0; 256]; |
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.
This variable is not used, this line can be omitted.
bind_interrupts!(struct Irqs { | ||
USB_LP_CAN1_RX0 => hal::usbd::InterruptHandler<hal::peripherals::USBD>; | ||
}); | ||
|
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.
Maybe add a comment that the println!
lines should be commented to work properly without a probe connected.
Do not merge before fixing the executor issue!
The driver works for the most part, except you must for some reason use the arch-spin executor to make it work. Perhaps something is wrong in the interrupts? I have no experience with embassy executor internals or the USB peripheral itself, so any help would be appreciated.
@andelf Do you have any ideas?
Closes #79