Question about USB OTG - Gadget function

Hello everybody, I’m new to the forum.
I bought a Rock Pi X card because I needed to apply multiple projects to a single installation. In particular I chose this board because it is x86 and with the USB OTG function. With regard to this function, I wanted to install this solution https://tinypilotkvm.com/ on the Rock PI X which allows you to transform a Raspberry into a KVM. I have already installed and successfully used this solution on Raspberry and I wanted to apply it on the Rock PI X but I have some problems in particular with the USB OTG because I can’t get it to work. I moved the appropriate switch of the card to enable the Device mode and I changed the entry in the bios that indicated the enabling. I installed Debian 11 and Ubuntu 20.04 and initially I also tried to do simple enabling by looking on the internet, such as enabling g_ether to make a virtual network card on USB but I couldn’t. You can help me? Do I have to recompile the kernel by choosing some particular option?

Thank you

The Rock Pi X should have the same controller (dwc3?) handling otg stuff as the Rock Pi 4. You could test, if this hack works for you as well: https://forum.radxa.com/t/usb-otg-not-working-properly-rockpi-4b/9562/13

Hi, thank you very much for your reply. I’ll try your suggestion, I don’t have considered this thread because the architecture of the two boards are very different

Hi, sorry, but I can’t find any solution. My system don’t show anything about otg mode. I’ve tried to enable the otg mode but I can’t see any resource that allow me to enable it.

dmesg | grep usb
[    3.955278] usbcore: registered new interface driver usbfs
[    3.955811] usbcore: registered new interface driver hub
[    3.955856] usbcore: registered new device driver usb
[    4.008499] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.10
[    4.008505] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    4.008509] usb usb1: Product: xHCI Host Controller
[    4.008511] usb usb1: Manufacturer: Linux 5.10.0-14-amd64 xhci-hcd
[    4.008514] usb usb1: SerialNumber: 0000:00:14.0
[    4.010571] usb usb2: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 5.10
[    4.010576] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    4.010579] usb usb2: Product: xHCI Host Controller
[    4.010582] usb usb2: Manufacturer: Linux 5.10.0-14-amd64 xhci-hcd
[    4.010585] usb usb2: SerialNumber: 0000:00:14.0
[    9.332954] usbcore: registered new interface driver brcmfmac

.

lsusb -v

Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               3.00
  bDeviceClass            9 Hub
  bDeviceSubClass         0
  bDeviceProtocol         3
  bMaxPacketSize0         9
  idVendor           0x1d6b Linux Foundation
  idProduct          0x0003 3.0 root hub
  bcdDevice            5.10
  iManufacturer           3 Linux 5.10.0-14-amd64 xhci-hcd
  iProduct                2 xHCI Host Controller
  iSerial                 1 0000:00:14.0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x001f
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower                0mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         9 Hub
      bInterfaceSubClass      0
      bInterfaceProtocol      0 Full speed (or root) hub
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0004  1x 4 bytes
        bInterval              12
        bMaxBurst               0
Hub Descriptor:
  bLength              12
  bDescriptorType      42
  nNbrPorts             6
  wHubCharacteristic 0x000a
    No power switching (usb 1.0)
    Per-port overcurrent protection
  bPwrOn2PwrGood       50 * 2 milli seconds
  bHubContrCurrent      0 milli Ampere
  bHubDecLat          0.0 micro seconds
  wHubDelay             0 nano seconds
  DeviceRemovable    0x78
 Hub Port Status:
   Port 1: 0000.02a0 5Gbps power Rx.Detect
   Port 2: 0000.02a0 5Gbps power Rx.Detect
   Port 3: 0000.02a0 5Gbps power Rx.Detect
   Port 4: 0000.02a0 5Gbps power Rx.Detect
   Port 5: 0000.02a0 5Gbps power Rx.Detect
   Port 6: 0000.02a0 5Gbps power Rx.Detect
