This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

am335x USB-OTG falls to device-only mode

Other Parts Discussed in Thread: AM3354

Hello!

I have configured USB0 port at the am3354 as OTG. When I plug a USB flash drive into OTG connector (USB_ID pin to GND), everything is OK, and I see USB0_DRVVBUS is HIGH. I can repeat this action many times and everything works. Then I plug my board as a device into PC (USB_ID is floating), I see a new USB device in the "lsusb" output of the PC. USB0_DRVVBUS is LOW, everything is OK.

But when I try to plug a USB flash drive back (USB_ID pin to GND), I don't see anything. USB0_DRVVBUS signal always stays LOW and I can use my board only as a USB-device.

What could be the reason?

  • Hi,

    What software are you using?
  • Hi,

    We are using a Linux am335x-evm 3.2.0 kernel
  • Ivan,

    What is the AMSDK version of your 3.2 kernel?

    After plugged to the PC and unplugged, please run the following command on the board serial console and provide its output.

    # cat /proc/driver/musb-hdrc.0

    Please also provide the USB portion of the schematics.

  • Hello Bin Liu,

    Thank You for your responce.

    How do I know the SDK version? Where to look?

    Board plugged to PC (device mode):

    root@am335x-evm:~# cat /proc/driver/musb_hdrc.0
    Status: MHDRC, Mode=Peripheral (Power=f0, DevCtl=99)
    OTG state: b_peripheral; active
    Options: ?dma?, otg (peripheral+host), [eps=16]
    Peripheral address: 00
    Root port status: 00000100
    CPPI: txcr=0 txsrc=0 txena=0; rxcr=0 rxsrc=280de80 rxena=0
    Gadget driver: g_mass_storage

    ep0 (hw0): 1buf, csr 0000 maxp 0000
            (queue empty)

    ep1in (hw1): 1buf dma, csr 2400 maxp 0200
    TX DMA0: 00000000 00000000, 00000000 00000000; 00000000 00000000 00000000 .. 00000000
            (queue empty)

    ep1out (hw1): 1buf dma, csr 2000 maxp 0200
    RX DMA0: 2 left, 00000000 00000000, 00000000 00000000; 00000000 00000000 00000000 .. 00000000
            req ce103810, -820952856/-818056704

    Board unplugged from PC:

    root@am335x-evm:~# cat /proc/driver/musb_hdrc.0
    Status: MHDRC, Mode=Peripheral (Power=f0, DevCtl=91)
    OTG state: b_peripheral; inactive
    Options: ?dma?, otg (peripheral+host), [eps=16]
    Peripheral address: 00
    Root port status: 00000100
    CPPI: txcr=0 txsrc=0 txena=0; rxcr=0 rxsrc=280de80 rxena=0
    Gadget driver: g_mass_storage

    ep0 (hw0): 1buf, csr 0000 maxp 0000
            (queue empty)

    ep1in (hw1): 1buf dma, csr 2400 maxp 0200
    TX DMA0: 00000000 00000000, 00000000 00000000; 00000000 00000000 00000000 .. 00000000
            (queue empty)

    ep1out (hw1): 1buf dma, csr 2000 maxp 0200
    RX DMA0: 2 left, 00000000 00000000, 00000000 00000000; 00000000 00000000 00000000 .. 00000000
            req ce103610, -820952856/-818056672

    USB connection is typical (RED to VBUS, BLACK to GND), excluding ID pin. It is routed to the GND (OTG host mode) through the connector which allows to disconnect ID from GND for "floating" ID (OTG device mode).

  • Ivan Nikolaenko said:
    How do I know the SDK version? Where to look?

    You should have the SDK version or PSP version when you get the kernel package. But I think I know what the problem is - your board didn't design the VBUS discharge path correctly. Please refer to the following thread.

    USB mode does not return to b_idle