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

Question: should it see all USB devices connected whether or not it can interface to them? #811

Open
DrJaymz opened this issue May 1, 2024 · 1 comment

Comments

@DrJaymz
Copy link

DrJaymz commented May 1, 2024

In a previous post I have it working and I have two devices that emulate a keyboard for the purposes of reading magnetic cards. One doesn't appear to be picked up, the other works perfectly. The problem is that when supplied I don't know which I'm going to get so ideally it needs to work with both. When connecting the one that doesn't work it doesn't appear to see anything. But pretty much every USB device I plugged in does get detected.

Using USB Dev Tree Viewer below are both. I thought it was to do with full-speed but they are both full speed, the non-detected one.
On the off chance its power related I will try to rule that out. Both have slightly different child devices.

https://www.diffchecker.com/e7vkfFGc/ <-- easier to see here.

  =========================== USB Port1 ===========================

Connection Status        : 0x01 (Device is connected)
Port Chain               : 1-5-1
Properties               : 0x01
 IsUserConnectable       : yes
 PortIsDebugCapable      : no
 PortHasMultiCompanions  : no
 PortConnectorIsTypeC    : no
ConnectionIndex          : 0x01 (Port 1)
CompanionIndex           : 0
 CompanionHubSymLnk      : USB#VID_2109&PID_0813#5&873c117&0&21#{f18a0e88-c30c-11d0-8815-00a0c906bed8}
 CompanionPortNumber     : 0x01 (Port 1)
 -> CompanionPortChain   : 1-21-1

      ========================== Summary =========================
Vendor ID                : 0xFFFF (Taiwan OEM - OBSOLETE)
Product ID               : 0x0035
USB Version              : 2.00 -> wrong, Device is Full-Speed only
Port maximum Speed       : High-Speed (Companion Port 1-21-1 supports SuperSpeed)
Device maximum Speed     : Full-Speed
Device Connection Speed  : Full-Speed
Self powered             : no
Demanded Current         : 500 mA
Used Endpoints           : 2

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

        +++++++++++++++++ Device Information ++++++++++++++++++
