Replies: 1 comment
-
|
it is not the bug of this library, Since stm32f103 work just fine. Each mcu has their own special thing to port so that I could work with the stack. Similar mcu within a same vendor's family has their difference as well, I don't have the mcu, therefore I don't think I could help. It just an porting question for a new MCU. Convert to discussion for other with the same MCU could join to help. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Operating System
Windows 10
Board
CH32F103C8T6
Firmware
webusb-serial
What happened ?
CH32F103C8T6 is very similar to STM32F103C8T6. I use "make BOARD=stm32f103_bluepill all" to compile and flash image.
after power on, windows host send 80 06 00 01 00 00 40 00, while device send 18 bytes.
it seems STM32F103 have the same precesure, and win10 usb works well.
issue seems to be Set Address handled twice after power on by device, while host only send one time.
How to reproduce ?
Debug Log
CH32F103C8T6 issue log:
00> USBD init
00> CDC init
00> VENDOR init
00> USBD Bus Reset : Full Speed
00>
00> USBD Setup Received 80 06 00 01 00 00 40 00
00> Get Descriptor Device
00> Queue EP 80 with 18 bytes ...
00> USBD Xfer Complete on EP 80 with 18 bytes
00> Queue EP 00 with 0 bytes ...
00> USBD Xfer Complete on EP 00 with 0 bytes
00>
00> USBD Setup Received 00 05 18 00 00 00 00 00
00> Set Address
00> USBD Xfer Complete on EP 80 with 0 bytes
00>
00> USBD Setup Received 00 05 18 00 00 00 00 00
00> Set Address
00> USBD Xfer Complete on EP 80 with 0 bytes
00> USBD Xfer Complete on EP 00 with 0 bytes
00> USBD Bus Reset : Full Speed
00>
00> USBD Setup Received 80 06 00 01 00 00 40 00
00> Get Descriptor Device
00> Queue EP 80 with 18 bytes ...
00> USBD Xfer Complete on EP 80 with 18 bytes
00> Queue EP 00 with 0 bytes ...
00> USBD Xfer Complete on EP 00 with 0 bytes
00>
00> USBD Setup Received 00 00 00 01 00 00 40 00
00> Get Status
00> Queue EP 00 with 2 bytes ...
00> USBD Bus Reset : Full Speed
00>
00> USBD Setup Received 80 06 00 01 00 00 40 00
00> Get Descriptor Device
00> Queue EP 80 with 18 bytes ...
00> USBD Xfer Complete on EP 80 with 18 bytes
00> Queue EP 00 with 0 bytes ...
00> USBD Xfer Complete on EP 00 with 0 bytes
00>
00> USBD Setup Received 00 05 1A 00 00 00 00 00
00> Set Address
00> USBD Bus Reset : Full Speed
00>
00> USBD Setup Received 80 06 00 01 00 00 40 00
00> Get Descriptor Device
00> Queue EP 80 with 18 bytes ...
00> USBD Xfer Complete on EP 80 with 0 bytes
00> Queue EP 00 with 0 bytes ...
00> USBD Xfer Complete on EP 00 with 0 bytes
00> USBD Suspend : Remote Wakeup = 0
STM32F103C8T6 works right log:
00> USBD init
00> CDC init
00> VENDOR init
00> USBD Bus Reset : Full Speed
00>
00> USBD Setup Received 80 06 00 01 00 00 40 00
00> Get Descriptor Device
00> Queue EP 80 with 18 bytes ...
00> USBD Xfer Complete on EP 80 with 18 bytes
00> Queue EP 00 with 0 bytes ...
00> USBD Xfer Complete on EP 00 with 0 bytes
00>
00> USBD Setup Received 00 05 06 00 00 00 00 00
00> Set Address
00> USBD Xfer Complete on EP 80 with 0 bytes
00>
00> USBD Setup Received 80 06 00 01 00 00 12 00
00> Get Descriptor Device
00> Queue EP 80 with 18 bytes ...
00> USBD Xfer Complete on EP 80 with 18 bytes
00> Queue EP 00 with 0 bytes ...
00> USBD Xfer Complete on EP 00 with 0 bytes
00>
00> USBD Setup Received 80 06 00 02 00 00 FF 00
00> Get Descriptor Configuration[0]
00> Queue EP 80 with 64 bytes ...
00> USBD Xfer Complete on EP 80 with 64 bytes
00> Queue EP 80 with 34 bytes ...
00> USBD Xfer Complete on EP 80 with 34 bytes
00> Queue EP 00 with 0 bytes ...
00> USBD Xfer Complete on EP 00 with 0 bytes
00>
00> USBD Setup Received 80 06 00 0F 00 00 FF 00
00> Get Descriptor BOS
00> Queue EP 80 with 57 bytes ...
00> USBD Xfer Complete on EP 80 with 57 bytes
00> Queue EP 00 with 0 bytes ...
00> USBD Xfer Complete on EP 00 with 0 bytes
00>
00> USBD Setup Received C0 02 00 00 07 00 B2 00
00> Queue EP 80 with 64 bytes ...
00> USBD Xfer Complete on EP 80 with 64 bytes
00> Queue EP 80 with 64 bytes ...
00> USBD Xfer Complete on EP 80 with 64 bytes
00> Queue EP 80 with 50 bytes ...
00> USBD Xfer Complete on EP 80 with 50 bytes
00> VENDOR control complete
00> Queue EP 00 with 0 bytes ...
00> USBD Xfer Complete on EP 00 with 0 bytes
00>
00> USBD Setup Received 80 06 03 03 09 04 FF 00
00> Get Descriptor String[3]
00> Queue EP 80 with 14 bytes ...
00> USBD Xfer Complete on EP 80 with 14 bytes
00> Queue EP 00 with 0 bytes ...
00> USBD Xfer Complete on EP 00 with 0 bytes
00>
00> USBD Setup Received 80 06 00 03 00 00 FF 00
00> Get Descriptor String[0]
00> Queue EP 80 with 4 bytes ...
00> USBD Xfer Complete on EP 80 with 4 bytes
00> Queue EP 00 with 0 bytes ...
00> USBD Xfer Complete on EP 00 with 0 bytes
00>
00> USBD Setup Received 80 06 02 03 09 04 FF 00
00> Get Descriptor String[2]
00> Queue EP 80 with 30 bytes ...
00> USBD Xfer Complete on EP 80 with 30 bytes
00> Queue EP 00 with 0 bytes ...
00> USBD Xfer Complete on EP 00 with 0 bytes
00>
00> USBD Setup Received 80 06 00 06 00 00 0A 00
00> Get Descriptor Device Qualifier
00> Stall EP0
00>
00> USBD Setup Received 00 09 01 00 00 00 00 00
00> Set Configuration
00> Open EP 81 with Size = 8
00> Open EP 02 with Size = 64
00> Open EP 82 with Size = 64
00> Queue EP 02 with 64 bytes ...
00> CDC opened
00> Bind EP 81 to driver id 0
00> Bind EP 02 to driver id 0
00> Bind EP 82 to driver id 0
00> Open EP 03 with Size = 64
00> Open EP 83 with Size = 64
00> Queue EP 03 with 64 bytes ...
00> VENDOR opened
00> Bind EP 03 to driver id 1
00> Bind EP 83 to driver id 1
00> Queue EP 80 with 0 bytes ...
00> USBD Xfer Complete on EP 80 with 0 bytes
00>
00> USBD Setup Received 80 06 04 03 09 04 04 00
00> Get Descriptor String[4]
00> Queue EP 80 with 4 bytes ...
00> USBD Xfer Complete on EP 80 with 4 bytes
00> Queue EP 00 with 0 bytes ...
00> USBD Xfer Complete on EP 00 with 0 bytes
00>
00> USBD Setup Received 80 06 04 03 09 04 18 00
00> Get Descriptor String[4]
00> Queue EP 80 with 24 bytes ...
00> USBD Xfer Complete on EP 80 with 24 bytes
00> Queue EP 00 with 0 bytes ...
00> USBD Xfer Complete on EP 00 with 0 bytes
00>
00> USBD Setup Received 80 06 05 03 09 04 04 00
00> Get Descriptor String[5]
00> Queue EP 80 with 4 bytes ...
00> USBD Xfer Complete on EP 80 with 4 bytes
00> Queue EP 00 with 0 bytes ...
00> USBD Xfer Complete on EP 00 with 0 bytes
00>
00> USBD Setup Received 80 06 05 03 09 04 1E 00
00> Get Descriptor String[5]
00> Queue EP 80 with 30 bytes ...
00> USBD Xfer Complete on EP 80 with 30 bytes
00> Queue EP 00 with 0 bytes ...
00> USBD Xfer Complete on EP 00 with 0 bytes
00>
00> USBD Setup Received 80 00 00 00 00 00 02 00
00> Get Status
00> Queue EP 80 with 2 bytes ...
00> USBD Xfer Complete on EP 80 with 2 bytes
00> Queue EP 00 with 0 bytes ...
00> USBD Xfer Complete on EP 00 with 0 bytes
00>
00> USBD Setup Received 80 06 04 03 09 04 04 00
00> Get Descriptor String[4]
00> Queue EP 80 with 4 bytes ...
00> USBD Xfer Complete on EP 80 with 4 bytes
00> Queue EP 00 with 0 bytes ...
00> USBD Xfer Complete on EP 00 with 0 bytes
00>
00> USBD Setup Received 80 06 04 03 09 04 18 00
00> Get Descriptor String[4]
00> Queue EP 80 with 24 bytes ...
00> USBD Xfer Complete on EP 80 with 24 bytes
00> Queue EP 00 with 0 bytes ...
00> USBD Xfer Complete on EP 00 with 0 bytes
00>
00> USBD Setup Received A1 21 00 00 00 00 07 00
00> CDC control request
00> Get Line Coding
00> Queue EP 80 with 7 bytes ...
00> USBD Xfer Complete on EP 80 with 7 bytes
00> CDC control complete
00> Queue EP 00 with 0 bytes ...
00> USBD Xfer Complete on EP 00 with 0 bytes
00>
00> USBD Setup Received 21 22 00 00 00 00 00 00
00> CDC control request
00> Queue EP 80 with 0 bytes ...
00> USBD Xfer Complete on EP 80 with 0 bytes
00> Set Control Line State: DTR = 0, RTS = 0
00>
00> USBD Setup Received 21 20 00 00 00 00 07 00
00> CDC control request
00> Set Line Coding
00> Queue EP 00 with 7 bytes ...
00> USBD Xfer Complete on EP 00 with 7 bytes
00> 0000: 00 C2 01 00 00 00 08 |.......|
00> CDC control complete
00> Queue EP 80 with 0 bytes ...
00> USBD Xfer Complete on EP 80 with 0 bytes
00>
00> USBD Setup Received A1 21 00 00 00 00 07 00
00> CDC control request
00> Get Line Coding
00> Queue EP 80 with 7 bytes ...
00> USBD Xfer Complete on EP 80 with 7 bytes
00> CDC control complete
00> Queue EP 00 with 0 bytes ...
00> USBD Xfer Complete on EP 00 with 0 bytes
These two log capture by the same develop envirment, except MCU changed.
Screenshots
this is captrued by usb analyser in hos

t
Beta Was this translation helpful? Give feedback.
All reactions