sipeed / M0S_BL616_example

M0S BL616 example (M0S dock)
Apache License 2.0
32 stars 8 forks source link

M0S_BL616_example\sipeed\solutions\usbd_cdc_acm_with_uart enumeration issue / missing string descriptors #9

Open bvernoux opened 1 year ago

bvernoux commented 1 year ago

On my "Sipeed M0S Dock" I have built & flashed the example M0S_BL616_example\sipeed\solutions\usbd_cdc_acm_with_uart There is an issue during enumeration which is not working correctly to retrieve iManufacturer / iProduct & iSerialNumber string descriptors.

Same issue for the 3 string descriptors:

iManufacturer            : 0x01 (String Descriptor 1)
 *!*ERROR  String descriptor not found
iProduct                 : 0x02 (String Descriptor 2)
 *!*ERROR  String descriptor not found
iSerialNumber            : 0x03 (String Descriptor 3)
 *!*ERROR  String descriptor not found

The issue is this sample does not work correctly most of the time even when the enumeration does not return an error from the OS... See similar issue https://github.com/sipeed/M0S_BL616_example/issues/3

See full details captured with USB Device Tree Viewer V3.8.9 (https://www.uwe-sieber.de/usbtreeview_e.html)

  =========================== USB Port2 ===========================

Connection Status        : 0x01 (Device is connected)
Port Chain               : 4-2
Properties               : 0x01
 IsUserConnectable       : yes
 PortIsDebugCapable      : no
 PortHasMultiCompanions  : no
 PortConnectorIsTypeC    : no
ConnectionIndex          : 0x02 (Port 2)
CompanionIndex           : 0
 CompanionHubSymLnk      : USB#ROOT_HUB30#5&b222599&0&0#{f18a0e88-c30c-11d0-8815-00a0c906bed8}
 CompanionPortNumber     : 0x04 (Port 4)
 -> CompanionPortChain   : 4-4

      ========================== Summary =========================
Vendor ID                : 0x359F (Shenzhen Sipeed Technology Co., Ltd)
Product ID               : 0x0000
USB Version              : 2.0
Port maximum Speed       : High-Speed (Companion Port 4-4 supports SuperSpeed)
Device maximum Speed     : High-Speed
Device Connection Speed  : High-Speed
Self powered             : no
Demanded Current         : 100 mA
Used Endpoints           : 4

      ======================== USB Device ========================

        +++++++++++++++++ Device Information ++++++++++++++++++
Device Description       : USB Composite Device
Device Path              : \\?\USB#VID_359F&PID_0000#2023030911#{a5dcbf10-6530-11d2-901f-00c04fb951ed} (GUID_DEVINTERFACE_USB_DEVICE)
Kernel Name              : \Device\USBPDO-19
Device ID                : USB\VID_359F&PID_0000\2023030911
Hardware IDs             : USB\VID_359F&PID_0000&REV_0100 USB\VID_359F&PID_0000
Driver KeyName           : {36fc9e60-c465-11cf-8056-444553540000}\0027 (GUID_DEVCLASS_USB)
Driver                   : \SystemRoot\System32\drivers\usbccgp.sys (Version: 10.0.22621.1194  Date: 2023-05-04)
Driver Inf               : C:\windows\inf\usb.inf
Legacy BusType           : PNPBus
Class                    : USB
Class GUID               : {36fc9e60-c465-11cf-8056-444553540000} (GUID_DEVCLASS_USB)
Service                  : usbccgp
Enumerator               : USB
Location Info            : Port_#0002.Hub_#0002
Location IDs             : PCIROOT(0)#PCI(0801)#PCI(0004)#USBROOT(0)#USB(2), ACPI(_SB_)#ACPI(PCI0)#ACPI(GP17)#ACPI(XHC1)#ACPI(RHUB)#ACPI(PRT2)
Container ID             : {39ab554a-b7cf-5cf0-b6dd-d27c9fbd8cd0}
Manufacturer Info        : (Standard USB Host Controller)
Capabilities             : 0x94 (Removable, UniqueID, SurpriseRemovalOK)
Status                   : 0x0180600A (DN_DRIVER_LOADED, DN_STARTED, DN_DISABLEABLE, DN_REMOVABLE, DN_NT_ENUMERATOR, DN_NT_DRIVER)
Problem Code             : 0
Address                  : 2
Power State              : D0 (supported: D0, D3, wake from D0)
 Child Device 1          : USB Serial Device (COM13)
  Device Path            : \\?\USB#VID_359F&PID_0000&MI_00#7&1101bd3a&0&0000#{86e0d1e0-8089-11d0-9ce4-08003e301f73} (GUID_DEVINTERFACE_COMPORT)
  Kernel Name            : \Device\000000c9
  Device ID              : USB\VID_359F&PID_0000&MI_00\7&1101BD3A&0&0000
  Class                  : Ports
  Driver KeyName         : {4d36e978-e325-11ce-bfc1-08002be10318}\0007 (GUID_DEVCLASS_PORTS)
  Service                : usbser
  Location               : 006c.0000.0004.002.000.000.000.000.000
  LocationPaths          : PCIROOT(0)#PCI(0801)#PCI(0004)#USBROOT(0)#USB(2)#USBMI(0)  PCIROOT(0)#PCI(0801)#PCI(0004)#USBROOT(0)#USB(2)#USB(2)  ACPI(_SB_)#ACPI(PCI0)#ACPI(GP17)#ACPI(XHC1)#ACPI(RHUB)#ACPI(PRT2)#USBMI(0)  ACPI(_SB_)#ACPI(PCI0)#ACPI(GP17)#ACPI(XHC1)#ACPI(RHUB)#ACPI(PRT2)#USB(2)
  COM-Port               : COM13 (\Device\USBSER000)

        +++++++++++++++++ Registry USB Flags +++++++++++++++++
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\usbflags\359F00000100
 osvc                    : REG_BINARY 00 00

        ---------------- Connection Information ---------------
Connection Index         : 0x02 (Port 2)
Connection Status        : 0x01 (DeviceConnected)
Current Config Value     : 0x01 (Configuration 1)
Device Address           : 0x01 (1)
Is Hub                   : 0x00 (no)
Device Bus Speed         : 0x02 (High-Speed)
Number Of Open Pipes     : 0x03 (3 pipes to data endpoints)
Pipe[0]                  : EndpointID=3  Direction=IN   ScheduleOffset=0  Type=Interrupt  wMaxPacketSize=0x8     bInterval=16  -> 196 Bits/ms = 24500 Bytes/s
Pipe[1]                  : EndpointID=2  Direction=OUT  ScheduleOffset=0  Type=Bulk       wMaxPacketSize=0x200   bInterval=0  
Pipe[2]                  : EndpointID=1  Direction=IN   ScheduleOffset=0  Type=Bulk       wMaxPacketSize=0x200   bInterval=0  
Data (HexDump)           : 02 00 00 00 12 01 00 02 EF 02 01 40 9F 35 00 00   ...........@.5..
                           00 01 01 02 03 01 01 02 00 01 00 03 00 00 00 01   ................
                           00 00 00 07 05 83 03 08 00 10 00 00 00 00 07 05   ................
                           02 02 00 02 00 00 00 00 00 07 05 81 02 00 02 00   ................
                           00 00 00 00                                       ....

        --------------- Connection Information V2 -------------
Connection Index         : 0x02 (2)
Length                   : 0x10 (16 bytes)
SupportedUsbProtocols    : 0x03
 Usb110                  : 1 (yes, port supports USB 1.1)
 Usb200                  : 1 (yes, port supports USB 2.0)
 Usb300                  : 0 (no, port not supports USB 3.0) -> but Companion Port 4-4 does
 ReservedMBZ             : 0x00
Flags                    : 0x00
 DevIsOpAtSsOrHigher     : 0 (Device is not operating at SuperSpeed or higher)
 DevIsSsCapOrHigher      : 0 (Device is not SuperSpeed capable or higher)
 DevIsOpAtSsPlusOrHigher : 0 (Device is not operating at SuperSpeedPlus or higher)
 DevIsSsPlusCapOrHigher  : 0 (Device is not SuperSpeedPlus capable or higher)
 ReservedMBZ             : 0x00
Data (HexDump)           : 02 00 00 00 10 00 00 00 03 00 00 00 00 00 00 00   ................

    ---------------------- Device Descriptor ----------------------
bLength                  : 0x12 (18 bytes)
bDescriptorType          : 0x01 (Device Descriptor)
bcdUSB                   : 0x200 (USB Version 2.0)
bDeviceClass             : 0xEF (Miscellaneous)
bDeviceSubClass          : 0x02
bDeviceProtocol          : 0x01 (IAD - Interface Association Descriptor)
bMaxPacketSize0          : 0x40 (64 bytes)
idVendor                 : 0x359F (Shenzhen Sipeed Technology Co., Ltd)
idProduct                : 0x0000
bcdDevice                : 0x0100
iManufacturer            : 0x01 (String Descriptor 1)
 *!*ERROR  String descriptor not found
iProduct                 : 0x02 (String Descriptor 2)
 *!*ERROR  String descriptor not found
iSerialNumber            : 0x03 (String Descriptor 3)
 *!*ERROR  String descriptor not found
bNumConfigurations       : 0x01 (1 Configuration)
Data (HexDump)           : 12 01 00 02 EF 02 01 40 9F 35 00 00 00 01 01 02   .......@.5......
                           03 01                                             ..

    ------------------ Configuration Descriptor -------------------
bLength                  : 0x09 (9 bytes)
bDescriptorType          : 0x02 (Configuration Descriptor)
wTotalLength             : 0x004B (75 bytes)
bNumInterfaces           : 0x02 (2 Interfaces)
bConfigurationValue      : 0x01 (Configuration 1)
iConfiguration           : 0x00 (No String Descriptor)
bmAttributes             : 0x80
 D7: Reserved, set 1     : 0x01
 D6: Self Powered        : 0x00 (no)
 D5: Remote Wakeup       : 0x00 (no)
 D4..0: Reserved, set 0  : 0x00
MaxPower                 : 0x32 (100 mA)
Data (HexDump)           : 09 02 4B 00 02 01 00 80 32 08 0B 00 02 02 02 01   ..K.....2.......
                           00 09 04 00 00 01 02 02 01 02 05 24 00 10 01 05   ...........$....
                           24 01 00 01 04 24 02 02 05 24 06 00 01 07 05 83   $....$...$......
                           03 08 00 10 09 04 01 00 02 0A 00 00 00 07 05 02   ................
                           02 00 02 00 07 05 81 02 00 02 00                  ...........

        ------------------- IAD Descriptor --------------------
bLength                  : 0x08 (8 bytes)
bDescriptorType          : 0x0B (Interface Association Descriptor)
bFirstInterface          : 0x00 (Interface 0)
bInterfaceCount          : 0x02 (2 Interfaces)
bFunctionClass           : 0x02 (Communications and CDC Control)
bFunctionSubClass        : 0x02
bFunctionProtocol        : 0x01
iFunction                : 0x00 (No String Descriptor)
Data (HexDump)           : 08 0B 00 02 02 02 01 00                           ........

        ---------------- Interface Descriptor -----------------
bLength                  : 0x09 (9 bytes)
bDescriptorType          : 0x04 (Interface Descriptor)
bInterfaceNumber         : 0x00 (Interface 0)
bAlternateSetting        : 0x00
bNumEndpoints            : 0x01 (1 Endpoint)
bInterfaceClass          : 0x02 (Communications and CDC Control)
bInterfaceSubClass       : 0x02 (Abstract Control Model)
bInterfaceProtocol       : 0x01 (AT Commands defined by ITU-T V.250 etc)
iInterface               : 0x02 (String Descriptor 2)
 *!*ERROR  String descriptor not found
Data (HexDump)           : 09 04 00 00 01 02 02 01 02                        .........

        -------------- CDC Interface Descriptor ---------------
bFunctionLength          : 0x05 (5 bytes)
bDescriptorType          : 0x24 (Interface)
bDescriptorSubType       : 0x00 (Header Functional Descriptor)
bcdCDC                   : 0x110 (CDC Version 1.10)
Data (HexDump)           : 05 24 00 10 01                                    .$...

        -------------- CDC Interface Descriptor ---------------
bFunctionLength          : 0x05 (5 bytes)
bDescriptorType          : 0x24 (Interface)
bDescriptorSubType       : 0x01 (Call Management Functional Descriptor)
bmCapabilities           : 0x00
 D7..2                   : 0x00 (Reserved)
 D1                      : 0x00 (sends/receives call management information only over the Communication Class interface)
 D0                      : 0x00 (does not handle call management itself)
bDataInterface           : 0x01
Data (HexDump)           : 05 24 01 00 01                                    .$...

        -------------- CDC Interface Descriptor ---------------
bFunctionLength          : 0x04 (4 bytes)
bDescriptorType          : 0x24 (Interface)
bDescriptorSubType       : 0x02 (Abstract Control Management Functional Descriptor)
bmCapabilities           : 0x02
 D7..4                   : 0x00 (Reserved)
 D3                      : 0x00 (not supports the notification Network_Connection)
 D2                      : 0x00 (not supports the request Send_Break)
 D1                      : 0x01 (supports the request combination of Set_Line_Coding, Set_Control_Line_State, Get_Line_Coding, and the notification Serial_State)
 D0                      : 0x00 (not supports the request combination of Set_Comm_Feature, Clear_Comm_Feature, and Get_Comm_Feature)
Data (HexDump)           : 04 24 02 02                                       .$..

        -------------- CDC Interface Descriptor ---------------
bFunctionLength          : 0x05 (5 bytes)
bDescriptorType          : 0x24 (Interface)
bDescriptorSubType       : 0x06 (Union Functional Descriptor)
bControlInterface        : 0x00
bSubordinateInterface[0] : 0x01
Data (HexDump)           : 05 24 06 00 01                                    .$...

        ----------------- Endpoint Descriptor -----------------
bLength                  : 0x07 (7 bytes)
bDescriptorType          : 0x05 (Endpoint Descriptor)
bEndpointAddress         : 0x83 (Direction=IN EndpointID=3)
bmAttributes             : 0x03 (TransferType=Interrupt)
wMaxPacketSize           : 0x0008
 Bits 15..13             : 0x00 (reserved, must be zero)
 Bits 12..11             : 0x00 (0 additional transactions per microframe -> allows 1..1024 bytes per packet)
 Bits 10..0              : 0x08 (8 bytes per packet)
bInterval                : 0x10 (32768 microframes -> 4096 ms)
Data (HexDump)           : 07 05 83 03 08 00 10                              .......

        ---------------- Interface Descriptor -----------------
bLength                  : 0x09 (9 bytes)
bDescriptorType          : 0x04 (Interface Descriptor)
bInterfaceNumber         : 0x01 (Interface 1)
bAlternateSetting        : 0x00
bNumEndpoints            : 0x02 (2 Endpoints)
bInterfaceClass          : 0x0A (CDC-Data)
bInterfaceSubClass       : 0x00
bInterfaceProtocol       : 0x00
iInterface               : 0x00 (No String Descriptor)
Data (HexDump)           : 09 04 01 00 02 0A 00 00 00                        .........

        ----------------- Endpoint Descriptor -----------------
bLength                  : 0x07 (7 bytes)
bDescriptorType          : 0x05 (Endpoint Descriptor)
bEndpointAddress         : 0x02 (Direction=OUT EndpointID=2)
bmAttributes             : 0x02 (TransferType=Bulk)
wMaxPacketSize           : 0x0200 (max 512 bytes)
bInterval                : 0x00 (never NAKs)
Data (HexDump)           : 07 05 02 02 00 02 00                              .......

        ----------------- Endpoint Descriptor -----------------
bLength                  : 0x07 (7 bytes)
bDescriptorType          : 0x05 (Endpoint Descriptor)
bEndpointAddress         : 0x81 (Direction=IN EndpointID=1)
bmAttributes             : 0x02 (TransferType=Bulk)
wMaxPacketSize           : 0x0200 (max 512 bytes)
bInterval                : 0x00 (never NAKs)
Data (HexDump)           : 07 05 81 02 00 02 00                              .......

    --------- Device Qualifier Descriptor (for Full-Speed) --------
bLength                  : 0x0A (10 bytes)
bDescriptorType          : 0x06 (Device_qualifier Descriptor)
bcdUSB                   : 0x200 (USB Version 2.00)
bDeviceClass             : 0x02 (Communications and CDC Control)
bDeviceSubClass          : 0x02
bDeviceProtocol          : 0x01 (AT Commands defined by ITU-T V.250 etc)
bMaxPacketSize0          : 0x40 (64 Bytes)
bNumConfigurations       : 0x01 (1 other-speed configuration)
bReserved                : 0x00
Data (HexDump)           : 0A 06 00 02 02 02 01 40 01 00                     .......@..

      -------------------- String Descriptors -------------------
none