Why isn't my USB port detecting anything

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

Why isn't my USB port detecting anything

4,638 Views
michaelworster
Contributor IV

I have a board, using an i.MX6DL. The board has 2 USB ports (P75 and P76). The first port, P75, is fed from the i.MX6's "USB OTG" pins, and the second port, P76, uses the i.MX6's USB_H1 pins. Both are supposed to be used as standard USB Host devices.

When using the ports, in U-Boot, both seem to be fully functional. I can see USB devices plugged in (via `usb tree`) and I can view the contents of the USB devices (via `fatls USB 0` and `fatls USB 1`). So clearly there is no hardware issue here.

Once I boot to the kernel, P76 still works as expected, but P75 shows no reaction at all when any USB device it plugged in.

One of my USB is a flash drive with a LED on it. The LED lights up when I plug it in to P75. Thus it would appear that the USB port is indeed powered still, but the kernel doesn't give any indication that something is plugged in.

Looking for thoughts on what could be wrong, and/or debugging steps to take.

My device tree for P75:

&usbotg {
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_usbotg>;
    vbus-supply = <&vbat>;
    disable-over-current;
    srp-disable;
    hnp-disable;
    adp-disable;
    status = "okay";
};

Labels (2)
0 Kudos
6 Replies

2,979 Views
igorpadykov
NXP Employee
NXP Employee

Hi Michael

one can try dr_mode = "peripheral" /* Set controller as host-only mode */

as suggested in sect.39.2.6 Changing the Controller Operation Mode

attached Linux Manual. Check USB_OTG_ID (should be low in host mode)

imx6qdl-sabresd.dtsi

imx6qdl-sabresd.dtsi\dts\boot\arm\arch - linux-imx - i.MX Linux kernel 

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

2,979 Views
michaelworster
Contributor IV

Igor,

    Thanks for the input. I read the section you pointed out and attempted the suggestion of adding:

dr_mode = "peripheral"

    to my usbotg node, however it didn't change anything. I ran a test with dr_mode = "host" and saw the Power went out (the LED on the USB stick didn't light up) then changed it back to "peripheral". When I changed it back, the power was back on the USB port (LED lit up) but the USB stick insertion didn't trigger anything at the kernel level. (nothing new printed in dmesg)

igorpadykov wrote:

Check USB_OTG_ID (should be low in host mode)

We have i.MX6 pin T4 (USB_OTG_ID) pulled to Ground in our design, as we never intended it to be used as an OTG device.

Any other thoughts?

-Mike

0 Kudos

2,979 Views
igorpadykov
NXP Employee
NXP Employee

Hi Mike

also one can try software tweaking using AN4589 Configuring USB on i.MX 6 Series Processors
https://www.nxp.com/docs/en/application-note/AN4589.pdf

Best regards
igor

2,979 Views
michaelworster
Contributor IV

Igor,

    Thanks for the Application Note on USB Configuration. As I was reading through it I saw the USBPHYX_PWD register set mentioned. As I understand it, from section 4.3.2 of the Application note, in order for normal USB operations to work, this register must be cleared.

When I read out the bits for USBPHY1_PWD:
# devmem2 0x020C9000

   0x00000000

I can see all the bits are clear, which makes sense. However when I check out the register for USB2:

# devmem2 0x020CA000

  0x261EC04A

Most of this register is RESERVED, but at least bits 20-17 should be clear for everything to be fully enabled. I attempted to use the devmem2 tool to clear these bits:

# devmem2 0x020CA000 w 0x00000000

the operation reports success, but when I read the register again it's still set to "0x261EC04A".

Do you have any ideas what would cause it to be in this state?

0 Kudos

2,979 Views
peter_grant
Contributor I

Michael,

Do you have any update on your USB_OTG detection by Linux problem? Did you resolve your issue?

I'm seeing the same behaviour on one of our designs. The USB is detected by uboot (on power cycle) but not by Linux. i.e. no dmesg updates.

0 Kudos

2,979 Views
igorpadykov
NXP Employee
NXP Employee

Hi Mike

for simple examples describing usb configuration one can also look in baremetal sdk

(zip available on https://community.nxp.com/thread/432859 )

Best regards
igor

0 Kudos