USB HID emulation over USB 3

We are using the Linux USB HID Gadget Driver to emulate USB devices. We configure several devices at startup using a service. We have a carrier board with a USB3.1 port. When you plug the board into another computer using a USB cable, the expected behavior is to see each USB device that we configure.

When plugged into a Windows machine, this works as expected over a USB 2 cable. The devices appear and function properly. However, the device fails over a USB 3 connection. Windows device manager shows an “Unknown USB Device (Invalid Configuration Descriptor)” error message. When analyzing the descriptors, the initial device descriptor shows incorrect information, and all subsequent descriptors fail.

When plugged into a Linux machine, the devices always use USB2.1, even when plugged in with a USB3 cable to a USB3 port.

Another odd behavior is that the bcdUSB value we set when configuring the devices is overwritten when you plug the board into a port. I suspect this prevents us from forcing the devices to use a specific version of the USB spec.

Here is a snippet of how we set up a HID keyboard device:

#Wait for any modules to load and initialize
for attempt in $(seq 60); do
    udc_dev_t210=700d0000.xudc
    if [ -e "/sys/class/udc/${udc_dev_t210}" ]; then
        udc_dev="${udc_dev_t210}"
        break
    fi
    udc_dev_t186=3550000.xudc
    if [ -e "/sys/class/udc/${udc_dev_t186}" ]; then
        udc_dev="${udc_dev_t186}"
        break
    fi
    sleep 1
done
if [ "${udc_dev}" == "" ]; then
    echo No known UDC device found
    exit 1
fi

mkdir -p /sys/kernel/config/usb_gadget/emulation
cd /sys/kernel/config/usb_gadget/emulation
echo 0x1d6b > idVendor # Linux Foundation
echo 0x0104 > idProduct # Multifunction Composite Gadget
echo 0x0100 > bcdDevice # v1.0.0
echo 0x0300 > bcdUSB # USB3
echo 0xEF > bDeviceClass
echo 0x02 > bDeviceSubClass
echo 0x01 > bDeviceProtocol
mkdir -p strings/0x409
echo [SERIAL_NUMBER] > strings/0x409/serialnumber
echo [MANUFACTURER] > strings/0x409/manufacturer
echo [PRODUCT] > strings/0x409/product
mkdir -p configs/c.1/strings/0x409
echo 500 > configs/c.1/MaxPower

# Standard Keyboard
mkdir -p functions/hid.usb0
echo 1 > functions/hid.usb0/protocol       #Keyboard
echo 1 > functions/hid.usb0/subclass       #Boot Interface
echo 8 > functions/hid.usb0/report_length  #modifier keys, reserved, keypress #1, keypress #2, keypress #3, keypress #4, keypress #5, keypress #6
echo -ne \\x05\\x01\\x09\\x06\\xa1\\x01\\x05\\x07\\x19\\xe0\\x29\\xe7\\x15\\x00\\x25\\x01\\x75\\x01\\x95\\x08\\x81\\x02\\x95\\x01\\x75\\x08\\x81\\x03\\x95\\x05\\x75\\x01\\x05\\x08\\x19\\x01\\x29\\x05\\x91\\x02\\x95\\x01\\x75\\x03\\x91\\x03\\x95\\x06\\x75\\x08\\x15\\x00\\x25\\x65\\x05\\x07\\x19\\x00\\x29\\x65\\x81\\x00\\xc0 > functions/hid.usb0/report_desc
ln -s functions/hid.usb0 configs/c.1/

echo "${udc_dev}" > UDC

I am not a USB expert and am fairly new to USB descriptors. But I have been unable to identify anything blatantly wrong in how we are setting up our devices. There could be an issue with the configuration or the firmware. We are fairly confident that it is not a hardware issue.

Has anyone tried configuring/emulating USB devices over USB 3, and could provide any input on this issue?

EDIT: It is worth noting that we need USB3 capability so that we can have non-HID USB3 devices alongside our HID devices using the same port/cable.

