cherryusb / cherryusb_wch Goto Github PK
View Code? Open in Web Editor NEWCherryUSB demo for WCH
CherryUSB demo for WCH
Hi i am having an issue trying to compile HID_MOUSE example
I am using this.
https://github.com/xpack-dev-tools/riscv-none-embed-gcc-xpack
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
Hello!
Seems ch32v103 has same usb IP as ch32v307 USBFS.
On ch32v307 it is mapped on 0x50000000, while on ch32v103 it is mapped on 0x40023400.
Going through datasheets I did not find any difference in registers list.
I made this change to usb_ch32_usbfs_reg.h
//#define USBFS_BASE ((uint32_t)0x50000000)
#define USBFS_BASE ((uint32_t)0x40023400)
And trying run some device example (i have startup code for ch32v103 and other things related) like cdc.
Unfortunately My Linux host cannot enumerate device.
I added some ugly log to the cherryusb and port to understand what is going on.
Seem first I get SETUP request
[I/USB] Setup: bmRequestType 0x80, bRequest 0x06, wValue 0x0100, wIndex 0x0000, wLength 0x0040
Then cherryusb try to send 18 bytes descriptor to EP0 and then I get invoke of usbd_event_ep0_in_complete_handler
.
it decrement g_usbd_core.ep0_data_buf_residue
and start reading usbd_ep_start_read(USB_CONTROL_OUT_EP0, NULL, 0);
.
Here I expect to get some out interrupt, but for some reason I still get IN IRQ and go into usbd_event_ep0_in_complete_handler
again and again, it decrement g_usbd_core.ep0_data_buf_residue
again and again (i think developers were not expected such thing and there is no any protection about it), anyway I make check if there is no any bytes to send, then do not decrement it, but I still getting this function invocation.
How can I debug this? Maybe it is some common problem? I do not expect any hardware issue, as ch32v103 usb examples works fine.
有计划支持CH569吗? 特别是 SS HOST, MSD 和 UVC
I recently reviewed the code in a relatively short amount of time, but during my examination, I did not come across any specific section where the usage of a particular USB port is defined or configured. For instance, the CH32V307 microcontroller has two separate USB instances, but the code does not seem to indicate any preference or configuration for selecting either of these USB ports.
I tried to connect a low-speed keyboard. Initialization does not occur.
Cherry USB in the log writes that the hub is installed in full-speed mod and setup packet timeout.
The full-speed keyboard is detected correctly.
I tried changing CONFIG_USBHOST_CONTROL_TRANSFER_TIMEOUT, but it doesn't have any effect.
USB high speed controller ch32v307 was used.
I tried built and test FS audio_v1_mic_multichan_template based audio_v1_mic_multichan_template .
Enumeration is OK, but recording working only once. First opening device is successfully, I see "open EP" in terminal and 'a' value in data from device. But after stopped and started recording again, I see "open EP" in terminal and errors in USB requests because device not send any data.
如题
用官方EVT板试了一下。FS下的host demo出现:
\ | /
- RT - Thread Operating System
/ | \ 3.1.3 build Apr 21 2023
2006 - 2019 Copyright by rt-thread team
Start usb host task...
ms[I/USB] Dev connect
h >[I/USB] Dev USB_SPEED_FULL
[I/USB] Dev connect
[I/USB] New full-speed device on Hub 1, Port 1 connected
[W/USB] Setup Timeout and retry
[W/USB] Setup Timeout and retry
[W/USB] Setup Timeout and retry
[W/USB] Setup Timeout and retry
[W/USB] Setup Timeout and retry
[W/USB] Setup Timeout and retry
[W/USB] Setup Timeout and retry
[W/USB] Setup Timeout and retry
[W/USB] Setup Timeout and retry
[W/USB] Setup Timeout and retry
[W/USB] Setup Timeout and retry
[W/USB] Setup Timeout and retry
[W/USB] Setup Timeout and retry
[W/USB] Setup Timeout and retry
......
[E/USB] Failed to get device descriptor,errorcode:-116
[E/USB] Port 1 enumerate fail
但是运行官方的HOST_KM例程是可以成功枚举hub以及下级的鼠标的(鼠标插拔事件都正常)。
至于HS也会有bug,g_hub_intbuf[CONFIG_USBHOST_MAX_EXTHUBS + 1][1]需要改为g_hub_intbuf[CONFIG_USBHOST_MAX_EXTHUBS + 1][CONFIG_USB_ALIGN_SIZE],不然hub使用的buf指针不对齐,出现IN DMA错误。不过HS可以成功枚举hub,但是hub接的鼠标又没有检测出来。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.