Device Description       : USB Composite Device
Device Path              : \\?\USB#VID_FFFF&PID_0035#00000000011C#{a5dcbf10-6530-11d2-901f-00c04fb951ed} (GUID_DEVINTERFACE_USB_DEVICE)
Kernel Name              : \Device\USBPDO-15
Device ID                : USB\VID_FFFF&PID_0035\00000000011C
Hardware IDs             : USB\VID_FFFF&PID_0035&REV_0200 USB\VID_FFFF&PID_0035
Driver KeyName           : {36fc9e60-c465-11cf-8056-444553540000}\0026 (GUID_DEVCLASS_USB)
Driver                   : \SystemRoot\System32\drivers\usbccgp.sys (Version: 10.0.22621.3155  Date: 2024-02-16)
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_#0001.Hub_#0004
Location IDs             : PCIROOT(0)#PCI(1400)#USBROOT(0)#USB(5)#USB(1), ACPI(_SB_)#ACPI(PCI0)#ACPI(XHC_)#ACPI(RHUB)#ACPI(HS05)#USB(1)
Container ID             : {907b9a10-efb6-5287-9ff9-e0207c7192b2}
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                  : 1
HcDisableSelectiveSuspend: 0
EnableSelectiveSuspend   : 0
SelectiveSuspendEnabled  : 0
EnhancedPowerMgmtEnabled : 0
IdleInWorkingState       : 0
WakeFromSleepState       : 0
Power State              : D0 (supported: D0, D1, D2, D3, wake from D0, wake from D1, wake from D2)
 Child Device 1          : USB Input Device
  Device ID              : USB\VID_FFFF&PID_0035&MI_00\7&20E1D4FB&1&0000
  Class                  : HIDClass
  Driver KeyName         : {745a17a0-74d3-11d0-b6fe-00a0c90f57da}\0039 (GUID_DEVCLASS_HIDCLASS)
  Service                : HidUsb
  Location               : 0000.0014.0000.005.001.000.000.000.000
  LocationPaths          : PCIROOT(0)#PCI(1400)#USBROOT(0)#USB(5)#USB(1)#USBMI(0)  PCIROOT(0)#PCI(1400)#USBROOT(0)#USB(5)#USB(1)#USB(1)  ACPI(_SB_)#ACPI(PCI0)#ACPI(XHC_)#ACPI(RHUB)#ACPI(HS05)#USB(1)#USBMI(0)  ACPI(_SB_)#ACPI(PCI0)#ACPI(XHC_)#ACPI(RHUB)#ACPI(HS05)#USB(1)#USB(1)
   Child Device 1        : HID Keyboard Device
    Device Path 1        : \\?\HID#VID_FFFF&PID_0035&MI_00#8&2892241d&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}\kbd (GUID_DEVINTERFACE_HID)
    Device Path 2        : \\?\HID#VID_FFFF&PID_0035&MI_00#8&2892241d&0&0000#{884b96c3-56ef-11d1-bc8c-00a0c91405dd} (GUID_DEVINTERFACE_KEYBOARD)
    Kernel Name          : \Device\000001b5
    Device ID            : HID\VID_FFFF&PID_0035&MI_00\8&2892241D&0&0000
    Class                : Keyboard
    Driver KeyName       : {4d36e96b-e325-11ce-bfc1-08002be10318}\0009 (GUID_DEVCLASS_KEYBOARD)
    Service              : kbdhid
 Child Device 2          : USB Input Device
  Device ID              : USB\VID_FFFF&PID_0035&MI_01\7&20E1D4FB&1&0001
  Class                  : HIDClass
  Driver KeyName         : {745a17a0-74d3-11d0-b6fe-00a0c90f57da}\0040 (GUID_DEVCLASS_HIDCLASS)
  Service                : HidUsb
  Location               : 0000.0014.0000.005.001.000.000.000.000
  LocationPaths          : PCIROOT(0)#PCI(1400)#USBROOT(0)#USB(5)#USB(1)#USBMI(1)  ACPI(_SB_)#ACPI(PCI0)#ACPI(XHC_)#ACPI(RHUB)#ACPI(HS05)#USB(1)#USBMI(1)
   Child Device 1        : HID-compliant vendor-defined device
    Device Path          : \\?\HID#VID_FFFF&PID_0035&MI_01#8&4bae65b&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030} (GUID_DEVINTERFACE_HID)
    Kernel Name          : \Device\000001b6
    Device ID            : HID\VID_FFFF&PID_0035&MI_01\8&4BAE65B&0&0000
    Class                : HIDClass
    Driver KeyName       : {745a17a0-74d3-11d0-b6fe-00a0c90f57da}\0041 (GUID_DEVCLASS_HIDCLASS)

        +++++++++++++++++ Registry USB Flags +++++++++++++++++
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\usbflags\FFFF00350200
 osvc                    : REG_BINARY 00 00
 NewInterfaceUsage       : REG_DWORD 00000000 (0)

        ---------------- Connection Information ---------------
Connection Index         : 0x01 (Port 1)
Connection Status        : 0x01 (DeviceConnected)
Current Config Value     : 0x01 (Configuration 1)
Device Address           : 0x21 (33)
Is Hub                   : 0x00 (no)
Device Bus Speed         : 0x01 (Full-Speed)
Number Of Open Pipes     : 0x01 (1 pipe to data endpoints)
Pipe[0]                  : EndpointID=1  Direction=IN   ScheduleOffset=0  Type=Interrupt  wMaxPacketSize=8    bInterval=2
Data (HexDump)           : 01 00 00 00 12 01 00 02 00 00 00 40 FF FF 35 00   [email protected].
                           00 02 01 02 03 01 01 01 00 21 00 01 00 00 00 01   .........!......
                           00 00 00 07 05 81 03 08 00 02 00 00 00 00         ..............

        --------------- Connection Information V2 -------------
Connection Index         : 0x01 (1)
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 1-21-1 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)           : 01 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.00) -> wrong, device is Full-Speed only
bDeviceClass             : 0x00 (defined by the interface descriptors)
bDeviceSubClass          : 0x00
bDeviceProtocol          : 0x00
bMaxPacketSize0          : 0x40 (64 bytes)
idVendor                 : 0xFFFF (Taiwan OEM - OBSOLETE)
idProduct                : 0x0035
bcdDevice                : 0x0200
iManufacturer            : 0x01 (String Descriptor 1)
 Language 0x0409         : "MEGAHUNT"