Binary Object Store Descriptor:
  bLength                 5
  bDescriptorType        15
  wTotalLength       0x000f
  bNumDeviceCaps          1
  SuperSpeed USB Device Capability:
    bLength                10
    bDescriptorType        16
    bDevCapabilityType      3
    bmAttributes         0x02
      Latency Tolerance Messages (LTM) Supported
    wSpeedsSupported   0x0008
      Device can operate at SuperSpeed (5Gbps)
    bFunctionalitySupport   3
      Lowest fully-functional device speed is SuperSpeed (5Gbps)
    bU1DevExitLat          10 micro seconds
    bU2DevExitLat         512 micro seconds
can't get debug descriptor: Resource temporarily unavailable
Device Status:     0x0001
  Self Powered

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            9 Hub
  bDeviceSubClass         0
  bDeviceProtocol         1 Single TT
  bMaxPacketSize0        64
  idVendor           0x1d6b Linux Foundation
  idProduct          0x0002 2.0 root hub
  bcdDevice            5.10
  iManufacturer           3 Linux 5.10.0-14-amd64 xhci-hcd
  iProduct                2 xHCI Host Controller
  iSerial                 1 0000:00:14.0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0019
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower                0mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         9 Hub
      bInterfaceSubClass      0
      bInterfaceProtocol      0 Full speed (or root) hub
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0004  1x 4 bytes
        bInterval              12
Hub Descriptor:
  bLength               9
  bDescriptorType      41
  nNbrPorts             7
  wHubCharacteristic 0x000a
    No power switching (usb 1.0)
    Per-port overcurrent protection
    TT think time 8 FS bits
  bPwrOn2PwrGood       10 * 2 milli seconds
  bHubContrCurrent      0 milli Ampere
  DeviceRemovable    0xd8
  PortPwrCtrlMask    0xff
 Hub Port Status:
   Port 1: 0000.0100 power
   Port 2: 0000.0100 power
   Port 3: 0000.0100 power
   Port 4: 0000.0100 power
   Port 5: 0000.0100 power
   Port 6: 0000.0100 power
   Port 7: 0000.0100 power
can't get device qualifier: Resource temporarily unavailable
can't get debug descriptor: Resource temporarily unavailable
Device Status:     0x0001
  Self Powered

.

usb-devices

T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480 MxCh= 7
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=1d6b ProdID=0002 Rev=05.10
S:  Manufacturer=Linux 5.10.0-14-amd64 xhci-hcd
S:  Product=xHCI Host Controller
S:  SerialNumber=0000:00:14.0
C:  #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=0mA
I:  If#=0x0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub

T:  Bus=02 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=5000 MxCh= 6
D:  Ver= 3.00 Cls=09(hub  ) Sub=00 Prot=03 MxPS= 9 #Cfgs=  1
P:  Vendor=1d6b ProdID=0003 Rev=05.10
S:  Manufacturer=Linux 5.10.0-14-amd64 xhci-hcd
S:  Product=xHCI Host Controller
S:  SerialNumber=0000:00:14.0
C:  #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=0mA
I:  If#=0x0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub

after enable modprobe g_ether and connected my PC to the usb 3.0 port the only message that I see is

[  697.411111] udc-core: couldn't find an available UDC - added [g_ether] to list of pending drivers

Thanks

Can anyone help me, please? Unfortunately, the documentation on this board is lacking. I would also have the problem with the wifi that I cannot configure but it is not that important for my use.

Thanks

Finally, I’ve got my Rock Pi X. First tests with OTG worked out pretty well - no need for a hack as with a Rock Pi 4. Though, you’ve to enable it first in the BIOS. Without, the dwc3 controller doesn’t show up (lspci).

This has been done with

  • a Rock Pi X v1.41,
  • BIOS Build Date 09/24/2020 06:51:39 and
  • current ArchLinux (Kernel v5.18.6)

Necessary BIOS settings:

  • enter Chipset
  • enter South Bridge
  • enter USB Configuration
    • set USB OTG Support to PCI mode
    • set USB VBUS to Off
    • set Default DRD Config to DeviceMode

Cheers, Daniel

Hi, thank you very much. With these settings the OTG seems to works. Connecting to a windows PC the device is recognized as unknow device, but in Debian installed on my RockPI I can’t see any differences in dmesg or lspci and can’t discover the Windows PC to map, for example, a virtual usb ethernet. Please, can you post to me a working example of your installation?

Thank you very much