Is this a typo? I’m thinking you mean USB2 or USB3.1, but there wouldn’t be a 2.1.

I don’t know enough about gadget to really answer this, but I wanted to point out some things:

  • In USB2 or earlier, a single controller handles both USB2 and legacy slower protocols.
  • In USB3 or newer, a single controller handles only USB3 traffic; any USB2 or earlier traffic routes to a different legacy controller. The USB3 controller itself does not handle a USB2 device.
  • In USB3 there is additional information passed to describe this mode. If that information is missing, or if the controller is USB2 or slower, then a USB3 descriptor will not exist and this will force reroute to a USB2 controller.
  • If a device has only USB3 abilities, then it will never reroute to a USB2 controller. A USB3 device which does not have USB2 or slower abilities will “disappear” and not be listed if only a USB2 controller is available.
  • I do not know what happens if partial USB3 descriptors are found.
  • If you use “lsusb -t” on a Linux host PC, then the speed is listed on the right side. Speeds shown, which correspond to the protocol, can be: 1.1M, 1.5M, 12M, 480M, 5000M, or 10000M. The 480M or below is USB2 or slower, the 5000M or above is USB3 or faster (USB3 is synonymous with USB3.1 gen. 1 at 5000M, while USB3.1 gen. 2 is 10000M; USB3 was absorbed into the spec of USB3.1 gen. 1, but I generally just say “USB3” regardless of gen. 1 or gen. 2).
  • If you use the “-d <identifier>” with “lsusb”, then you can limit the query to just the one device. Useful with verbose listings to avoid the huge scroll of everything. For example, if “lsusb” shows device “0955:7019”, then “lsusb -d '0955:7019'” will list just that device. If we pretend that your device is “0955:7019”, then this will give you the fully verbose information:
    sudo lsusb -d '0955:7019' -vvv

You should monitor “dmesg --follow” on your host PC, and post only what occurs in that log as you plug the device into the Linux host PC. Then also include what the verbose lsusb shows for that device. The same logs should be shown for plugging this device into a USB3 port. In both cases you should also show the full tree listing (“lsusb -t”) for the root hub and out that applies to the Jetson gadget device (once for the USB2 legacy port, and once again for the USB3 port).

I have pretty much ignored USB3 docs with regard to gadget, so I do not know what extra might be required. Most of the reason for this is that there are no HID devices which are USB3 (that I know of), and I have not had an interest in other gadget devices (the devices I had an interest in were also from quite some time back). However, if you look at a USB3 device using a verbose mode of lsusb (sudo is mandatory for that level of detail) you should have an idea of what this has based on the USB3 at the end of the verbose listing. That section of lsusb will start with “SuperSpeed USB Device Capability:”. I don’t even know what would happen if there were an actual (not emulated) mouse or keyboard which is running at USB3 speeds and which is not just “compatible” (compatible will detect on USB3, but revert to USB2 or slower).

I said USB 2.1 because the bcdUSB value for the device is set to 0x0210 when plugged into the Linux machine.

I ran the tests you suggested. The output is below. Note that there are two devices being emulated; our HID keyboard, and Nvidia’s l4t mass storage emulation device.

Plugged in via USB 2:

  • dmesg --follow when plugging in :