iProduct                 : 0x02 (String Descriptor 2)
 Language 0x0409         : "Megahunt HID FS Keyboard"
iSerialNumber            : 0x03 (String Descriptor 3)
 Language 0x0409         : "00000000011C"
bNumConfigurations       : 0x01 (1 Configuration)
Data (HexDump)           : 12 01 00 02 00 00 00 40 FF FF 35 00 00 02 01 02   [email protected].....
                           03 01                                             ..

    ------------------ Configuration Descriptor -------------------
bLength                  : 0x09 (9 bytes)
bDescriptorType          : 0x02 (Configuration Descriptor)
wTotalLength             : 0x0034 (52 bytes)
bNumInterfaces           : 0x02 (2 Interfaces)
bConfigurationValue      : 0x01 (Configuration 1)
iConfiguration           : 0x00 (No String Descriptor)
bmAttributes             : 0xA0
 D7: Reserved, set 1     : 0x01
 D6: Self Powered        : 0x00 (no)
 D5: Remote Wakeup       : 0x01 (yes)
 D4..0: Reserved, set 0  : 0x00
MaxPower                 : 0xFA (500 mA)
Data (HexDump)           : 09 02 34 00 02 01 00 A0 FA 09 04 00 00 01 03 01   ..4.............
                           01 00 09 21 10 01 00 01 22 42 00 07 05 81 03 08   ...!...."B......
                           00 02 09 04 01 00 00 03 00 00 00 09 21 10 01 00   ............!...
                           01 22 35 00                                       ."5.

        ---------------- Interface Descriptor -----------------
bLength                  : 0x09 (9 bytes)
bDescriptorType          : 0x04 (Interface Descriptor)
bInterfaceNumber         : 0x00 (Interface 0)
bAlternateSetting        : 0x00
bNumEndpoints            : 0x01 (1 Endpoint)
bInterfaceClass          : 0x03 (HID - Human Interface Device)
bInterfaceSubClass       : 0x01 (Boot Interface)
bInterfaceProtocol       : 0x01 (Keyboard)
iInterface               : 0x00 (No String Descriptor)
Data (HexDump)           : 09 04 00 00 01 03 01 01 00                        .........

        ------------------- HID Descriptor --------------------
bLength                  : 0x09 (9 bytes)
bDescriptorType          : 0x21 (HID Descriptor)
bcdHID                   : 0x0110 (HID Version 1.10)
bCountryCode             : 0x00 (00 = not localized)
bNumDescriptors          : 0x01
Data (HexDump)           : 09 21 10 01 00 01 22 42 00                        .!...."B.
Descriptor 1:
bDescriptorType          : 0x22 (Class=Report)
wDescriptorLength        : 0x0042 (66 bytes)
Error reading descriptor : ERROR_INVALID_PARAMETER (due to a obscure limitation of the Win32 USB API, see UsbTreeView.txt)

        ----------------- Endpoint Descriptor -----------------
bLength                  : 0x07 (7 bytes)
bDescriptorType          : 0x05 (Endpoint Descriptor)
bEndpointAddress         : 0x81 (Direction=IN EndpointID=1)
bmAttributes             : 0x03 (TransferType=Interrupt)
wMaxPacketSize           : 0x0008 (8 bytes)
bInterval                : 0x02 (2 ms)
Data (HexDump)           : 07 05 81 03 08 00 02                              .......

        ---------------- Interface Descriptor -----------------
bLength                  : 0x09 (9 bytes)
bDescriptorType          : 0x04 (Interface Descriptor)
bInterfaceNumber         : 0x01 (Interface 1)
bAlternateSetting        : 0x00
bNumEndpoints            : 0x00 (Default Control Pipe only)
bInterfaceClass          : 0x03 (HID - Human Interface Device)
bInterfaceSubClass       : 0x00 (None)
bInterfaceProtocol       : 0x00 (None)
iInterface               : 0x00 (No String Descriptor)
Data (HexDump)           : 09 04 01 00 00 03 00 00 00                        .........

        ------------------- HID Descriptor --------------------
