Skip to content
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

ch32 usbFS #10

Closed
nikitos1550 opened this issue Aug 15, 2023 · 9 comments
Closed

ch32 usbFS #10

nikitos1550 opened this issue Aug 15, 2023 · 9 comments

Comments

@nikitos1550
Copy link

Hello! Did somebody actually tried usb full speed device controller?

Before I tried ch32v103, not I changed chip to ch32v303, that has same with ch32v307 USBFS controller.
But I cannot make it work :-(

I remember that there are some issues with WCH, but I don't believe that it fully not working.

SystemClk:144000000
ChipID:30310514
CherryUSB device cdc acm example
USBFS_RCC_Init: div 3
cdc_acm_init() done
[I/USB] Setup: bmRequestType 0x80, bRequest 0x06, wValue 0x0100, wIndex 0x0000, wLength 0x0040
[D/USB] EP0 send 18 bytes, 0 remained
[D/USB] EP0 recv out status
[I/USB] Setup: bmRequestType 0x00, bRequest 0x05, wValue 0x0028, wIndex 0x0000, wLength 0x0000
[D/USB] EP0 send 0 bytes, 0 remained
[I/USB] Setup: bmRequestType 0x80, bRequest 0x06, wValue 0x0100, wIndex 0x0000, wLength 0x0012
[D/USB] EP0 send 18 bytes, 0 remained
[D/USB] EP0 recv out status
[I/USB] Setup: bmRequestType 0x80, bRequest 0x06, wValue 0x0100, wIndex 0x0000, wLength 0x0012
[D/USB] EP0 send 18 bytes, 0 remained
[I/USB] Setup: bmRequestType 0x80, bRequest 0x06, wValue 0x0100, wIndex 0x0000, wLength 0x0012
[D/USB] EP0 send 18 bytes, 0 remained
[I/USB] Setup: bmRequestType 0x80, bRequest 0x06, wValue 0x0100, wIndex 0x0000, wLength 0x0012
[D/USB] EP0 send 18 bytes, 0 remained
[I/USB] Setup: bmRequestType 0x80, bRequest 0x06, wValue 0x0100, wIndex 0x0000, wLength 0x0012
[D/USB] EP0 send 18 bytes, 0 remained
[I/USB] Setup: bmRequestType 0x80, bRequest 0x06, wValue 0x0100, wIndex 0x0000, wLength 0x0012
[D/USB] EP0 send 18 bytes, 0 remained
[I/USB] Setup: bmRequestType 0x80, bRequest 0x06, wValue 0x0100, wIndex 0x0000, wLength 0x0012
[D/USB] EP0 send 18 bytes, 0 remained
[I/USB] Setup: bmRequestType 0x80, bRequest 0x06, wValue 0x0100, wIndex 0x0000, wLength 0x0040
[D/USB] EP0 send 18 bytes, 0 remained
[D/USB] EP0 recv out status
[I/USB] Setup: bmRequestType 0x00, bRequest 0x05, wValue 0x0029, wIndex 0x0000, wLength 0x0000
[D/USB] EP0 send 0 bytes, 0 remained
[I/USB] Setup: bmRequestType 0x80, bRequest 0x06, wValue 0x0100, wIndex 0x0000, wLength 0x0012
[D/USB] EP0 send 18 bytes, 0 remained
[D/USB] EP0 recv out status
[I/USB] Setup: bmRequestType 0x80, bRequest 0x06, wValue 0x0100, wIndex 0x0000, wLength 0x0012
[D/USB] EP0 send 18 bytes, 0 remained
[I/USB] Setup: bmRequestType 0x80, bRequest 0x06, wValue 0x0100, wIndex 0x0000, wLength 0x0012
[D/USB] EP0 send 18 bytes, 0 remained
[I/USB] Setup: bmRequestType 0x80, bRequest 0x06, wValue 0x0100, wIndex 0x0000, wLength 0x0012
[D/USB] EP0 send 18 bytes, 0 remained
[I/USB] Setup: bmRequestType 0x80, bRequest 0x06, wValue 0x0100, wIndex 0x0000, wLength 0x0012
[D/USB] EP0 send 18 bytes, 0 remained
[I/USB] Setup: bmRequestType 0x80, bRequest 0x06, wValue 0x0100, wIndex 0x0000, wLength 0x0012
[D/USB] EP0 send 18 bytes, 0 remained
[I/USB] Setup: bmRequestType 0x80, bRequest 0x06, wValue 0x0100, wIndex 0x0000, wLength 0x0012
[D/USB]�SystemClk:144000000
ChipID:30310514
CherryUSB device cdc acm example
USBFS_RCC_Init: div 3
cdc_acm_init() done
[I/USB] Setup: bmRequestType 0x00, bRequest 0x05, wValue 0x002a, wIndex 0x0000, wLength 0x0000
[D/USB] EP0 send 0 bytes, 0 remained
[I/USB] Setup: bmRequestType 0x80, bRequest 0x06, wValue 0x0100, wIndex 0x0000, wLength 0x0008
[D/USB] EP0 send 8 bytes, 0 remained
[D/USB] EP0 recv out status
[I/USB] Setup: bmRequestType 0x80, bRequest 0x06, wValue 0x0100, wIndex 0x0000, wLength 0x0008
[D/USB] EP0 send 8 bytes, 0 remained
[D/USB] EP0 recv out status
[I/USB] Setup: bmRequestType 0x00, bRequest 0x05, wValue 0x002b, wIndex 0x0000, wLength 0x0000
[D/USB] EP0 send 0 bytes, 0 remained
[I/USB] Setup: bmRequestType 0x80, bRequest 0x06, wValue 0x0100, wIndex 0x0000, wLength 0x0008
[D/USB] EP0 send 8 bytes, 0 remained
[D/USB] EP0 recv out status
[I/USB] Setup: bmRequestType 0x80, bRequest 0x06, wValue 0x0100, wIndex 0x0000, wLength 0x0008
[D/USB] EP0 send 8 bytes, 0 remained
[D/USB] EP0 recv out status
@nikitos1550
Copy link
Author

cdc_acm_init() done
[I/USB] Setup: bmRequestType 0x80, bRequest 0x06, wValue 0x0100, wIndex 0x0000, wLength 0x0040
usbd_ep_start_write: [12:01:00:02:ef:02:01:40:86:1a:37:55:00:01:01:02:03:01]
[D/USB] EP0 send 18 bytes, 0 remained
[D/USB] EP0 recv out status
[I/USB] Setup: bmRequestType 0x00, bRequest 0x05, wValue 0x0003, wIndex 0x0000, wLength 0x0000
[D/USB] EP0 send 0 bytes, 0 remained
[I/USB] Setup: bmRequestType 0x80, bRequest 0x06, wValue 0x0100, wIndex 0x0000, wLength 0x0012
usbd_ep_start_write: [12:01:00:02:ef:02:01:40:86:1a:37:55:00:01:01:02:03:01]
[D/USB] EP0 send 18 bytes, 0 remained
[D/USB] EP0 recv out status
[I/USB] Setup: bmRequestType 0x80, bRequest 0x06, wValue 0x0100, wIndex 0x0000, wLength 0x0012
usbd_ep_start_write: [12:01:00:02:ef:02:01:40:86:1a:37:55:00:01:01:02:03:01]
[D/USB] EP0 send 18 bytes, 0 remained
[I/USB] Setup: bmRequestType 0x80, bRequest 0x06, wValue 0x0100, wIndex 0x0000, wLength 0x0012
usbd_ep_start_write: [12:01:00:02:ef:02:01:40:86:1a:37:55:00:01:01:02:03:01]
[D/USB] EP0 send 18 bytes, 0 remained

Same log with data MCU sent to host.

@sakumisu
Copy link
Contributor

Only support CH32V307, although their ip is the same ,but is not the same too, thanks.

@nikitos1550
Copy link
Author

I also have ch32v305 chip, I replace it on the board and try it. I don't believe, I want see myself.

@nikitos1550
Copy link
Author

Same with 305 chip. This is really strange. Later I will get usb analyzer and can inspect what is really going on the bus. Now seems I cannot use cherryusb :-(

@sakumisu
Copy link
Contributor

Sorry , we do not have other chips and do not know if their same ip is actually the same. You can use v307.

@nikitos1550
Copy link
Author

nikitos1550 commented Aug 16, 2023

Sorry , we do not have other chips and do not know if their same ip is actually the same. You can use v307.

Can I donate you some hardware, so you can try run your project on it?

@HaiMianBBao
Copy link
Collaborator

Please turn off the log or lower the log level before testing.

@nikitos1550
Copy link
Author

Please turn off the log or lower the log level before testing.

I will wait until USB analyzer will come to me (maybe several weeks later) and continue testing with it. For sure will try with and without log. Thanks for advice, yes I know that log can affect timing, moreover I am using 115200 uart log, that is not very fast.

@nikitos1550
Copy link
Author

Finally I choosed tinyusb stack (https://github.com/hathach/tinyusb) instead of cherry (sorry).
I managed ch32v307 usbfs and ch32v103 usbhd work on it. There is usbd controller that I also want bring up. With these four drivers all ch32 usb peripherals should work. maybe later will make PR to tinyusb, Follow up if you interested.

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

No branches or pull requests

3 participants