[ 2512.059637] usb 1-4: new high-speed USB device number 15 using xhci_hcd 
[ 2512.210422] usb 1-4: New USB device found, idVendor=1d6b, idProduct=0104, bcdDevice= 1.00 
[ 2512.210432] usb 1-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3 
[ 2512.210436] usb 1-4: Product: [PRODUCT]
[ 2512.210440] usb 1-4: Manufacturer: [MANUFACTURER]
[ 2512.210442] usb 1-4: SerialNumber: [SERIAL_NUMBER]
[ 2512.220062] input: [DEVICE] as /devices/pci0000:00/0000:00:14.0/usb1/1-4/1-4:1.0/0003:1D6B:0104.0016/input/input38 
[ 2512.280037] hid-generic 0003:1D6B:0104.0016: input,hidraw3: USB HID v1.01 Keyboard on usb-0000:00:14.0-4/input0 
[ 2512.280624] usb-storage 1-4:1.1: USB Mass Storage device detected 
[ 2512.280910] scsi host6: usb-storage 1-4:1.1 
[ 2513.297450] scsi 6:0:0:0: Direct-Access     Linux    File-Stor Gadget 0409 PQ: 0 ANSI: 2 
[ 2513.297815] sd 6:0:0:0: Attached scsi generic sg2 type 0 
[ 2513.298878] sd 6:0:0:0: Power-on or device reset occurred 
[ 2513.299696] sd 6:0:0:0: [sdb] 32768 512-byte logical blocks: (16.8 MB/16.0 MiB) 
[ 2513.417631] sd 6:0:0:0: [sdb] Write Protect is off 
[ 2513.417639] sd 6:0:0:0: [sdb] Mode Sense: 0f 00 00 00 
[ 2513.533483] sd 6:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA 
[ 2513.766725]  sdb: 
[ 2514.009014] sd 6:0:0:0: [sdb] Attached SCSI removable disk
  • lsusb -v output
Bus 001 Device 015: ID 1d6b:0104 Linux Foundation Multifunction Composite Gadget 
Couldn't open device, some information will be missing 
Device Descriptor: 
 bLength                18 
 bDescriptorType         1 
 bcdUSB               2.10 
 bDeviceClass          239 Miscellaneous Device 
 bDeviceSubClass         2  
 bDeviceProtocol         1 Interface Association 
 bMaxPacketSize0        64 
 idVendor           0x1d6b Linux Foundation 
 idProduct          0x0104 Multifunction Composite Gadget 
 bcdDevice            1.00 
 iManufacturer           1  
 iProduct                2  
 iSerial                 3  
 bNumConfigurations      1 
 Configuration Descriptor: 
   bLength                 9 
   bDescriptorType         2 
   wTotalLength       0x0040 
   bNumInterfaces          2 
   bConfigurationValue     1 
   iConfiguration          4  
   bmAttributes         0x80 
     (Bus Powered) 
   MaxPower              500mA 
   Interface Descriptor: 
     bLength                 9 
     bDescriptorType         4 
     bInterfaceNumber        0 
     bAlternateSetting       0 
     bNumEndpoints           2 
     bInterfaceClass         3 Human Interface Device 
     bInterfaceSubClass      1 Boot Interface Subclass 
     bInterfaceProtocol      1 Keyboard 
     iInterface              5  
       HID Device Descriptor: 
         bLength                 9 
         bDescriptorType        33 
         bcdHID               1.01 
         bCountryCode            0 Not supported 
         bNumDescriptors         1 
         bDescriptorType        34 Report 
         wDescriptorLength      63 
        Report Descriptors:  
          ** UNAVAILABLE ** 
     Endpoint Descriptor: 
       bLength                 7 
       bDescriptorType         5 
       bEndpointAddress     0x81  EP 1 IN 
       bmAttributes            3 
         Transfer Type            Interrupt 
         Synch Type               None 
         Usage Type               Data 
       wMaxPacketSize     0x0008  1x 8 bytes 
       bInterval               4 
     Endpoint Descriptor: 
       bLength                 7 
       bDescriptorType         5 
       bEndpointAddress     0x01  EP 1 OUT 
       bmAttributes            3 
         Transfer Type            Interrupt 
         Synch Type               None 
         Usage Type               Data 
       wMaxPacketSize     0x0008  1x 8 bytes 
       bInterval               4 
   Interface Descriptor: 
     bLength                 9 
     bDescriptorType         4 
     bInterfaceNumber        1 
     bAlternateSetting       0 
     bNumEndpoints           2 
     bInterfaceClass         8 Mass Storage 
     bInterfaceSubClass      6 SCSI 
     bInterfaceProtocol     80 Bulk-Only 
     iInterface              7  
     Endpoint Descriptor: 
       bLength                 7 
       bDescriptorType         5 
       bEndpointAddress     0x82  EP 2 IN 
       bmAttributes            2 
         Transfer Type            Bulk 
         Synch Type               None 
         Usage Type               Data 
       wMaxPacketSize     0x0200  1x 512 bytes 
       bInterval               0 
     Endpoint Descriptor: 
       bLength                 7 
       bDescriptorType         5 
       bEndpointAddress     0x02  EP 2 OUT 
       bmAttributes            2 
         Transfer Type            Bulk 
         Synch Type               None 
         Usage Type               Data 
       wMaxPacketSize     0x0200  1x 512 bytes 
       bInterval               1
  • lsusb -t, Plugged into port 4
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/16p, 480M 
   |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/2p, 480M 
   |__ Port 4: Dev 16, If 1, Class=Mass Storage, Driver=usb-storage, 480M 
   |__ Port 4: Dev 16, If 0, Class=Human Interface Device, Driver=usbhid, 480M 
   |__ Port 11: Dev 3, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M 
   |__ Port 11: Dev 3, If 1, Class=Human Interface Device, Driver=usbhid, 1.5M 
   |__ Port 13: Dev 4, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M