bLength                  : 0x09 (9 bytes)
bDescriptorType          : 0x21 (HID Descriptor)
bcdHID                   : 0x0110 (HID Version 1.10)
bCountryCode             : 0x00 (00 = not localized)
bNumDescriptors          : 0x01
Data (HexDump)           : 09 21 10 01 00 01 22 35 00                        .!...."5.
Descriptor 1:
bDescriptorType          : 0x22 (Class=Report)
wDescriptorLength        : 0x0035 (53 bytes)
Error reading descriptor : ERROR_INVALID_PARAMETER (due to a obscure limitation of the Win32 USB API, see UsbTreeView.txt)

    ----------------- Device Qualifier Descriptor -----------------
Error                    : ERROR_GEN_FAILURE  (*!*ERROR   USB 2.0 devices must provide a Device Qualifier Descriptor)

      -------------------- String Descriptors -------------------
             ------ String Descriptor 0 ------
bLength                  : 0x04 (4 bytes)
bDescriptorType          : 0x03 (String Descriptor)
Language ID[0]           : 0x0409 (English - United States)
Data (HexDump)           : 04 03 09 04                                       ....
             ------ String Descriptor 1 ------
bLength                  : 0x12 (18 bytes)
bDescriptorType          : 0x03 (String Descriptor)
Language 0x0409          : "MEGAHUNT"
Data (HexDump)           : 12 03 4D 00 45 00 47 00 41 00 48 00 55 00 4E 00   ..M.E.G.A.H.U.N.
                           54 00                                             T.
             ------ String Descriptor 2 ------
bLength                  : 0x32 (50 bytes)
bDescriptorType          : 0x03 (String Descriptor)
Language 0x0409          : "Megahunt HID FS Keyboard"
Data (HexDump)           : 32 03 4D 00 65 00 67 00 61 00 68 00 75 00 6E 00   2.M.e.g.a.h.u.n.
                           74 00 20 00 48 00 49 00 44 00 20 00 46 00 53 00   t. .H.I.D. .F.S.
                           20 00 4B 00 65 00 79 00 62 00 6F 00 61 00 72 00    .K.e.y.b.o.a.r.
                           64 00                                             d.
             ------ String Descriptor 3 ------
bLength                  : 0x1A (26 bytes)
bDescriptorType          : 0x03 (String Descriptor)
Language 0x0409          : "00000000011C"
Data (HexDump)           : 1A 03 30 00 30 00 30 00 30 00 30 00 30 00 30 00   ..0.0.0.0.0.0.0.
                           30 00 30 00 31 00 31 00 43 00                     0.0.1.1.C.

And the one that does work is:

 =========================== USB Port1 ===========================

Connection Status        : 0x01 (Device is connected)
Port Chain               : 1-5-1
Properties               : 0x01
 IsUserConnectable       : yes
 PortIsDebugCapable      : no
 PortHasMultiCompanions  : no
 PortConnectorIsTypeC    : no
ConnectionIndex          : 0x01 (Port 1)
CompanionIndex           : 0
 CompanionHubSymLnk      : USB#VID_2109&PID_0813#5&873c117&0&21#{f18a0e88-c30c-11d0-8815-00a0c906bed8}
 CompanionPortNumber     : 0x01 (Port 1)
 -> CompanionPortChain   : 1-21-1

      ========================== Summary =========================
Vendor ID                : 0xFFFF (Taiwan OEM - OBSOLETE)
Product ID               : 0x0035
USB Version              : 1.10
Port maximum Speed       : High-Speed (Companion Port 1-21-1 supports SuperSpeed)
Device maximum Speed     : Full-Speed
Device Connection Speed  : Full-Speed
Self powered             : no
Demanded Current         : 200 mA
Used Endpoints           : 2

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

        +++++++++++++++++ Device Information ++++++++++++++++++
