Project

General

Profile

USB Device mode communication problems

Added by iseori kang about 1 month ago

USB0 is set to device mode.
It stops working on some laptops.
The driver is detected but communication stops.
The problem does not occur when connecting through a USB hub.
Have you ever seen a similar case?

  • Version
    1. OS: Debian GNU/Linux 12 (bookworm) aarch64
    2. Host: Critical Link MitySOM-AM62x
    3. Kernel: 5.10.168-01697-g501ba3235e01-dirty
    4. H/W : 6252-TX-X8D-RI 24-02-08 (kingston)

Replies (10)

RE: USB Device mode communication problems - Added by Michael Williamson about 1 month ago

Hello,

How is the USB0 device configured? As a gadget device (rndis, cdc, serial port, mass storage device, etc.)?

We have not seen this behavior here, I'd like to try to reproduce your setup if possible.

With regards,
Mike

RE: USB Device mode communication problems - Added by iseori kang 25 days ago

Hello, Mike.

USB0 device settings.

H/W

USB0 Connector : Mini-B
The circuit has a common-mode filter and a TVS. There are no special connections.
Vbus is designed to be a reference (1.64V input to the pin)
USB1_DRVVBUS is floating

Thank you and best regards,

RE: USB Device mode communication problems - Added by iseori kang 13 days ago

Hello, Mike.

Do you have any updates on this?

Thank you and best regards,

RE: USB Device mode communication problems - Added by Michael Williamson 13 days ago

I have not been able to reproduce it here, yet.

Do you get any messages from "dmesg" when the communication is dropped?

If you unplug and replug the cable, does the connection re-establish?

Have you sent Jonathan a copy of your schematic, I can review that as well.

With regards,
Mike

RE: USB Device mode communication problems - Added by Jonathan Cormier 13 days ago

Have you sent Jonathan a copy of your schematic, I can review that as well.

The schematic I received was only the ethernet section so its missing the USB.

RE: USB Device mode communication problems - Added by iseori kang 13 days ago

Hello,

We noticed that the message is different for success and failure.
It is only coming from a few laptops.
(Lenovo family more often)

I've attached a schematic, nothing special.
USB1 is being used for internal communication without any problems (dual roll).

Messages when USB is working
root@EtherFOS-500P:/sys/kernel/debug/usb/31000000.usb# cat link_state
On
root@EtherFOS-500P:/sys/kernel/debug/usb/31000000.usb# cat link_state
Disconnected

Messages when USB is not working
root@EtherFOS-500P:/sys/kernel/debug/usb/31000000.usb# cat link_state
Sleep
root@EtherFOS-500P:/sys/kernel/debug/usb/31000000.usb# cat link_state
Sleep

best regards,

RE: USB Device mode communication problems - Added by iseori kang 13 days ago

Forwarding additional content

Messages when USB is working
[ 259.298196] drivers/usb/dwc3/gadget.c:3693 dwc3_gadget_interrupt() event->type = 0/Disconnect
[ 267.416974] drivers/usb/dwc3/gadget.c:3693 dwc3_gadget_interrupt() event->type = 6/End of Periodic Frame
[ 267.540102] drivers/usb/dwc3/gadget.c:3693 dwc3_gadget_interrupt() event->type = 1/Reset
[ 267.550538] drivers/usb/dwc3/gadget.c:3693 dwc3_gadget_interrupt() event->type = 2/Connect Done

Messages when USB is not working
[ 349.215349] drivers/usb/dwc3/gadget.c:3693 dwc3_gadget_interrupt() event->type = 0/Disconnect
[ 358.787954] drivers/usb/dwc3/gadget.c:3693 dwc3_gadget_interrupt() event->type = 6/End of Periodic Frame
[ 358.882609] drivers/usb/dwc3/gadget.c:3693 dwc3_gadget_interrupt() event->type = 1/Reset
[ 358.937354] drivers/usb/dwc3/gadget.c:3693 dwc3_gadget_interrupt() event->type = 2/Connect Done
[ 358.986464] drivers/usb/dwc3/gadget.c:3693 dwc3_gadget_interrupt() event->type = 6/End of Periodic Frame
[ 359.083830] drivers/usb/dwc3/gadget.c:3693 dwc3_gadget_interrupt() event->type = 4/Wake-Up
[ 359.085081] drivers/usb/dwc3/gadget.c:3693 dwc3_gadget_interrupt() event->type = 6/End of Periodic Frame
[ 359.155648] drivers/usb/dwc3/gadget.c:3693 dwc3_gadget_interrupt() event->type = 4/Wake-Up
[ 359.156670] drivers/usb/dwc3/gadget.c:3693 dwc3_gadget_interrupt() event->type = 6/End of Periodic Frame
[ 359.180394] drivers/usb/dwc3/gadget.c:3693 dwc3_gadget_interrupt() event->type = 4/Wake-Up
[ 359.181546] drivers/usb/dwc3/gadget.c:3693 dwc3_gadget_interrupt() event->type = 6/End of Periodic Frame
[ 359.182172] drivers/usb/dwc3/gadget.c:3693 dwc3_gadget_interrupt() event->type = 4/Wake-Up
[ 359.184161] drivers/usb/dwc3/gadget.c:3693 dwc3_gadget_interrupt() event->type = 6/End of Periodic Frame
[ 359.184461] drivers/usb/dwc3/gadget.c:3693 dwc3_gadget_interrupt() event->type = 4/Wake-Up
[ 359.186127] drivers/usb/dwc3/gadget.c:3693 dwc3_gadget_interrupt() event->type = 6/End of Periodic Frame
[ 359.672601] drivers/usb/dwc3/gadget.c:3693 dwc3_gadget_interrupt() event->type = 4/Wake-Up
[ 359.674096] drivers/usb/dwc3/gadget.c:3693 dwc3_gadget_interrupt() event->type = 6/End of Periodic Frame

When the problem occurs, the highlighted part of the image does not come out.

RE: USB Device mode communication problems - Added by iseori kang 12 days ago

Hello,

The team seems to have solved it with the following settings.

Fixed Dts file

snps,usb2-lpm-disable;
snps,usb2-gadget-lpm-disable;

best regards,

RE: USB Device mode communication problems - Added by Jonathan Cormier 12 days ago

iseori kang wrote in RE: USB Device mode communication problems:

Hello,

The team seems to have solved it with the following settings.

Fixed Dts file

snps,usb2-lpm-disable;
snps,usb2-gadget-lpm-disable;

Good find. Interestingly in the 6.6 kernel both the AM62A and AM62P have those lpm-disable options for both USB0 and USB1.

https://lore.kernel.org/all/20240412-for-v6-10-am62-usb-typec-dt-v7-3-93b827adf97e@kernel.org/

As per AM62A TRM [1] USB Link Power Management (LPM)
feature is not supported. Disable it else it may
cause enumeration failure on some devices.

4.9.2.1 USB2SS Unsupported Features
The following features are not supported on this family of devices:
...
- USB 2.0 ECN: Link Power Management (LPM)
...

Checking the AM62x TRM, it also lists the same LPM issue. So I would recommend applying the lpm-disable to both USB ports. We will follow up with TI about getting this applied to the AM62x as well.

    (1-10/10)
    Go to top
    Add picture from clipboard (Maximum size: 1 GB)