Open luftaquila opened 1 month ago
try to see if https://github.com/hathach/tinyusb/pull/2750 fix your issue
Well, I checked out to the fix-ch32v203-setup
and builded it, now it seems to be fail at the earlier stage of the initialization.
Now Device Manager shows Unknown USB Device (Device descriptor request failed)
, and TinyUSB log output is way shorter:
It seems like almost every transfer triggers the USBD Bus Reset.
If I keep retry, sometimes it goes a bit far and showed as USB Composite Device
with error. I think this is just a problem of timing that hosts resets the device.
When I checked out back to the master
branch and try it again, the result is same with the original issue.
Thank you for your support!
The most recent master that have merged fix-ch32v203-setup
still presents the issue.
This is the log output by the current master:
Operating System
Windows 11
Board
STM32F103C8T6 Blue Pill
Firmware
examples/device/cdc_msc
What happened ?
When put the USB to the host,
USB Mass Storage
device appears. But it refreshes few times, then marked error.As shown in the log output below, there are always 6 times MSC Inquery requests. And it always immediately triggers the
USBD Bus Reset
. No other SCSI calls are received at all. Just 6 inquery, and bus resets.While the device is marked error, Device Manager's
Bus reported device description
shows the correct desciption that I set in thetud_msc_inquiry_cb()
call.Windows reports the bus error:
How to reproduce ?
No OS, just call
tusb_init()
after all HAL init finishes. Then, calltud_task()
in infinite loop.Debug Log as txt file (LOG/CFG_TUSB_DEBUG=2)
log output
``` [03:33:51.749] tio v2.7 [03:33:51.750] Press ctrl-t q to quit [03:33:51.796] Connected USBD Suspend : Remote Wakeup = 0 USBD init on controller 0, Highspeed = 0 sizeof(usbd_device_t) = 52 sizeof(dcd_event_t) = 12 sizeof(tu_fifo_t) = 12 sizeof(tu_edpt_stream_t) = 24 CDC init MSC init USBD Bus Reset : Full Speed USBD Setup Received 80 06 00 01 00 00 40 00 Get Descriptor Device Queue EP 80 with 18 bytes ... USBD Xfer Complete on EP 80 with 18 bytes Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Bus Reset : Full Speed USBD Setup Received 00 05 69 00 00 00 00 00 Set Address USBD Xfer Complete on EP 80 with 0 bytes USBD Setup Received 80 06 00 01 00 00 12 00 Get Descriptor Device Queue EP 80 with 18 bytes ... USBD Xfer Complete on EP 80 with 18 bytes Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Setup Received 80 06 00 02 00 00 FF 00 Get Descriptor Configuration[0] Queue EP 80 with 64 bytes ... USBD Xfer Complete on EP 80 with 64 bytes Queue EP 80 with 34 bytes ... USBD Xfer Complete on EP 80 with 34 bytes Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Setup Received 80 06 03 03 09 04 FF 00 Get Descriptor String[3] Queue EP 80 with 34 bytes ... USBD Xfer Complete on EP 80 with 34 bytes Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Setup Received 80 06 00 03 00 00 FF 00 Get Descriptor String[0] Queue EP 80 with 4 bytes ... USBD Xfer Complete on EP 80 with 4 bytes Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Setup Received 80 06 02 03 09 04 FF 00 Get Descriptor String[2] Queue EP 80 with 16 bytes ... USBD Xfer Complete on EP 80 with 16 bytes Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Setup Received 80 06 00 06 00 00 0A 00 Get Descriptor Device Qualifier Stall EP0 USBD Setup Received 80 06 00 01 00 00 12 00 Get Descriptor Device Queue EP 80 with 18 bytes ... USBD Xfer Complete on EP 80 with 18 bytes Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Setup Received 80 06 00 02 00 00 09 00 Get Descriptor Configuration[0] Queue EP 80 with 9 bytes ... USBD Xfer Complete on EP 80 with 9 bytes Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Setup Received 80 06 00 02 00 00 62 00 Get Descriptor Configuration[0] Queue EP 80 with 64 bytes ... USBD Xfer Complete on EP 80 with 64 bytes Queue EP 80 with 34 bytes ... USBD Xfer Complete on EP 80 with 34 bytes Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Setup Received 00 09 01 00 00 00 00 00 Set Configuration Open EP 81 with Size = 8 Open EP 02 with Size = 64 Open EP 82 with Size = 64 Queue EP 02 with 64 bytes ... CDC opened Bind EP 81 to driver id 0 Bind EP 02 to driver id 0 Bind EP 82 to driver id 0 Open EP 03 with Size = 64 Open EP 83 with Size = 64 Queue EP 03 with 31 bytes ... MSC opened Bind EP 03 to driver id 1 Bind EP 83 to driver id 1 Queue EP 80 with 0 bytes ... USBD Xfer Complete on EP 80 with 0 bytes USBD Setup Received 80 06 04 03 09 04 04 00 Get Descriptor String[4] Queue EP 80 with 4 bytes ... USBD Xfer Complete on EP 80 with 4 bytes Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Setup Received 80 06 00 03 00 00 FF 00 Get Descriptor String[0] Queue EP 80 with 4 bytes ... USBD Xfer Complete on EP 80 with 4 bytes Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Setup Received 80 06 04 03 09 04 18 00 Get Descriptor String[4] Queue EP 80 with 24 bytes ... USBD Xfer Complete on EP 80 with 24 bytes Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Setup Received 80 06 00 03 00 00 FF 00 Get Descriptor String[0] Queue EP 80 with 4 bytes ... USBD Xfer Complete on EP 80 with 4 bytes Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Setup Received 80 06 05 03 09 04 04 00 Get Descriptor String[5] Queue EP 80 with 4 bytes ... USBD Xfer Complete on EP 80 with 4 bytes Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Setup Received 80 06 00 03 00 00 FF 00 Get Descriptor String[0] Queue EP 80 with 4 bytes ... USBD Xfer Complete on EP 80 with 4 bytes Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Setup Received 80 06 05 03 09 04 18 00 Get Descriptor String[5] Queue EP 80 with 24 bytes ... USBD Xfer Complete on EP 80 with 24 bytes Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Setup Received 80 06 01 03 09 04 FF 00 Get Descriptor String[1] Queue EP 80 with 16 bytes ... USBD Xfer Complete on EP 80 with 16 bytes Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Setup Received 80 06 01 03 09 04 FF 00 Get Descriptor String[1] Queue EP 80 with 16 bytes ... USBD Xfer Complete on EP 80 with 16 bytes Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Setup Received A1 21 00 00 00 00 07 00 CDC control request Get Line Coding Queue EP 80 with 7 bytes ... USBD Xfer Complete on EP 80 with 7 bytes CDC control complete Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Setup Received 80 06 01 03 09 04 FF 00 Get Descriptor String[1] Queue EP 80 with 16 bytes ... USBD Xfer Complete on EP 80 with 16 bytes Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Setup Received 21 22 00 00 00 00 00 00 CDC control request Queue EP 80 with 0 bytes ... USBD Xfer Complete on EP 80 with 0 bytes Set Control Line State: DTR = 0, RTS = 0 USBD Setup Received 80 06 02 03 09 04 FF 00 Get Descriptor String[2] Queue EP 80 with 16 bytes ... USBD Xfer Complete on EP 80 with 16 bytes Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Setup Received 21 20 00 00 00 00 07 00 CDC control request Set Line Coding Queue EP 00 with 7 bytes ... USBD Xfer Complete on EP 00 with 7 bytes 0000: 00 C2 01 00 00 00 08 |.......| CDC control complete Queue EP 80 with 0 bytes ... USBD Xfer Complete on EP 80 with 0 bytes USBD Setup Received 80 06 02 03 09 04 FF 00 Get Descriptor String[2] Queue EP 80 with 16 bytes ... USBD Xfer Complete on EP 80 with 16 bytes Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Setup Received A1 21 00 00 00 00 07 00 CDC control request Get Line Coding Queue EP 80 with 7 bytes ... USBD Xfer Complete on EP 80 with 7 bytes CDC control complete Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Setup Received 80 06 02 03 09 04 FF 00 Get Descriptor String[2] Queue EP 80 with 16 bytes ... USBD Xfer Complete on EP 80 with 16 bytes Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Setup Received 80 06 00 03 00 00 02 00 Get Descriptor String[0] Queue EP 80 with 2 bytes ... USBD Xfer Complete on EP 80 with 2 bytes Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Setup Received 80 06 00 03 00 00 04 00 Get Descriptor String[0] Queue EP 80 with 4 bytes ... USBD Xfer Complete on EP 80 with 4 bytes Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Setup Received 80 06 03 03 09 04 02 00 Get Descriptor String[3] Queue EP 80 with 2 bytes ... USBD Xfer Complete on EP 80 with 2 bytes Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Setup Received 80 06 03 03 09 04 22 00 Get Descriptor String[3] Queue EP 80 with 34 bytes ... USBD Xfer Complete on EP 80 with 34 bytes Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Setup Received A1 FE 00 00 02 00 01 00 MSC control request MSC Get Max Lun Queue EP 80 with 1 bytes ... USBD Xfer Complete on EP 80 with 1 bytes MSC control complete Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Xfer Complete on EP 03 with 31 bytes MSC xfer callback SCSI Command [Lun0]: Inquiry Queue EP 83 with 36 bytes ... USBD Bus Reset : Full Speed USBD Setup Received 80 06 00 01 00 00 40 00 Get Descriptor Device Queue EP 80 with 18 bytes ... USBD Xfer Complete on EP 80 with 18 bytes Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD80 with 18 bytes Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Setup Received 00 09 01 00 00 00 00 00 Set Configuration Open EP 81 with Size = 8 Open EP 02 with Size = 64 Open EP 82 with Size = 64 Queue EP 02 with 64 bytes ... CDC opened Bind EP 81 to driver id 0 Bind EP 02 to driver id 0 Bind EP 82 to driver id 0 Open EP 03 with Size = 64 Open EP 83 with Size = 64 Queue EP 03 with 31 bytes ... MSC opened Bind EP 03 to driver id 1 Bind EP 83 to driver id 1 Queue EP 80 with 0 bytes ... USBD Xfer Complete on EP 80 with 0 bytes USBD Xfer Complete on EP 03 with 31 bytes MSC xfer callback SCSI Command [Lun0]: Inquiry Queue EP 83 with 36 bytes ... USBD Bus Reset : Full Speed USBD Bus Reset : Full Speed USBD Setup Received 80 06 00 01 00 00 40 00 Get Descriptor Device Queue EP 80 with 18 bytes ... USBD Xfer Complete on EP 80 with 18 bytes Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Bus Reset : Full Speed USBD Setup Received 00 05 69 00 00 00 00 00 Set Address USBD Xfer Complete on EP 80 with 0 bytes USBD Setup Received 80 06 00 01 00 00 12 00 Get Descriptor Device Queue EP 80 with 18 bytes ... USBD Xfer Complete on EP 80 with 18 bytes Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Setup Received 00 09 01 00 00 00 00 00 Set Configuration Open EP 81 with Size = 8 Open EP 02 with Size = 64 Open EP 82 with Size = 64 Queue EP 02 with 64 bytes ... CDC opened Bind EP 81 to driver id 0 Bind EP 02 to driver id 0 Bind EP 82 to driver id 0 Open EP 03 with Size = 64 Open EP 83 with Size = 64 Queue EP 03 with 31 bytes ... MSC opened Bind EP 03 to driver id 1 Bind EP 83 to driver id 1 Queue EP 80 with 0 bytes ... USBD Xfer Complete on EP 80 with 0 bytes USBD Xfer Complete on EP 03 with 31 bytes MSC xfer callback SCSI Command [Lun0]: Inquiry Queue EP 83 with 36 bytes ... USBD Bus Reset : Full Speed USBD Setup Received 80 06 00 01 00 00 40 00 Get Descriptor Device Queue EP 80 with 18 bytes ... USBD Xfer Complete on EP 80 with 18 bytes Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Bus Reset : Full Speed USBD Setup Received 00 05 69 00 00 00 00 00 Set Address USBD Xfer Complete on EP 80 with 0 bytes USBD Setup Received 80 06 00 01 00 00 12 00 Get Descriptor Device Queue EP 80 with 18 bytes ... USBD Xfer Complete on EP 80 with 18 bytes Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Setup Received 00 09 01 00 00 00 00 00 Set Configuration Open EP 81 with Size = 8 Open EP 02 with Size = 64 Open EP 82 with Size = 64 Queue EP 02 with 64 bytes ... CDC opened Bind EP 81 to driver id 0 Bind EP 02 to driver id 0 Bind EP 82 to driver id 0 Open EP 03 with Size = 64 Open EP 83 with Size = 64 Queue EP 03 with 31 bytes ... MSC opened Bind EP 03 to driver id 1 Bind EP 83 to driver id 1 Queue EP 80 with 0 bytes ... USBD Xfer Complete on EP 80 with 0 bytes USBD Xfer Complete on EP 03 with 31 bytes MSC xfer callback SCSI Command [Lun0]: Inquiry Queue EP 83 with 36 bytes ... USBD Bus Reset : Full Speed USBD Setup Received 80 06 00 01 00 00 40 00 Get Descriptor Device Queue EP 80 with 18 bytes ... USBD Xfer Complete on EP 80 with 18 bytes Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Bus Reset : Full Speed USBD Setup Received 00 05 69 00 00 00 00 00 Set Address USBD Xfer Complete on EP 80 with 0 bytes USBD Setup Received 80 06 00 01 00 00 12 00 Get Descriptor Device Queue EP 80 with 18 bytes ... USBD Xfer Complete on EP 80 with 18 bytes Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Setup Received 00 09 01 00 00 00 00 00 Set Configuration Open EP 81 with Size = 8 Open EP 02 with Size = 64 Open EP 82 with Size = 64 Queue EP 02 with 64 bytes ... CDC opened Bind EP 81 to driver id 0 Bind EP 02 to driver id 0 Bind EP 82 to driver id 0 Open EP 03 with Size = 64 Open EP 83 with Size = 64 Queue EP 03 with 31 bytes ... MSC opened Bind EP 03 to driver id 1 Bind EP 83 to driver id 1 Queue EP 80 with 0 bytes ... USBD Xfer Complete on EP 80 with 0 bytes USBD Xfer Complete on EP 03 with 31 bytes MSC xfer callback SCSI Command [Lun0]: Inquiry Queue EP 83 with 36 bytes ... USBD Bus Reset : Full Speed USBD Bus Reset : Full Speed USBD Setup Received 80 06 00 01 00 00 40 00 Get Descriptor Device Queue EP 80 with 18 bytes ... USBD Xfer Complete on EP 80 with 18 bytes Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Bus Reset : Full Speed USBD Setup Received 00 05 69 00 00 00 00 00 Set Address USBD Xfer Complete on EP 80 with 0 bytes USBD Setup Received 80 06 00 01 00 00 12 00 Get Descriptor Device Queue EP 80 with 18 bytes ... USBD Xfer Complete on EP 80 with 18 bytes Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Setup Received 00 09 01 00 00 00 00 00 Set Configuration Open EP 81 with Size = 8 Open EP 02 with Size = 64 Open EP 82 with Size = 64 Queue EP 02 with 64 bytes ... CDC opened Bind EP 81 to driver id 0 Bind EP 02 to driver id 0 Bind EP 82 to driver id 0 Open EP 03 with Size = 64 Open EP 83 with Size = 64 Queue EP 03 with 31 bytes ... MSC opened Bind EP 03 to driver id 1 Bind EP 83 to driver id 1 Queue EP 80 with 0 bytes ... USBD Xfer Complete on EP 80 with 0 bytes USBD Xfer Complete on EP 03 with 31 bytes MSC xfer callback SCSI Command [Lun0]: Inquiry Queue EP 83 with 36 bytes ... USBD Bus Reset : Full Speed USBD Setup Received 80 06 00 01 00 00 40 00 Get Descriptor Device Queue EP 80 with 18 bytes ... USBD Xfer Complete on EP 80 with 18 bytes Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Bus Reset : Full Speed USBD Setup Received 00 05 69 00 00 00 00 00 Set Address USBD Xfer Complete on EP 80 with 0 bytes USBD Setup Received 80 06 00 01 00 00 12 00 Get Descriptor Device Queue EP 80 with 18 bytes ... USBD Xfer Complete on EP 80 with 18 bytes Queue EP 00 with 0 bytes ... USBD Xfer Complete on EP 00 with 0 bytes USBD Setup Received 00 09 01 00 00 00 00 00 Set Configuration Open EP 81 with Size = 8 Open EP 02 with Size = 64 Open EP 82 with Size = 64 Queue EP 02 with 64 bytes ... CDC opened Bind EP 81 to driver id 0 Bind EP 02 to driver id 0 Bind EP 82 to driver id 0 Open EP 03 with Size = 64 Open EP 83 with Size = 64 Queue EP 03 with 31 bytes ... MSC opened Bind EP 03 to driver id 1 Bind EP 83 to driver id 1 Queue EP 80 with 0 bytes ... USBD Xfer Complete on EP 80 with 0 bytes ```Screenshots
No response
I have checked existing issues, dicussion and documentation