Device Description       : USB Composite Device
Device Path              : \\?\USB#VID_FFFF&PID_0035#SN201709VER1#{a5dcbf10-6530-11d2-901f-00c04fb951ed} (GUID_DEVINTERFACE_USB_DEVICE)
Kernel Name              : \Device\USBPDO-15
Device ID                : USB\VID_FFFF&PID_0035\SN201709VER1
Hardware IDs             : USB\VID_FFFF&PID_0035&REV_0120 USB\VID_FFFF&PID_0035
Driver KeyName           : {36fc9e60-c465-11cf-8056-444553540000}\0007 (GUID_DEVCLASS_USB)
Driver                   : \SystemRoot\System32\drivers\usbccgp.sys (Version: 10.0.22621.3155  Date: 2024-02-16)
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_#0001.Hub_#0004
Location IDs             : PCIROOT(0)#PCI(1400)#USBROOT(0)#USB(5)#USB(1), ACPI(_SB_)#ACPI(PCI0)#ACPI(XHC_)#ACPI(RHUB)#ACPI(HS05)#USB(1)
Container ID             : {c50a82a4-fcf1-5b64-bd65-1fcf9f7b3321}
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                  : 1
HcDisableSelectiveSuspend: 0
EnableSelectiveSuspend   : 0
SelectiveSuspendEnabled  : 0
EnhancedPowerMgmtEnabled : 0
IdleInWorkingState       : 0
WakeFromSleepState       : 0
Power State              : D0 (supported: D0, D1, D2, D3, wake from D0, wake from D1, wake from D2)
 Child Device 1          : USB Input Device
  Device ID              : USB\VID_FFFF&PID_0035&MI_00\7&2A65A2B1&2&0000
  Class                  : HIDClass
  Driver KeyName         : {745a17a0-74d3-11d0-b6fe-00a0c90f57da}\0030 (GUID_DEVCLASS_HIDCLASS)
  Service                : HidUsb
  Location               : 0000.0014.0000.005.001.000.000.000.000
  LocationPaths          : PCIROOT(0)#PCI(1400)#USBROOT(0)#USB(5)#USB(1)#USBMI(0)  PCIROOT(0)#PCI(1400)#USBROOT(0)#USB(5)#USB(1)#USB(1)  ACPI(_SB_)#ACPI(PCI0)#ACPI(XHC_)#ACPI(RHUB)#ACPI(HS05)#USB(1)#USBMI(0)  ACPI(_SB_)#ACPI(PCI0)#ACPI(XHC_)#ACPI(RHUB)#ACPI(HS05)#USB(1)#USB(1)
   Child Device 1        : HID Keyboard Device
    Device Path 1        : \\?\HID#VID_FFFF&PID_0035&MI_00#8&2a342659&0&0000#{884b96c3-56ef-11d1-bc8c-00a0c91405dd} (GUID_DEVINTERFACE_KEYBOARD)
    Device Path 2        : \\?\HID#VID_FFFF&PID_0035&MI_00#8&2a342659&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}\kbd (GUID_DEVINTERFACE_HID)
    Kernel Name          : \Device\000001ba
    Device ID            : HID\VID_FFFF&PID_0035&MI_00\8&2A342659&0&0000
    Class                : Keyboard
    Driver KeyName       : {4d36e96b-e325-11ce-bfc1-08002be10318}\0008 (GUID_DEVCLASS_KEYBOARD)
    Service              : kbdhid
 Child Device 2          : USB Input Device
  Device ID              : USB\VID_FFFF&PID_0035&MI_01\7&2A65A2B1&2&0001
  Class                  : HIDClass
  Driver KeyName         : {745a17a0-74d3-11d0-b6fe-00a0c90f57da}\0031 (GUID_DEVCLASS_HIDCLASS)
  Service                : HidUsb
  Location               : 0000.0014.0000.005.001.000.000.000.000
  LocationPaths          : PCIROOT(0)#PCI(1400)#USBROOT(0)#USB(5)#USB(1)#USBMI(1)  ACPI(_SB_)#ACPI(PCI0)#ACPI(XHC_)#ACPI(RHUB)#ACPI(HS05)#USB(1)#USBMI(1)
   Child Device 1        : HID-compliant vendor-defined device
    Device Path          : \\?\HID#VID_FFFF&PID_0035&MI_01#8&3abf07d7&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030} (GUID_DEVINTERFACE_HID)
    Kernel Name          : \Device\000001bb
    Device ID            : HID\VID_FFFF&PID_0035&MI_01\8&3ABF07D7&0&0000
    Class                : HIDClass
    Driver KeyName       : {745a17a0-74d3-11d0-b6fe-00a0c90f57da}\0032 (GUID_DEVCLASS_HIDCLASS)

        +++++++++++++++++ Registry USB Flags +++++++++++++++++
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\usbflags\FFFF00350120
 NewInterfaceUsage       : REG_DWORD 00000000 (0)

        ---------------- Connection Information ---------------
