USB Gadget not working

Hello.

I have a custom designed base board with the Colibri iMX6ULL. I’m using USB OTG1 port (Pins 143 and 145 on Colibri connector).

The USB port seems to work because if I boot in “recovery” mode the iMX6ULL CPU is enumerted. If I boot the Colibri module into the Linux OS and I have the USB OTG port attached to my PC, the USB gadget is working as expected. I have a mass storage device enabled and also the ethernet over USB driver.

But, if the Colibri module is bootet without the USB cable connected, the USB gadget feature isn’t working. I see some kernel messages about disconnecting USB (I think this means that the USB host mode is switched off):

[   26.876005] ci_hdrc ci_hdrc.0: remove, state 4
[   26.889027] usb usb1: USB disconnect, device number 1
[   26.910705] ci_hdrc ci_hdrc.0: USB bus 1 deregistered

But on the PC side I get some error messages:

[23065.603607] usb 2-2: new high-speed USB device number 19 using xhci_hcd
[23070.643741] xhci_hcd 0000:00:14.0: Timeout while waiting for setup device command
[23076.019745] xhci_hcd 0000:00:14.0: Timeout while waiting for setup device command
[23076.227700] usb 2-2: device not accepting address 19, error -62
[23076.227777] usb usb2-port2: unable to enumerate USB device

I think something isn’t working correctly on the Colibri module. Maybe something isn’t loaded if I connect the USB cable during runtime??

To sum this up: USB gadget is working if the cable is connected during boot. If the USB cable is not connected when booting Linux, it is not working. So, I don’t think this is a hardware problem. I think there is some software problem!

I hope someone can help me.

Thanks,
Andreas

1 Like

hi Andreas

Could you provide the software version of your module? Which carrier board are you using?
Please share the dmesg log and the output of ‘lsusb’ in a file? Thanks.

Best regards,
Jaski

I built the Linux OS from scratch with your yocto environment to customize the device tree for my carrier board. I don’t use an evaluation board from Toradex. I designed my own one but used the USB circuit from your Colibri Evaluation board.

I uploaded the output of dmesg and lsusb

  • dmesg.log shows the dmesg output after booting the device without USB connection
  • dmesg_connected.log shows the dmesg after I connected the USB cable and USB gadget is not working
  • dmesg_working.log shows the dmesg output when booting the device already with the USB connection (in this case USB gadget is working)
  • lsusb.log is the lsusb output when no USB cable is attached
  • lsusb_connected.log is the error which is shown when the USB cable is attached

Thanks,
Andreas

Thanks very much.

Could you also share the devicetree files and the kernel config?
What is the software version of the module ( uname -a )?

Kernel version is uname -a:
Linux colibri-imx6ull 4.9.166-2.8.6+gd899927 #4 SMP Mon May 6 12:12:34 UTC 2019 armv7l GNU/Linux

The devicetree contains some changes for my carrier board: devicetree files
The kernel config is the original one: Kernel config

hi @aauer1

Thanks for the files. We are looking into this issue and come soon back to you.

Could you just tell us how urgent is this issue?

Best regards,
Jaski

Thanks. One additional observation. If the device is bootet with the USB connection (working USB gadget) there is this output in dmesg:

[   15.329251] configfs-gadget gadget: high-speed config #1: c

And this output is also printed if I disconnect and connect the USB cable when USB gadget is working.

In the non-working case (booting the device without USB connection and attaching it during runtime) this output doesn’t show up!

It is not that urgent that I need it immediately (because as a workaround we can boot the device with USB attached).

Thanks,
Andreas

Thanks for your Input. We were able to reproduce this issue on our carrier boards. We will come back to you, once this issue is fixed.

Best regards,
Jaski

Hi @aauer1

We found a workaround for the issue.

If you change dr_mode from otg to peripheral in DTS, then the issue is fixed. Unfortunately you also lose the possibility to dynamically change the roles (host or peripheral.

Is this workaround OK for you?

Best regards,
Jaski