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_VBUS pins operation in OTG mode causing random reboots

Other Parts Discussed in Thread: AM3358, TPS65217

We have a problem with a custom board design based on an AM3358 and a TPS65217 PMIMC. The power supply arrangement is like a Beaglebone black. We (and others with Beaglebone blacks) have had an issue with intermittent reboots (about 1 every 12 hours).

We have tracked this down to Linux kernel issues and possibly TPS65217 issues, see below.

One point in this is that it appears that the AM335x generates an output on the USB0_VBUS pin probably to perform OTG probing. We have seen this using an oscilloscope. The AM335x manuals clearly state that the USB0_VBUS pin is an analogue input only.

Is the USB0_VBUS supposed to output a current when OTG polling as we have seen ?

=====================================================================================

Notes on problem

1.  We have an oscilloscope on the USB0 VBUS line.
2.  We have set the USB0 controller's mode to "peripheral" using the DTB's dr_mode setting.
3.  When the g_ether gadget's module is loaded into the kernel the VBUS line begins pulsing high (about 2V) once every 2 seconds. It appears that the g_ether module causes the USB0 controller to ignore its "peripheral"  status and go into "otg" mode. I think in OTG mode the USB0 pulses the VBUS line to check on the capacitance of the line and thus see if a slave devise is attached. If one is the USB controller will go into host mode. It can't really do this on our board as there is no ability to power the VBUS line.
4.  As the USB0 VBUS line is connected to the TPS65217's USB power input it sees this pulsing. I guess once in a while it decides to move to USB power and this fails so the system reboots.

If this is the case a few things at fault here I think.

1. The TPS65217 should prioritise AC power over USB power and thus not try to switch to USB power when AC power is present and not switch on mere pulses (chip bug ?)
2. The Linux USB stack (musb driver ?) should not allow the USB controller to go into OTG mode when set to "host" or "peripheral". This may be in the musb driver or g_ether module ? (Linux kernel bug ?)
3. The AM335x (we are using an AM3358BZCZ) CPU appears to drive the USB0 VBUS line (we have changed the in-series resistor to 1k and can see the pin driving), possibly with a current source, in order to check for VBUS capacitance. The AM335x manual states this line is an analogue input only not an output. So there is a documentation  discrepancy there. (documentation bug ?)

  • Hi Terry,

    What version of Linux are you using? How are your USB interfaces connected? USBx_VBUS is a sense input on AM335X.

  • The Linux kernel we are using is 3.12.10.

    The USB interfaces are connected in a similar way to a Beaglebone black.

    A mini USB-B connector is connected to the processors USB0 pins.

    The USB connectors VBUS line is connected to the CPU's USB_VBUS line through a 0 ohm resistor. It is also connected to the PMIC's (TPS65217C) USB power input. It also has 10uF and 100n decoupling caps.

    We have increased the 0 ohm resistor on the CPU's USB0_VBUS pin to 1k. When doing this we could see, with an oscilloscope, that the USB0_VBUS pin on the CPU is driving the VBUS line with a short current limited pulse about once every 2 seconds although the documentation says it is only an input analogue voltage sense pin ...

  • This behavior has been previously discussed on the forums. Here is a good start:

    http://e2e.ti.com/support/arm/sitara_arm/f/791/p/250507/887113.aspx#887113

  • Many thanks for that.

    So then yes the AM335x is driving the USB*_VBUS line contrary to the datasheets statements.

    I think the datasheets should be updated and/or something added to the errata to describe this ...