Connection Index         : 0x01 (Port 1)
Connection Status        : 0x01 (DeviceConnected)
Current Config Value     : 0x01 (Configuration 1)
Device Address           : 0x22 (34)
Is Hub                   : 0x00 (no)
Device Bus Speed         : 0x01 (Full-Speed)
Number Of Open Pipes     : 0x01 (1 pipe to data endpoints)
Pipe[0]                  : EndpointID=1  Direction=IN   ScheduleOffset=0  Type=Interrupt  wMaxPacketSize=64   bInterval=2
Data (HexDump)           : 01 00 00 00 12 01 10 01 00 00 00 40 FF FF 35 00   [email protected].
                           20 01 01 02 03 01 01 01 00 22 00 01 00 00 00 01    ........"......
                           00 00 00 07 05 81 03 40 00 02 00 00 00 00         .......@......

        --------------- Connection Information V2 -------------
Connection Index         : 0x01 (1)
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 1-21-1 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)           : 01 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                   : 0x110 (USB Version 1.10)
bDeviceClass             : 0x00 (defined by the interface descriptors)
bDeviceSubClass          : 0x00
bDeviceProtocol          : 0x00
bMaxPacketSize0          : 0x40 (64 bytes)
idVendor                 : 0xFFFF (Taiwan OEM - OBSOLETE)
idProduct                : 0x0035
bcdDevice                : 0x0120
iManufacturer            : 0x01 (String Descriptor 1)
 Language 0x0409         : "Sycreader"
iProduct                 : 0x02 (String Descriptor 2)
 Language 0x0409         : "Magnetic Stripe Reader"
iSerialNumber            : 0x03 (String Descriptor 3)
 Language 0x0409         : "SN201709VER1"
bNumConfigurations       : 0x01 (1 Configuration)
Data (HexDump)           : 12 01 10 01 00 00 00 40 FF FF 35 00 20 01 01 02   [email protected]. ...
                           03 01                                             ..

    ------------------ Configuration Descriptor -------------------
bLength                  : 0x09 (9 bytes)
bDescriptorType          : 0x02 (Configuration Descriptor)
wTotalLength             : 0x0034 (52 bytes)
bNumInterfaces           : 0x02 (2 Interfaces)
bConfigurationValue      : 0x01 (Configuration 1)
iConfiguration           : 0x00 (No String Descriptor)
bmAttributes             : 0xA0
 D7: Reserved, set 1     : 0x01
 D6: Self Powered        : 0x00 (no)
 D5: Remote Wakeup       : 0x01 (yes)
 D4..0: Reserved, set 0  : 0x00
MaxPower                 : 0x64 (200 mA)
Data (HexDump)           : 09 02 34 00 02 01 00 A0 64 09 04 00 00 01 03 01   ..4.....d.......
                           01 04 09 21 10 01 00 01 22 3F 00 07 05 81 03 40   ...!...."?.....@
                           00 02 09 04 01 00 00 03 00 00 05 09 21 10 01 00   ............!...
                           01 22 35 00                                       ."5.

        ---------------- Interface Descriptor -----------------
bLength                  : 0x09 (9 bytes)
bDescriptorType          : 0x04 (Interface Descriptor)
bInterfaceNumber         : 0x00 (Interface 0)
bAlternateSetting        : 0x00
bNumEndpoints            : 0x01 (1 Endpoint)
bInterfaceClass          : 0x03 (HID - Human Interface Device)
bInterfaceSubClass       : 0x01 (Boot Interface)
bInterfaceProtocol       : 0x01 (Keyboard)
iInterface               : 0x04 (String Descriptor 4)
 Language 0x0409         : "USB Keyboard"
