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 usb0 problem

I am working on AM335x custom board and using SDK 6.0.0. The USB0 port is configured as an OTG and using a mimi type B connector.

When connect nothing ( work as a USB client), we found the USB0 VBUS behaves as attached. It ripples every 2 seconds. Do you know why?

When acts as a USB host, we measured the USB0ID is low which is correct. The usb0 drvvbus should be high, but we measured low and therefore, no voltage rail for VBUS. This only happens when re-connection. If a USB device is attached to the OTG port before boot up. It is fine. After unplug and plug the USB device again, it went wrong as I said. Our drvvbus is connected to a EN of a USB power switch directly. 

Thanks.

  • Eric,

    Eric Lee4 said:
    When connect nothing ( work as a USB client), we found the USB0 VBUS behaves as attached. It ripples every 2 seconds. Do you know why?

    AM335x has a usb otg controller, which does not automatically detect if a usb device is plugged. So the driver sets USBx_DRVVBUS pin high to detect the usb device. This is done in a 2-sec timer, that is why you see the 2-sec pulses on VBUS.

    Eric Lee4 said:
    When acts as a USB host, we measured the USB0ID is low which is correct.

    You use a mini B connector, how the USB0_ID pin becomes low?

    Eric Lee4 said:
    The usb0 drvvbus should be high, but we measured low and therefore, no voltage rail for VBUS.

    To debug this, please

    1. Post the output of command 'cat /proc/driver/musb_hdrc.0' _before_ and _after_ connected the usb device.

    2. run command "echo func ti81xx_interrupt +p' > /sys/kernel/debug/dynamic_debug/control" _before_ connecting the usb device. Then connect the usb device and post the dmesg log.

    3. how big is the capacitor on USB0_VBUS?

  • From the scope plot it appears that VBUS is only reaching 3V...can you verify this?

  • Bin,

    1. You use a mini B connector, how the USB0_ID pin becomes low?

    --> I connect a USB OTG cable for sure.

    2. run command "echo func ti81xx_interrupt +p' > /sys/kernel/debug/dynamic_debug/control" _before_ connecting the usb device. Then connect the usb device and post the dmesg log.

    --> This part is weird now.

    === _before_connecting the usb device ===

    root@smarct335x:~# cat /proc/driver/musb_hdrc.0
    Status: MHDRC, Mode=Peripheral (Power=e0, DevCtl=19)
    OTG state: b_idle; 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)
    root@smarct335x:~# echo 'func ti81xx_interrupt +p' > /sys/kernel/debug/dynamic_debug/control
    root@smarct335x:~#

    === _after_connecting_ the usb device ===

    root@smarct335x:~# [ 129.959297] usb 2-1: new low-speed USB device number 2 using musb-hdrc
    [ 130.103038] usb 2-1: device v046d pc019 is not supported
    [ 130.108629] usb 2-1: New USB device found, idVendor=046d, idProduct=c019
    [ 130.115707] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
    [ 130.123229] usb 2-1: Product: USB Optical Mouse
    [ 130.127991] usb 2-1: Manufacturer: Logitech
    [ 130.138541] input: Logitech USB Optical Mouse as /devices/platform/omap/musb-ti81xx/musb-hdrc.0/usb2/2-1/2-1:1.0/input/input0
    [ 130.150898] generic-usb 0003:046D:C019.0001: input: USB HID v1.11 Mouse [Logitech USB Optical Mouse] on usb-musb-hdrc.0-1/input0

    root@smarct335x:~#

    I saw the USB working.

    root@smarct335x:~# cat /proc/driver/musb_hdrc.0 Status: MHDRC, Mode=Host (Power=e0, DevCtl=3d)
    OTG state: a_host; active
    Options: ?dma?, otg (peripheral+host), [eps=16]
    Peripheral address: 00
    Root port status: 00000303
    CPPI: txcr=0 txsrc=0 txena=0; rxcr=0 rxsrc=280de80 rxena=0
    Gadget driver: g_mass_storage

    RX10: 1buf rxcsr 3020 interval 0a max 0005 type f1; dev 2 hub 0 port 0
    rx dma9: 0 left, 00000000 00000000, 00000000 00000000; 00000000 00000000 00000000 .. 00000000
    qh de05a640 dev2 ep1-int max5
    in urb de112f40 0/5
    root@smarct335x:~# echo 'func ti81xx_interrupt +p' > /sys/kernel/debug/dynamic_debug/control
    root@smarct335x:~#

    === _disconnect_usb_device_ ===

    root@smarct335x:~# [ 266.595769] usb 2-1: USB disconnect, device number 2

    root@smarct335x:~# cat /proc/driver/musb_hdrc.0
    Status: MHDRC, Mode=Peripheral (Power=e0, DevCtl=80)
    OTG state: b_idle; 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)
    root@smarct335x:~# echo 'func ti81xx_interrupt +p' > /sys/kernel/debug/dynamic_debug/control
    root@smarct335x:~#

    === _re-connect_ usb device ===

    root@smarct335x:~# [ 372.429308] usb 2-1: new low-speed USB device number 3 using musb-hdrc
    [ 372.573042] usb 2-1: device v046d pc019 is not supported
    [ 372.578627] usb 2-1: New USB device found, idVendor=046d, idProduct=c019
    [ 372.585695] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
    [ 372.593204] usb 2-1: Product: USB Optical Mouse
    [ 372.597963] usb 2-1: Manufacturer: Logitech
    [ 372.608495] input: Logitech USB Optical Mouse as /devices/platform/omap/musb-ti81xx/musb-hdrc.0/usb2/2-1/2-1:1.0/input/input1
    [ 372.620831] generic-usb 0003:046D:C019.0002: input: USB HID v1.11 Mouse [Logitech USB Optical Mouse] on usb-musb-hdrc.0-1/input0

    root@smarct335x:~#

    root@smarct335x:~# cat /proc/driver/musb_hdrc.0 Status: MHDRC, Mode=Host (Power=e0, DevCtl=3d)
    OTG state: a_host; active
    Options: ?dma?, otg (peripheral+host), [eps=16]
    Peripheral address: 00
    Root port status: 00000303
    CPPI: txcr=0 txsrc=0 txena=0; rxcr=0 rxsrc=280de80 rxena=0
    Gadget driver: g_mass_storage

    RX10: 1buf rxcsr 3020 interval 0a max 0005 type f1; dev 3 hub 0 port 0
    rx dma9: 0 left, 00000000 00000000, 00000000 00000000; 00000000 00000000 00000000 .. 00000000
    qh de4c25c0 dev3 ep1-int max5
    in urb de112e40 0/5
    root@smarct335x:~# echo 'func ti81xx_interrupt +p' > /sys/kernel/debug/dynamic_debug/control
    root@smarct335x:~#

    === _disconnect_usb_device ===

    root@smarct335x:~# cat /proc/driver/musb_hdrc.0 Status: MHDRC, Mode=Peripheral (Power=f0, DevCtl=98)
    OTG state: b_idle; 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)
    root@smarct335x:~# echo 'func ti81xx_interrupt +p' > /sys/kernel/debug/dynamic_debug/control
    root@smarct335x:~#

    === _reconnect_usb_device_ ===

    Now I did not see my mouse light on and the mouse is not working. _BUT_

    root@smarct335x:~# cat /proc/driver/musb_hdrc.0

    Status: MHDRC, Mode=Peripheral (Power=e0, DevCtl=80)
    OTG state: b_idle; 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)
    root@smarct335x:~# [ 545.739293] usb 2-1: new low-speed USB device number 4 using musb-hdrc
    [ 545.883034] usb 2-1: device v046d pc019 is not supported
    [ 545.888624] usb 2-1: New USB device found, idVendor=046d, idProduct=c019
    [ 545.895702] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
    [ 545.903216] usb 2-1: Product: USB Optical Mouse
    [ 545.907982] usb 2-1: Manufacturer: Logitech
    [ 545.918474] input: Logitech USB Optical Mouse as /devices/platform/omap/musb-ti81xx/musb-hdrc.0/usb2/2-1/2-1:1.0/input/input2
    [ 545.930838] generic-usb 0003:046D:C019.0003: input: USB HID v1.11 Mouse [Logitech USB Optical Mouse] on usb-musb-hdrc.0-1/input0

    root@smarct335x:~#

    The mouse is light on and work again.

    root@smarct335x:~# echo 'func ti81xx_interrupt +p' > /sys/kernel/debug/dynamic_debug/control
    root@smarct335x:~#

    I tried a couple of of times and it behaves the same. It seems I have to manually type

    "# cat /proc/driver/musb_hdrc.0" to make my usb device working.

    Do you have any comments?

    3. how big is the capacitor on USB0_VBUS?

    --> The USB0_VBUS cap we are using is 2.2u

    This only happens in USB0 port. USB1 port works fine.

    -Eric

     

  • DK,

    The USB0_VBUS is measure directly from CPU. When usb0_vbus_detect signal becomes high, it will pull up USB0_VBUS to 5V.

    -Eric

  • The vbus cap we are using is 560u instead 2.2u. My previous info. was wrong.

    -Eric

  • Eric,

    Eric Lee4 said:
    --> I connect a USB OTG cable for sure.

    Something is missing here, mini-A adapter does not fit into mini-B receptacle, it is still unclear how the ID pin is grounded. But it is irrelevant to this enumeration issue.

    Eric Lee4 said:
    2. run command "echo func ti81xx_interrupt +p' > /sys/kernel/debug/dynamic_debug/control"

    I forgot to mention this command is only needed to run once. It enables extra debug message in dmesg log showing interrupt activities. I wanted to see the dmesg log, but seems not important for now, since the mouse somehow works...

    Eric Lee4 said:

    === _before_connecting the usb device ===

    root@smarct335x:~# cat /proc/driver/musb_hdrc.0
    Status: MHDRC, Mode=Peripheral (Power=e0, DevCtl=19)
    OTG state: b_idle; active

    Is this done right after booted the board, and the usb0 port never been touched? The DevCtl register value and the OTG state are wrong. Can you please provide the usb0 portion of your schematics?

    This stage should have the log as below (or DevCtl=88 sometimes depending on the timing of the timer).

        === _disconnect_usb_device_ ===
        root@smarct335x:~# cat /proc/driver/musb_hdrc.0
        Status: MHDRC, Mode=Peripheral (Power=e0, DevCtl=80)
        OTG state: b_idle; inactive
    

    Eric Lee4 said:

    === _disconnect_usb_device ===

    root@smarct335x:~# cat /proc/driver/musb_hdrc.0 Status: MHDRC, Mode=Peripheral (Power=f0, DevCtl=98)
    OTG state: b_idle; inactive

    If you keep running this cat command, do you ever get DevCtl=80 or 88?

    Eric Lee4 said:

    === _reconnect_usb_device_ ===

    Now I did not see my mouse light on and the mouse is not working. _BUT_

    root@smarct335x:~# cat /proc/driver/musb_hdrc.0

    Status: MHDRC, Mode=Peripheral (Power=e0, DevCtl=80)
    OTG state: b_idle; inactive

    Did you wait longer than 2 seconds? The mouse is still not enumerated? If not, please try to scope the VBUS line to see if you still get the 2 second pulse.

    Eric Lee4 said:

    I tried a couple of of times and it behaves the same. It seems I have to manually type

    "# cat /proc/driver/musb_hdrc.0" to make my usb device working.

    Do you have any comments?

    I've never seen this before. Let's try to figure out why.

    Eric Lee4 said:
    The vbus cap we are using is 560u instead 2.2u.

    I am not sure if 560uF is too big for VBUS to discharge. Let's see if DK has comments about it.

  • Ben,

    Is this done right after booted the board, and the usb0 port never been touched? The DevCtl register value and the OTG state are wrong. Can you please provide the usb0 portion of your schematics?

    --> The log is done right after booted the board, but I have a otg cable attached without USB mouse connected. I think the log should be correct because a OTG cable is there.

    Did you wait longer than 2 seconds? The mouse is still not enumerated? If not, please try to scope the VBUS line to see if you still get the 2 second pulse.

    --> Once reconnected, the mouse is not emulated forever and no VBUS presented unless I cat the /proc/driver/musb_hdrc.0 again. Sometimes I can reconnected once, but no luck for second times. If the USB device is connected before boot up, I can always see the USB device. But same, re-connection fails. Schematic is attached. 

    -Eric

  • Eric,

    To debug this issue, please don't leave the mini-A cable connected without a usb device plugged in. The driver should handle this case, but it is always tricky to handle.

    Eric Lee4 said:
    --> Once reconnected, the mouse is not emulated forever and no VBUS presented unless I cat the /proc/driver/musb_hdrc.0 again.

    Can you please scope the VBUS if the 2-second pulse is still happening?

    By the way the USB0_ID pin should not be tied to the 3.3V.

  • I meant always connect/disconnect the mouse with the otg cable together.

  • Bin,

    We used to suspect the pull up resistor of the usb0_id. We removed the pull-up resistor of USB0_ID and it makes no differences. 

    I will try connect/disconnect the mouse with the otg cable together.

    Our problem is that "sometimes" when the usb0_id is pull to gnd, but drvvbus is not high. 

    -Eric

  • And Bin, can you explain home come when I cat /proc/driver/musb_hdrc.0, the otg is back to normal.

    -Eric

  • Eric,

    Eric Lee4 said:
    We used to suspect the pull up resistor of the usb0_id. We removed the pull-up resistor of USB0_ID and it makes no differences. 

    I don't think this issue is because of connecting ID pin to power rail. But doing so could damage the device.

    Eric Lee4 said:
    Our problem is that "sometimes" when the usb0_id is pull to gnd, but drvvbus is not high. 

    In OTG configuration, DRVVBUS pin is indirectly driven by the 2-sec timer, so please scope USB0_VBUS pin, if it does not pulse any more, we will enable more debug messages.

    Eric Lee4 said:
    And Bin, can you explain home come when I cat /proc/driver/musb_hdrc.0, the otg is back to normal.

    Sorry, I don't have a good explanation right now, I never seen this behaviour before. The cat command only trigger the driver to read bunch of registers. I cannot think of any reading will trigger the SESSION.

     

  • Bin,

    Today I performed the USB0 mouse connect/reconnect test together with OTG cable as you wished.

    === _before connected_ ===

    root@smarct335x:~# cat /proc/driver/musb_hdrc.0
    Status: MHDRC, Mode=Peripheral (Power=e0, DevCtl=80)
    OTG state: b_idle; 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)
    root@smarct335x:~#

    root@smarct335x:~# echo 'func ti81xx_interrupt +p' > /sys/kernel/debug/dynamic_debug/control
    root@smarct335x:~#

    === _after_connected_ ===

    root@smarct335x:~# cat /proc/driver/musb_hdrc.0 Status: MHDRC, Mode=Host (Power=e0, DevCtl=3d)
    OTG state: a_host; active
    Options: ?dma?, otg (peripheral+host), [eps=16]
    Peripheral address: 00
    Root port status: 00000303
    CPPI: txcr=0 txsrc=0 txena=0; rxcr=0 rxsrc=280de80 rxena=0
    Gadget driver: g_mass_storage

    RX10: 1buf rxcsr 3020 interval 0a max 0005 type f1; dev 2 hub 0 port 0
    rx dma9: 0 left, 00000000 00000000, 00000000 00000000; 00000000 00000000 00000000 .. 00000000
    qh de1e9940 dev2 ep1-int max5
    in urb de59ccc0 0/5
    root@smarct335x:~#

    root@smarct335x:~# echo 'func ti81xx_interrupt +p' > /sys/kernel/debug/dynamic_debug/control
    root@smarct335x:~#

    I saw USB mouse is emulated and the USB0_VBUS is 5V from my scope.

    === _disconnect_otg_cable_ ===

    root@smarct335x:~# cat /proc/driver/musb_hdrc.0 Status: MHDRC, Mode=Peripheral (Power=e0, DevCtl=80)
    OTG state: b_idle; 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)
    root@smarct335x:~#

    root@smarct335x:~# echo 'func ti81xx_interrupt +p' > /sys/kernel/debug/dynamic_debug/control
    root@smarct335x:~#

    The USB0_VBUS is 0V.

    === _re-connected_otg_cable_ ===

    root@smarct335x:~# cat /proc/driver/musb_hdrc.0 Status: MHDRC, Mode=Host (Power=e0, DevCtl=3d)
    OTG state: a_host; active
    Options: ?dma?, otg (peripheral+host), [eps=16]
    Peripheral address: 00
    Root port status: 00000303
    CPPI: txcr=0 txsrc=0 txena=0; rxcr=0 rxsrc=280de80 rxena=0
    Gadget driver: g_mass_storage

    RX10: 1buf rxcsr 3020 interval 0a max 0005 type f1; dev 3 hub 0 port 0
    rx dma9: 0 left, 00000000 00000000, 00000000 00000000; 00000000 00000000 00000000 .. 00000000
    qh de1e9d80 dev3 ep1-int max5
    in urb de59c740 0/5
    root@smarct335x:~#

    root@smarct335x:~# echo 'func ti81xx_interrupt +p' > /sys/kernel/debug/dynamic_debug/control
    root@smarct335x:~#

    The USB mouse is emulated and usb0_vbus back to 5V.

    === _disconnceted_ ===

    root@smarct335x:~# cat /proc/driver/musb_hdrc.0 Status: MHDRC, Mode=Peripheral (Power=f0, DevCtl=98)
    OTG state: b_idle; 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)
    root@smarct335x:~#

    root@smarct335x:~# echo 'func ti81xx_interrupt +p' > /sys/kernel/debug/dynamic_debug/control
    root@smarct335x:~#

    === _re-connected_otg_cable_ ===

    This time. USB mouse is not emulated anymore and the usb0_vbus is staying at 0V. I waited here about 2 minutes and nothing changed.

    root@smarct335x:~# cat /proc/driver/musb_hdrc.0 Status: MHDRC, Mode=Peripheral (Power=e0, DevCtl=80)
    OTG state: b_idle; 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)
    root@smarct335x:~# [ 782.230622] usb 2-1: new low-speed USB device number 4 using musb-hdrc
    [ 782.374151] usb 2-1: device v046d pc019 is not supported
    [ 782.379694] usb 2-1: New USB device found, idVendor=046d, idProduct=c019
    [ 782.386704] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
    [ 782.394155] usb 2-1: Product: USB Optical Mouse
    [ 782.398874] usb 2-1: Manufacturer: Logitech
    [ 782.409261] input: Logitech USB Optical Mouse as /devices/platform/omap/musb-ti81xx/musb-hdrc.0/usb2/2-1/2-1:1.0/input/input2
    [ 782.421447] generic-usb 0003:046D:C019.0003: input: USB HID v1.11 Mouse [Logitech USB Optical Mouse] on usb-musb-hdrc.0-1/input0

    root@smarct335x:~# echo 'func ti81xx_interrupt +p' > /sys/kernel/debug/dynamic_debug/control
    root@smarct335x:~#

    Same as previous result, when I "# cat /proc/driver/musb_hdrc.0", the USB mouse is emulated again and usb0_vbus back to 5V.

    Is this a bug from AM335X? 

    Attached please find the dmesg.

    -Eric

     

     

  • Bin,

    One other thing, if I configure the usb0 port as a host in software, it seems quite normal. 

    -Eric

  • Eric,

    I am suspecting your VBUS discharge path has issue which causes VBUS discharge too slow. Please run the following sequence to enable more logs in your test. You only need to run the following ONCE right after booted the board.

    # echo 'file ti81xx.c +p' > /sys/kernel/debug/dynamic_debug/control
    # echo '8' > /proc/sys/kernel/printk
    

    This time you don't have to capture dmesg log, just capture ALL serial console logs along with your connect/disconnect test and post it here. I already redirected debug logs to the console.

  • Bin,

    Below is the test result.

    === _before connected_ ===

    root@smarct335x:~# echo 'file ti81xx.c +p' > /sys/kernel/debug/dynamic_debug/control
    root@smarct335x:~# echo '8' > /proc/sys/kernel/printk
    root@smarct335x:~#

    === _after_connected_ ===

    The USB mouse is not emulated now. 
    root@smarct335x:~# echo 'file ti81xx.c +p' > /sys/kernel/debug/dynamic_debug/control
    root@smarct335x:~# echo '8' > /proc/sys/kernel/printk root@smarct335x:~# echo 'file ti81xx.c +p' > /sys/kernel/debug/dynamic_debug/control
    root@smarct335x:~# 

    The USB mouse is still not emulated.

    === _disconnected_from_usb0_ ===

    root@smarct335x:~# echo 'file ti81xx.c +p' > /sys/kernel/debug/dynamic_debug/control
    root@smarct335x:~# echo '8' > /proc/sys/kernel/printk

    root@smarct335x:~#

    === -reconnected_ ===

    USB mouse is not emulated.

    root@smarct335x:~# echo 'file ti81xx.c +p' > /sys/kernel/debug/dynamic_debug/control
    root@smarct335x:~# echo '8' > /proc/sys/kernel/printk

    root@smarct335x:~#

    USB mouse is still not emulated.

    ===

    This time my USB0 mouse is not emulated at all. 

    If I "# cat /proc/driver/musb_hdrc.0", i saw the usb0 mouse is emulated.

    ===

    root@smarct335x:~# cat /proc/driver/musb_hdrc.0
    [ 585.705903] musb-hdrc musb-hdrc.0: b_idle inactive, starting idle timer for 1 0 ms
    [ 585.713809] musb-hdrc musb-hdrc.0: Poll devctl 80 (b_idle)
    Status: MHDRC, M[ 585.720211] musb-hdrc musb-hdrc.0: b_idle inactive, starting idle timer for 10 ms
    ode=Peripheral ([ 585.729331] musb-hdrc musb-hdrc.0: Poll devctl 81 (b_idle)
    Power=e0, DevCtl=80)
    OTG state: b_idle; 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)
    [ 585.771985] musb-hdrc musb-hdrc.0: usbintr (100) epintr(0)
    [ 585.777712] musb-hdrc musb-hdrc.0: Only micro-A plug is connected
    [ 585.784065] musb-hdrc musb-hdrc.0: VBUS on (b_idle), devctl 01
    root@smarct335x:~# [ 585.900837] musb-hdrc musb-hdrc.0: usbintr (10) epintr(0)
    [ 586.180648] usb 2-1: new low-speed USB device number 3 using musb-hdrc
    [ 586.187598] musb-hdrc musb-hdrc.0: usbintr (0) epintr(1)
    [ 586.193241] musb-hdrc musb-hdrc.0: usbintr (0) epintr(1)
    [ 586.198888] musb-hdrc musb-hdrc.0: usbintr (0) epintr(1)
    [ 586.204501] musb-hdrc musb-hdrc.0: usbintr (0) epintr(1)
    [ 586.210112] musb-hdrc musb-hdrc.0: usbintr (0) epintr(1)
    [ 586.330768] musb-hdrc musb-hdrc.0: usbintr (0) epintr(1)
    [ 586.336370] musb-hdrc musb-hdrc.0: usbintr (0) epintr(1)
    [ 586.360768] musb-hdrc musb-hdrc.0: usbintr (0) epintr(1)
    [ 586.366406] musb-hdrc musb-hdrc.0: usbintr (0) epintr(1)
    [ 586.372041] musb-hdrc musb-hdrc.0: usbintr (0) epintr(1)
    [ 586.377708] musb-hdrc musb-hdrc.0: usbintr (0) epintr(1)
    [ 586.383315] musb-hdrc musb-hdrc.0: usbintr (0) epintr(1)
    [ 586.389016] musb-hdrc musb-hdrc.0: usbintr (0) epintr(1)
    [ 586.394743] musb-hdrc musb-hdrc.0: usbintr (0) epintr(1)
    [ 586.400345] musb-hdrc musb-hdrc.0: usbintr (0) epintr(1)
    [ 586.405955] musb-hdrc musb-hdrc.0: usbintr (0) epintr(1)
    [ 586.411757] musb-hdrc musb-hdrc.0: usbintr (0) epintr(1)
    [ 586.417395] musb-hdrc musb-hdrc.0: usbintr (0) epintr(1)
    [ 586.423034] musb-hdrc musb-hdrc.0: usbintr (0) epintr(1)
    [ 586.428742] musb-hdrc musb-hdrc.0: usbintr (0) epintr(1)
    [ 586.434381] musb-hdrc musb-hdrc.0: usbintr (0) epintr(1)
    [ 586.439988] musb-hdrc musb-hdrc.0: usbintr (0) epintr(1)
    [ 586.445718] musb-hdrc musb-hdrc.0: usbintr (0) epintr(1)
    [ 586.451423] musb-hdrc musb-hdrc.0: usbintr (0) epintr(1)
    [ 586.457037] musb-hdrc musb-hdrc.0: usbintr (0) epintr(1)
    [ 586.462714] musb-hdrc musb-hdrc.0: usbintr (0) epintr(1)
    [ 586.468394] musb-hdrc musb-hdrc.0: usbintr (0) epintr(1)
    [ 586.474033] musb-hdrc musb-hdrc.0: usbintr (0) epintr(1)
    [ 586.479745] musb-hdrc musb-hdrc.0: usbintr (0) epintr(1)
    [ 586.485383] musb-hdrc musb-hdrc.0: usbintr (0) epintr(1)
    [ 586.491020] musb-hdrc musb-hdrc.0: usbintr (0) epintr(1)
    [ 586.496722] musb-hdrc musb-hdrc.0: usbintr (0) epintr(1)
    [ 586.502333] musb-hdrc musb-hdrc.0: usbintr (0) epintr(1)
    [ 586.508018] musb-hdrc musb-hdrc.0: usbintr (0) epintr(1)
    [ 586.513744] musb-hdrc musb-hdrc.0: usbintr (0) epintr(1)
    [ 586.519381] musb-hdrc musb-hdrc.0: usbintr (0) epintr(1)
    [ 586.524986] musb-hdrc musb-hdrc.0: usbintr (0) epintr(1)
    [ 586.530714] musb-hdrc musb-hdrc.0: usbintr (0) epintr(1)
    [ 586.536284] usb 2-1: device v046d pc019 is not supported
    [ 586.541840] usb 2-1: New USB device found, idVendor=046d, idProduct=c019
    [ 586.548829] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
    [ 586.556276] usb 2-1: Product: USB Optical Mouse
    [ 586.561007] usb 2-1: Manufacturer: Logitech
    [ 586.565917] musb-hdrc musb-hdrc.0: usbintr (0) epintr(1)
    [ 586.571516] musb-hdrc musb-hdrc.0: usbintr (0) epintr(1)
    [ 586.584471] musb-hdrc musb-hdrc.0: usbintr (0) epintr(1)
    [ 586.590086] musb-hdrc musb-hdrc.0: usbintr (0) epintr(1)
    [ 586.596253] musb-hdrc musb-hdrc.0: usbintr (0) epintr(1)
    [ 586.601902] musb-hdrc musb-hdrc.0: usbintr (0) epintr(1)
    [ 586.607547] musb-hdrc musb-hdrc.0: usbintr (0) epintr(1)
    [ 586.613191] musb-hdrc musb-hdrc.0: usbintr (0) epintr(1)
    [ 586.618833] musb-hdrc musb-hdrc.0: usbintr (0) epintr(1)
    [ 586.624472] musb-hdrc musb-hdrc.0: usbintr (0) epintr(1)
    [ 586.630114] musb-hdrc musb-hdrc.0: usbintr (0) epintr(1)
    [ 586.635748] musb-hdrc musb-hdrc.0: usbintr (0) epintr(1)
    [ 586.641361] musb-hdrc musb-hdrc.0: usbintr (0) epintr(1)
    [ 586.647985] input: Logitech USB Optical Mouse as /devices/platform/omap/musb- ti81xx/musb-hdrc.0/usb2/2-1/2-1:1.0/input/input1
    [ 586.660138] generic-usb 0003:046D:C019.0002: input: USB HID v1.11 Mouse [Logi tech USB Optical Mouse] on usb-musb-hdrc.0-1/input0
    [ 587.770646] musb-hdrc musb-hdrc.0: Poll devctl 3d (a_host)

    === _disconnected_give_me_some_logs_ ===

    root@smarct335x:~# [ 710.501640] musb-hdrc musb-hdrc.0: usbintr (20) epintr(0)
    [ 710.507327] musb-hdrc musb-hdrc.0: a_wait_bcon inactive, starting idle timer for 1100 ms
    [ 710.515839] usb 2-1: USB disconnect, device number 3
    [ 711.600649] musb-hdrc musb-hdrc.0: Poll devctl 19 (a_wait_bcon)
    [ 713.600650] musb-hdrc musb-hdrc.0: Poll devctl 98 (b_idle)

    ===

    Are the results related to VBUS discharging?? Normally, when usb0_id is grounded, the cpu should assert drvvbus and pull the vbus high.

    -Eric 

     

  • Eric Lee4 said:

    === _disconnected_give_me_some_logs_ ===

    root@smarct335x:~# [ 710.501640] musb-hdrc musb-hdrc.0: usbintr (20) epintr(0)
    [ 710.507327] musb-hdrc musb-hdrc.0: a_wait_bcon inactive, starting idle timer for 1100 ms
    [ 710.515839] usb 2-1: USB disconnect, device number 3
    [ 711.600649] musb-hdrc musb-hdrc.0: Poll devctl 19 (a_wait_bcon)
    [ 713.600650] musb-hdrc musb-hdrc.0: Poll devctl 98 (b_idle)

    This confirms my suspicion - VBUS discharge is slow, within 2 seconds after unplugged the mouse, it is still > 4.4 V, which prevents to start the timer.

    Eric Lee4 said:
    Normally, when usb0_id is grounded, the cpu should assert drvvbus and pull the vbus high.

    True for host mode, but not for otg mode.

  • Bin,

    What cap value will you recommend?

    -Eric

  • The USB Specs require minimum 120uF cap on VBUS, but I doubt your case is the cap issue. I will try if I can get a HW expert to review your schematics you posted before.

  • Bin Liu said:

    The USB Specs require minimum 120uF cap on VBUS, but I doubt your case is the cap issue. I will try if I can get a HW expert to review your schematics you posted before.

    While true for a Host design, each of these three operating modes (Host, Peripheral, OTG) have different PCB design requirements.  For example, as Bin mentions, the minimum VBUS capacitance for a USB Host is 120 uF but the maximum VBUS capacitance for a USB Peripheral is 10 uF, and the VBUS capacitance must be 1 -6.5 uF for a USB OTG device.  This is the reason the AM335x EVM has a 4.7 uF capacitor connected to VBUS with a jumper that allows another 150 uF capacitor to be connected to VBUS.  

    If OTG operation is desired, VBUS capacitance should be 1-6.5uF.