Set USB1 in host mode on iMX8MP

Hello, here is my setup:

  • Module: Verdin iMX8MP V1.1A
  • Custom board based on Yavia
  • Torizon Core “torizon-core-docker-verdin-imx8mp-Tezi_6.2.0+build.2”

We want to use USB1 as a normal USB 2.0 (= host mode). To achieve this, I’ve writed a custom overlay that I’m using on my module by updating " /sysroot/boot/ostree/torizon-*/dtb/overlays.txt":

/dts-v1/;
/plugin/;

/ {
	compatible = "toradex,verdin-imx8mp";
};

// Set USB1 in Host mode instead of OTG mode

&usb3_0 {
  status = "okay";
};

&usb3_phy0 {
  status = "okay";
};

&usb_dwc3_0 {
  status = "okay";
  dr_mode = "host";
};

I’m now able to use my USB device when plugged in before boot. But if I disconnect the device, I’m now unable to use USB1. Here is the “dmesg” result after disconnecting the device:
usb 1-1: device no response, device descriptor read/64, error -71

Am I missing something in the overlay ? Let me know if I can provide more information.

Best regards

Hi @clem !

Sorry, but I am not sure that I fully understood your use case.

Please correct me if I am wrong:

  • If you boot your module with the USB device connected to the USB1 interface of the module, the USB device works well.

  • If you boot your module without the USB device connected to the module, then, after the boot, you connect the USB device to the USB1 interface of the module, and the USB device doesn’t work.

Could you please specify which USB device you are trying to use?

Please share the tdx-info --all output (reference: Getting Device Information with Tdx-Info | Toradex Developer Center).

Also, please share the full output of dmesg in both cases and the output of lsusb.

Is that right?

This is exactly the encountered behavior.
I am using an audio USB adapter (SL-8850-BK-01, CM108 audio controller). I am also able the reproduce the behavior with a simple FAT32 storage USB key.

Please find the relevant logs:

System informations:
tdxinfo.txt (27.5 KB)

USB device connected before boot
dmesg.txt (34.0 KB)

# lsusb
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 0d8c:013c C-Media Electronics, Inc. CM108 Audio Controller
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

USB device connected after boot
dmesg.txt (35.7 KB)

# lsusb
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

USB device connected before boot, then disconnected without shutting down the module
dmesg.txt (36.2 KB)

Thank you for your help

Hello @clem ,
I am trying to reproduce your issue .
How are you connecting your devices to the J7 connector? Are they native USB C devices or are you connecting them through a USB C to USB A adaptor?

Best regards,
Josep

Hello, as we are on a custom board, we have mounted a USB A 2.0 connector where we usually have a USB C connector at J7 on Yavia board. We are using USB 2.0 device.

Hello @clem,

could you please share your schematic with us? You can send it to support@toradex,.com

Best Regards,

Matthias Gohlke

Hello, the schematic is quite simple:

I wonder if the problem would still be there is the device tree modifications were done directly in the device tree when building the image, instead of using an overlay. Unfortunately I don’t have time to test that idea for now.

Thank you for your help

hello @clem,

where is the rest of the schematic?
what is with the the power delivery? with the USB OC# signal and EN and ID?

Best Regards,

Matthias Gohlke

hello @clem,

is there anything new here? Do you still need help?

Best Regards,

Matthias Gohlke

Hello @matthias.tx , sorry for the late response.
We are not using OC and EN as we are sure we won’t be using too much current.
We looked into the schematic for the ID pin and we didn’t connect it ! It looks like we need to set it to GND for USB host mode so we will test this now.
I’ll update this post when done.
Thanks

We connected ID to GND but it’s not working better.
For now our workaround is to connect a USB hub before boot so that is it well detected, and then connect our USB device whenever we want to the hub.

Hello @clem,

In your schematic snippet, i can see that you are connecting the Digital signal GND with the SHIELD Ground. This should not be done!!! I have seen many times problems with that.
It is good to follow our ref. design and also our free 30 min hardware design call.
Also we offer design reviews.

Best Regards,
Matthias

hello, is there anything new?

Best rgards,

Matthias

Hello, our design now always have a hub after the USB port so we no more encounter this problem. That’s why I didn’t worked more on it.

Thanks for you help

Clément