Data (HexDump)           : 09 04 00 00 01 03 01 01 04                        .........

        ------------------- HID Descriptor --------------------
bLength                  : 0x09 (9 bytes)
bDescriptorType          : 0x21 (HID Descriptor)
bcdHID                   : 0x0110 (HID Version 1.10)
bCountryCode             : 0x00 (00 = not localized)
bNumDescriptors          : 0x01
Data (HexDump)           : 09 21 10 01 00 01 22 3F 00                        .!...."?.
Descriptor 1:
bDescriptorType          : 0x22 (Class=Report)
wDescriptorLength        : 0x003F (63 bytes)
Error reading descriptor : ERROR_INVALID_PARAMETER (due to a obscure limitation of the Win32 USB API, see UsbTreeView.txt)

        ----------------- Endpoint Descriptor -----------------
bLength                  : 0x07 (7 bytes)
bDescriptorType          : 0x05 (Endpoint Descriptor)
bEndpointAddress         : 0x81 (Direction=IN EndpointID=1)
bmAttributes             : 0x03 (TransferType=Interrupt)
wMaxPacketSize           : 0x0040 (64 bytes)
bInterval                : 0x02 (2 ms)
Data (HexDump)           : 07 05 81 03 40 00 02                              ....@..

        ---------------- Interface Descriptor -----------------
bLength                  : 0x09 (9 bytes)
bDescriptorType          : 0x04 (Interface Descriptor)
bInterfaceNumber         : 0x01 (Interface 1)
bAlternateSetting        : 0x00
bNumEndpoints            : 0x00 (Default Control Pipe only)
bInterfaceClass          : 0x03 (HID - Human Interface Device)
bInterfaceSubClass       : 0x00 (None)
bInterfaceProtocol       : 0x00 (None)
iInterface               : 0x05 (String Descriptor 5)
 Language 0x0409         : "USB Custom Hid"
Data (HexDump)           : 09 04 01 00 00 03 00 00 05                        .........

        ------------------- HID Descriptor --------------------
bLength                  : 0x09 (9 bytes)
bDescriptorType          : 0x21 (HID Descriptor)
bcdHID                   : 0x0110 (HID Version 1.10)
bCountryCode             : 0x00 (00 = not localized)
bNumDescriptors          : 0x01
Data (HexDump)           : 09 21 10 01 00 01 22 35 00                        .!...."5.
Descriptor 1:
bDescriptorType          : 0x22 (Class=Report)
wDescriptorLength        : 0x0035 (53 bytes)
Error reading descriptor : ERROR_INVALID_PARAMETER (due to a obscure limitation of the Win32 USB API, see UsbTreeView.txt)

    ----------------- Device Qualifier Descriptor -----------------
Error                    : ERROR_GEN_FAILURE

      -------------------- String Descriptors -------------------
             ------ String Descriptor 0 ------
bLength                  : 0x04 (4 bytes)
bDescriptorType          : 0x03 (String Descriptor)
Language ID[0]           : 0x0409 (English - United States)
Data (HexDump)           : 04 03 09 04                                       ....
             ------ String Descriptor 1 ------
bLength                  : 0x14 (20 bytes)
bDescriptorType          : 0x03 (String Descriptor)
Language 0x0409          : "Sycreader"
Data (HexDump)           : 14 03 53 00 79 00 63 00 72 00 65 00 61 00 64 00   ..S.y.c.r.e.a.d.
                           65 00 72 00                                       e.r.
             ------ String Descriptor 2 ------
bLength                  : 0x2E (46 bytes)
bDescriptorType          : 0x03 (String Descriptor)
Language 0x0409          : "Magnetic Stripe Reader"
Data (HexDump)           : 2E 03 4D 00 61 00 67 00 6E 00 65 00 74 00 69 00   ..M.a.g.n.e.t.i.
                           63 00 20 00 53 00 74 00 72 00 69 00 70 00 65 00   c. .S.t.r.i.p.e.
                           20 00 52 00 65 00 61 00 64 00 65 00 72 00          .R.e.a.d.e.r.
             ------ String Descriptor 3 ------
