iMX6ULL random HID detection on Linux

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

iMX6ULL random HID detection on Linux

Jump to solution
411 Views
jean_barre
Contributor I

When I plug a device (iMX6ULL) on a USB port of my host PC running Linux, the detection is unstable.
It always shows:
[xxx.xxxxxxx] usb 3-3.1: new high-speed USB device number X using xhci_hcd

In case of success, it shows:
[xxx.xxxxxxx] usb 3-3.1: New USB device found, idVendor=15a2, idProduct=0080, bcdDevice= 0.01 [xxx.xxxxxxx] usb 3-3.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[xxx.xxxxxxx] usb 3-3.1: Product: SE Blank 6ULL
[xxx.xxxxxxx] usb 3-3.1: Manufacturer: Freescale SemiConductor Inc

But sometimes (50%), detection is not completed and succession of error messages comes:
[xxx.xxxxxxx] usb 3-3.1: device descriptor read/64, error -110

I tried with different versions of the xhci_hdc driver (Ubuntu 18.04 / 20.04 / 22.04).
I tried with USB 3.0 and 2.0 ports, with/out an externally powered USB hub.
I tried on a Windows host PC and it shows 100% of success.
I tried with the iMX boot mode set to boot from fuse and serial download.
I tried with a battery plugged in before to power on the iMX before attempting USB detection.

The purpose is to run a serial download using imx_usb_loader after HID detection (device VID/PID required).

I enabled usb drivers debugging:
$ echo "file drivers/usb/* +p" > /sys/kernel/debug/dynamic_debug/control

Error or success, the beginning is the same:
[ 188.968754] xhci_hcd 0000:00:14.0: Port change event, 3-3, id 3, portsc: 0xc400fe3
[ 188.968765] xhci_hcd 0000:00:14.0: resume root hub
[ 188.968775] xhci_hcd 0000:00:14.0: port resume event for port 3
[ 188.968778] xhci_hcd 0000:00:14.0: resume HS port 3
[ 188.968823] usb usb3: usb wakeup-resume
[ 188.968832] usb usb3: usb auto-resume
[ 188.968848] hub 3-0:1.0: hub_resume
[...]

This message occurs at different moments:
[ 324.623302] xhci_hcd 0000:00:14.0: xhci_hub_status_data: stopping usb3 port polling

It ends with a timeout in case of error:
[ 189.263462] xhci_hcd 0000:00:14.0: // Ding dong!
[ 189.263481] xhci_hcd 0000:00:14.0: Successful setup context command
[ 189.263486] xhci_hcd 0000:00:14.0: Op regs DCBAA ptr = 0x0000010fcdf000
[ 189.263489] xhci_hcd 0000:00:14.0: Slot ID 4 dcbaa entry @00000000e9b0d716 = 0x00000102e25000
[ 189.263493] xhci_hcd 0000:00:14.0: Output Context DMA address = 0x102e25000
[ 189.263496] xhci_hcd 0000:00:14.0: Internal device address = 0
[ **194.355421**] xhci_hcd 0000:00:14.0: Cancel URB 0000000035cb4b23, dev 3.1, ep 0x0, starting at offset 0x102e23000

While in case of success:
[ 324.851333] xhci_hcd 0000:00:14.0: // Ding dong!
[ 324.851353] xhci_hcd 0000:00:14.0: Successful setup context command
[ 324.851358] xhci_hcd 0000:00:14.0: Op regs DCBAA ptr = 0x0000010fcdf000
[ 324.851361] xhci_hcd 0000:00:14.0: Slot ID 6 dcbaa entry @00000000a47e2bb9 = 0x00000102e25000
[ 324.851365] xhci_hcd 0000:00:14.0: Output Context DMA address = 0x102e25000
[ 324.851368] xhci_hcd 0000:00:14.0: Internal device address = 0
[ 324.851478] xhci_hcd 0000:00:14.0: Waiting for status stage event
[ 324.943305] xhci_hcd 0000:00:14.0: Resetting device with slot ID 6
[ 324.943317] xhci_hcd 0000:00:14.0: // Ding dong!
[ 324.943325] xhci_hcd 0000:00:14.0: Completed reset device command.
[...]

Comparison of wireshark USB capture shows a host -> 3.1.0 USB URB GET_STATUS Request message is expected but never occurs in case of error.

0 Kudos
1 Solution
361 Views
jean_barre
Contributor I

Hello @Chavira ,

Further explorations led us to get more control over the power sequence.

The USB detection seems to be improved when we force time when first power up the iMX core, then the USB phy interface.

Thank you for your help here

View solution in original post

0 Kudos
2 Replies
379 Views
Chavira
NXP TechSupport
NXP TechSupport

Hi @jean_barre!

Thank you for contacting NXP Support!

It looks like a host mistake.

Please try with another PC or Distro or another cable.

Normally you don't need special drivers in the host.

It is very rare that mistake but I am sure that is not the board.

Best Regards!

Chavira

0 Kudos
362 Views
jean_barre
Contributor I

Hello @Chavira ,

Further explorations led us to get more control over the power sequence.

The USB detection seems to be improved when we force time when first power up the iMX core, then the USB phy interface.

Thank you for your help here

0 Kudos