Plugged in via USB 3:

  • dmesg --follow when plugging in :
[ 4263.487575] usb 1-7: new high-speed USB device number 17 using xhci_hcd 
[ 4263.637847] usb 1-7: New USB device found, idVendor=1d6b, idProduct=0104, bcdDevice= 1.00 
[ 4263.637857] usb 1-7: New USB device strings: Mfr=1, Product=2, SerialNumber=3 
[ 4263.637861] usb 1-7: Product: [PRODUCT]
[ 4263.637864] usb 1-7: Manufacturer: [MANUFACTURER] 
[ 4263.637867] usb 1-7: SerialNumber: [SERIAL_NUMBER] 
[ 4263.647837] input: [DEVICE] as /devices/pci0000:00/0000:00:14.0/usb1/1-7/1-7:1.0/0003:1D6B:0104.0018/input/input40 
[ 4263.707956] hid-generic 0003:1D6B:0104.0018: input,hidraw3: USB HID v1.01 Keyboard on usb-0000:00:14.0-7/input0 
[ 4263.708804] usb-storage 1-7:1.1: USB Mass Storage device detected 
[ 4263.709091] scsi host6: usb-storage 1-7:1.1 
[ 4264.721575] scsi 6:0:0:0: Direct-Access     Linux    File-Stor Gadget 0409 PQ: 0 ANSI: 2 
[ 4264.721931] sd 6:0:0:0: Attached scsi generic sg2 type 0 
[ 4264.723467] sd 6:0:0:0: Power-on or device reset occurred 
[ 4264.724282] sd 6:0:0:0: [sdb] 32768 512-byte logical blocks: (16.8 MB/16.0 MiB) 
[ 4264.839903] sd 6:0:0:0: [sdb] Write Protect is off 
[ 4264.839910] sd 6:0:0:0: [sdb] Mode Sense: 0f 00 00 00 
[ 4264.955355] sd 6:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA 
[ 4265.188475]  sdb: 
[ 4265.427354] sd 6:0:0:0: [sdb] Attached SCSI removable disk
  • lsusb -v output