bLength                  : 0x1A (26 bytes)
bDescriptorType          : 0x03 (String Descriptor)
Language 0x0409          : "SN201709VER1"
Data (HexDump)           : 1A 03 53 00 4E 00 32 00 30 00 31 00 37 00 30 00   ..S.N.2.0.1.7.0.
                           39 00 56 00 45 00 52 00 31 00                     9.V.E.R.1.
             ------ String Descriptor 4 ------
bLength                  : 0x1A (26 bytes)
bDescriptorType          : 0x03 (String Descriptor)
Language 0x0409          : "USB Keyboard"
Data (HexDump)           : 1A 03 55 00 53 00 42 00 20 00 4B 00 65 00 79 00   ..U.S.B. .K.e.y.
                           62 00 6F 00 61 00 72 00 64 00                     b.o.a.r.d.
             ------ String Descriptor 5 ------
bLength                  : 0x1E (30 bytes)
bDescriptorType          : 0x03 (String Descriptor)
Language 0x0409          : "USB Custom Hid"
Data (HexDump)           : 1E 03 55 00 53 00 42 00 20 00 43 00 75 00 73 00   ..U.S.B. .C.u.s.
                           74 00 6F 00 6D 00 20 00 48 00 69 00 64 00         t.o.m. .H.i.d.
@DrJaymz
Copy link
Author

DrJaymz commented May 1, 2024

After debugging the device that has an issue I have discovered that it goes throgh the following mental states:

USB_ATTACHED_SUBSTATE_SETTLE
USB_ATTACHED_SUBSTATE_RESET_DEVICE
USB_ATTACHED_SUBSTATE_WAIT_RESET_COMPLETE
USB_ATTACHED_SUBSTATE_WAIT_RESET
USB_STATE_CONFIGURING
USB_STATE_ERROR

I can't help wondering if this is something related to te device reporting itself as the incorrect speed. However, it works witrh everything you plug it in to but not with this library so everything else can overcome it and this cannot. So I will class it as a bug as it doesn't configure this device correctly.

I have tried increasing the settling time and that doesn't help.
But unplugging the device and plugging in another works so it doesn't crash the library or leave it in a state it can't recover from so thats good. So in summary this would probably work if it would initialize but I don't really know enough to overcome this error.

This line is returning 5.
getDevDescr(0, 0, sizeof (USB_DEVICE_DESCRIPTOR), (uint8_t*)buf);

if I comment the line out then it seems to initialize albeit screwed up. So I could just bodge the code to work from here. But whoever maintains it probably should know.

01
--

Device descriptor: 
Descriptor Length:      12
Descriptor type:        01
USB version:            0200
Device class:           00
Device Subclass:        00
Device Protocol:        00
Max.packet size:        40
Vendor  ID:             FFFF
Product ID:             0035
Revision ID:            0200
Mfg.string index:       01
Prod.string index:      02
Serial number index:    03
Number of conf.:        01

Configuration descriptor:
Total length:           0034
Num.intf:               02
Conf.value:             01
Conf.string:            00
Attr.:                  A0
Max.pwr:                FA

Interface descriptor:
Intf.number:            00
Alt.:                   00
Endpoints:              01
Intf. Class:            03
Intf. Subclass:         01
Intf. Protocol:         01
Intf.string:            00
Unknown descriptor:
Length:         09
Type:           21
Contents:       100100012242000705

Endpoint descriptor:
Endpoint address:       81
Attr.:                  03
Max.pkt size:           0008
Polling interval:       02

Interface descriptor:
Intf.number:            01
Alt.:                   00
Endpoints:              00
Intf. Class:            03
Intf. Subclass:         00
Intf. Protocol:         00
Intf.string:            00
Unknown descriptor:
Length:         09
Type:           21
Contents:       100100012235000100


Addr:1(0.0.1)

Following that, comparing with the working one I noticed that all the important registers all look fine. So I tried forcing it to init. And then my code for getting cards works fine also. So there is something wrong with the descriptor in the hardware for this device which I then choose to ignore and it works:

    if(rcode) rcode = 0;  // pretend it worked.

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

1 participant