8000 usbd: Remove debug prints and add an example for the V203 by Noxime · Pull Request #94 · ch32-rs/ch32-hal · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Noxime
8000
Copy link
@Noxime Noxime commented Apr 28, 2025

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

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];
Copy link

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]

Copy link
@HaoboGu HaoboGu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Contributor
@romainreignier romainreignier left a 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;
Copy link
Contributor

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;
Copy link
Contributor

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];
Copy link
Contributor

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>;
});

Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

USBD peripheral driver
3 participants
0