Bus 001 Device 017: ID 1d6b:0104 Linux Foundation Multifunction Composite Gadget 
Couldn't open device, some information will be missing 
Device Descriptor: 
 bLength                18 
 bDescriptorType         1 
 bcdUSB               2.10 
 bDeviceClass          239 Miscellaneous Device 
 bDeviceSubClass         2  
 bDeviceProtocol         1 Interface Association 
 bMaxPacketSize0        64 
 idVendor           0x1d6b Linux Foundation 
 idProduct          0x0104 Multifunction Composite Gadget 
 bcdDevice            1.00 
 iManufacturer           1  
 iProduct                2  
 iSerial                 3  
 bNumConfigurations      1 
 Configuration Descriptor: 
   bLength                 9 
   bDescriptorType         2 
   wTotalLength       0x0040 
   bNumInterfaces          2 
   bConfigurationValue     1 
   iConfiguration          4  
   bmAttributes         0x80 
     (Bus Powered) 
   MaxPower              500mA 
   Interface Descriptor: 
     bLength                 9 
     bDescriptorType         4 
     bInterfaceNumber        0 
     bAlternateSetting       0 
     bNumEndpoints           2 
     bInterfaceClass         3 Human Interface Device 
     bInterfaceSubClass      1 Boot Interface Subclass 
     bInterfaceProtocol      1 Keyboard 
     iInterface              5  
       HID Device Descriptor: 
         bLength                 9 
         bDescriptorType        33 
         bcdHID               1.01 
         bCountryCode            0 Not supported 
         bNumDescriptors         1 
         bDescriptorType        34 Report 
         wDescriptorLength      63 
        Report Descriptors:  
          ** UNAVAILABLE ** 
     Endpoint Descriptor: 
       bLength                 7 
       bDescriptorType         5 
       bEndpointAddress     0x81  EP 1 IN 
       bmAttributes            3 
         Transfer Type            Interrupt 
         Synch Type               None 
         Usage Type               Data 
       wMaxPacketSize     0x0008  1x 8 bytes 
       bInterval               4 
     Endpoint Descriptor: 
       bLength                 7 
       bDescriptorType         5 
       bEndpointAddress     0x01  EP 1 OUT 
       bmAttributes            3 
         Transfer Type            Interrupt 
         Synch Type               None 
         Usage Type               Data 
       wMaxPacketSize     0x0008  1x 8 bytes 
       bInterval               4 
   Interface Descriptor: 
     bLength                 9 
     bDescriptorType         4 
     bInterfaceNumber        1 
     bAlternateSetting       0 
     bNumEndpoints           2 
     bInterfaceClass         8 Mass Storage 
     bInterfaceSubClass      6 SCSI 
     bInterfaceProtocol     80 Bulk-Only 
     iInterface              7  
     Endpoint Descriptor: 
       bLength                 7 
       bDescriptorType         5 
       bEndpointAddress     0x82  EP 2 IN 
       bmAttributes            2 
         Transfer Type            Bulk 
         Synch Type               None 
         Usage Type               Data 
       wMaxPacketSize     0x0200  1x 512 bytes 
       bInterval               0 
     Endpoint Descriptor: 
       bLength                 7 
       bDescriptorType         5 
       bEndpointAddress     0x02  EP 2 OUT 
       bmAttributes            2 
         Transfer Type            Bulk 
         Synch Type               None 
         Usage Type               Data 
       wMaxPacketSize     0x0200  1x 512 bytes 
       bInterval               1
  • lsusb -t, Plugged into port 7
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/16p, 480M 
   |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/2p, 480M 
   |__ Port 7: Dev 17, If 0, Class=Human Interface Device, Driver=usbhid, 480M 
   |__ Port 7: Dev 17, If 1, Class=Mass Storage, Driver=usb-storage, 480M 
   |__ Port 11: Dev 3, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M 
   |__ Port 11: Dev 3, If 1, Class=Human Interface Device, Driver=usbhid, 1.5M 
   |__ Port 13: Dev 4, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M

These logs appear to be basically identical, which might make sense given that Linux appears to be using USB 2 regardless of which port is used.

Did you use “sudo” with verbose lsusb, and did you use “-vvv” or just “-v”? I ask because in part:

In the USB3 case there was no USB3 information presented. I’m not sure where gadget USB3 is described, but there would be additional information presented, and it looks like either (A) the unit was not plugged into a USB3 port (I only saw part of the USB tree view, and so I can’t see if there are available USB3 root ports, those were edited out), or (B) gadget never relayed the USB3 information from USB3 setup. It does, however, appear that what was presented had no error, which implies that there was no failed attempt to reach USB3 speeds or protocols (if it were a signal quality issue, then you’d see errors or notes of falling back to USB2).

If you used the full “-vvv” in “lsusb”, and if you also used “sudo”, then I’d say this entirely depends on more USB information being passed by gadget. You might look here:
https://www.kernel.org/doc/html/v4.19/driver-api/usb/gadget.html
…and examine “stream_id”.

I see you have mass storage as well as HID. Is the mass storage for your case, or is this the mass storage from the example code in a Jetson? I ask because I know mass storage is supported in USB3 and a common case, while HID would be unusual to be USB3 (I’ve never seen even one case of a USB3 keyboard or mouse, it has always been compatibility and not actual USB3). Mass storage would probably be the case to use USB3.

Incidentally, are you using a dedicated full-sized USB type-B port wired for USB3? Or did you add a USB3 port of some sort? The ports on the Jetson Nano itself (at least the dev kit and the third party carrier boards I know of) do not support device mode USB3. The USB-C port would probably support this, but I have no experience in setting up a USB-C port in device mode.

I think I did not use sudo or -vvv. My apologies. I have been having trouble replicating an identical situation on a different machine. I will try to test on the same machine later today to compare the sudo result.

For the logs above, the mass storage is from the example code in the Jetson. We have that enabled to represent our need to emulate HID devices and USB3 devices.

The USB port on our carrier board is a full size USB type-A port.

I am getting USB3 errors on a different Linux machine that might be insightful. When plugging in via USB3, the device fails, disconnects, and the Jetson reboots.

  • dmesg --follow with HID keyboard and l4t mass storage enabled:
[65183.940866] usb 1-4: new high-speed USB device number 56 using xhci_hcd
[65184.069003] usb 1-4: Device not responding to setup address.
[65184.276892] usb 1-4: Device not responding to setup address.
[65184.484865] usb 1-4: device not accepting address 56, error -71
[65185.373412] usb 2-4: new SuperSpeed USB device number 85 using xhci_hcd
[65185.395262] usb 2-4: No SuperSpeed endpoint companion for config 1  interface 0 altsetting 0 ep 129: using minimum values
[65185.395274] usb 2-4: No SuperSpeed endpoint companion for config 1  interface 0 altsetting 0 ep 1: using minimum values
[65185.395969] usb 2-4: New USB device found, idVendor=1d6b, idProduct=0104, bcdDevice= 1.00
[65185.395980] usb 2-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[65185.395985] usb 2-4: Product: [PRODUCT]
[65185.395989] usb 2-4: Manufacturer: [MANUFACTURER]
[65185.395993] usb 2-4: SerialNumber: [SERIAL_NUMBER]
[65190.437328] usb 2-4: can't set config #1, error -110
[65191.801070] usb 2-4: USB disconnect, device number 85
  • dmesg --follow with only HID keyboard enabled:
[64940.793036] usb 1-4: new high-speed USB device number 53 using xhci_hcd
[64940.921136] usb 1-4: Device not responding to setup address.
[64941.129062] usb 1-4: Device not responding to setup address.
[64941.337042] usb 1-4: device not accepting address 53, error -71
[64942.225570] usb 2-4: new SuperSpeed USB device number 81 using xhci_hcd
[64942.246864] usb 2-4: no configurations
[64942.246876] usb 2-4: can't read configurations, error -22
[64942.449579] usb 2-4: new SuperSpeed USB device number 82 using xhci_hcd
[64942.471164] usb 2-4: no configurations
[64942.471176] usb 2-4: can't read configurations, error -22
[64942.479554] usb usb2-port4: attempt power cycle
[64942.921579] usb 2-4: new SuperSpeed USB device number 83 using xhci_hcd
[64942.942732] usb 2-4: no configurations
[64942.942743] usb 2-4: can't read configurations, error -22
[64943.145166] usb 2-4: new SuperSpeed USB device number 84 using xhci_hcd
[64943.165575] usb 2-4: no configurations
[64943.165587] usb 2-4: can't read configurations, error -22
[64943.172936] usb usb2-port4: unable to enumerate USB device

The errors in these two logs appear to indicate certain configuration errors, which might point towards your theory that we are missing additional configuration for USB3 compatibility.

Another observation: When I enable only the mass storage component, the device appears properly on the second Linux machine. However, it sometimes connects at USB 2 speeds, and sometimes at USB3 speeds.

Port 4: Dev 118, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
vs
Port 4: Dev 70, If 0, Class=Mass Storage, Driver=usb-storage, 480M

I assume that the sample is a good starting place, but it does only present USB2 to the controller, and so USB3 would be expected to be missing even if the hardware connector is valid for USB3.

A type-A port is not able to function in device mode. The wiring differs. What you need is type-B (a type-C is really a dual wired connector capable of being used one way or the other, and a micro-OTG is also both type-A and type-B, but rather than using dual wiring it has an ID pin to detect one type). Using a type-A in device mode is a standards violation. You could fake it if you were willing to make a custom USB cable, but it is a bad idea compared to just using a type-B port. I’m not certain what the wiring standards difference is for USB3 device versus USB2 device since I’ve not worked on USB3 hardware, but you would definitely have issues if the port truly is type-A in combination with a cable which is not modified to “behave incorrectly” except for your situation. Device tree would also likely differ.

Can you provide more information on the device mode full size connector?

Although we are using a USB Type-A port, we are controlling the VBUS to the port and the VBUS detect to the Jetson to control the entering of OTG mode. We are protecting both the Jetson and the host or devices that we’re plugging into the port. So although we’re braking spec, we’re doing it in a safe and controlled manner. We are successfully entering device mode, and it’s working, we’re just having issues with using the HID devices over the USB 3 signaling.

I am not able to share many details about what application this is for, but I’m hoping to determine if this is a bug or a limitation.

Since I have not used device mode with USB3 gadget I can’t answer. I can tell you though that the output of verbose lsusb indicates the device never output information to say to the host that the device has a USB3 capability. No controller will offer a chance to even attempt USB3 mode if that data is not supplied.

I have only used gadget with USB2 or slower. Gadget was writtent long ago, prior to USB3 existing. I suspect someone would have extended for USB3, but this is only a guess. Probably this can be made to work if you find the correct fields to pass from a USB3 gadget example.

I’ve never seen HID actually use USB3 under any circumstance. No mouse or keyboard or joystick or other controller which I know of operates USB3, but instead is merely USB3 compatible. In theory this should not be a problem, but I wonder if HID drivers might have some dependency upon USB2 or earlier in some way which I don’t know about. If you are able to get the USB3 metadata to send in gadget, then you can find out. Until you get the USB3 metadata to send you won’t be able to answer that. I don’t know.

What USB3 metadata should be sent? I understand that the bcdUSB value can be used to specify the spec that a device uses. It also appears that we are currently missing the USB Superspeed Endpoint Companion descriptor. Are you aware of any other specific data I should make sure that we are sending?

I have not used gadget with USB3, so I don’t know what is required for that setup. What I can tell you is that if you have a USB3 device running at USB3 speeds, then the verbose “sudo lsusb -vvv” will show additional data at the end of the listing for superspeed mode, and your verbose lsusb is not showing that. The implication is that one (or both) of these will be true:

  • The device does not respond to USB3 queries and shows up only as USB2 or slower due to that response.
  • The USB3 controller was never consulted, e.g., due to routing issues (you can eliminate this as a cause if any other USB3 device runs correctly on that port in USB3 mode).

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.