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.

Linux/AM3358: USB VBUS pulses

Part Number: AM3358
Other Parts Discussed in Thread: TPS65217

Tool/software: Linux

Hello,

We have a product which uses a BeagleBone Black with kernel 4.9.78 and we are seeing a problem similar to what is described in:

https://e2e.ti.com/support/processors/f/791/p/250507/887113#887113

Because of this we are running into the random reboot issue described at:

e2e.ti.com/.../383903

How can we disable these pulse on the VBUS line? With kernel 3.8.x these pulses would be disabled if USB_OTG is disabled in the kernel config, but for kernel 4.9 this does not work. I can still see the pulses even if USB_OTG is disabled, if the g_ether driver is loaded. If g_ether module is removed the pulses go away.

The related thread mentions disabling these in the kernel driver, but I'm not sure where to look. Is there a particular configuration option which needs to be set or should the source be modified?

Please advise,

--Tavi

  • Hi Tavi,

    Which Processor SDK version do you use?

    Is the BBB USB0 port connected to a USB host or unplugged when you see the VBUS pulse?

    Please run the following command on your board and provide its output.

    # cat /sys/firmware/devicetree/base/ocp/usb@47400000/usb@47401000/dr_mode

  • Hi Bin,

    I see the pulses only when the cable is unplugged. And it only happens if the cable is first connected and then disconnected. If the board boots without the cable, the pulses don't show up.

    The VBUS pulses also go away if I remove the g_ether module (modprobe -r g_ether)

    The output of the cat command you listed above is "peripheral"

    This product does not use the TI SDK and the kernel/filesystem are based on the BBB debian community image.

    I know TI does not support this configuration, but I was hoping you can point me to the right kernel config or source file where I can disable the VBUS pulses for kernel 4.9.x.

    --Tavi

  • Tavi,

    Please test TI Processor SDK kernel to see if the problem also happens.

    I tested SDK v4.1.0.6 which is based on kernel v4.9.41 but I don't see any VBUS pulse after unplugged the usb cable.

  • I flashed the rootfs which comes with SDK v4.1.0.6 on an sdcard and I still see the same problem.

    These are the steps I followed to reproduce it:

    - Boot from the sdcard flashed with tisdk-rootfs-image-am335x-evm.tar.xz. The board is powered from the 5V DC connector (P1). I'm monitoring the boot process from the serial console

    - Insert USB cable in the mini-USB connector (P4). The other end of the USB cable is connected to my linux workstation.

    - Remove USB cable

    - Now I can see the VBUS pulses on the scope and they are also detected by the PMIC. Register 0xa of TPS65217 changes between 0x8c and 0x88 when I run the command "watch -n0 i2cdump -f -y 0 0x24"

    Notes:

    Module g_ether is not loaded so I cannot verify that the behavior is affected by this.

  • Tavi,

    I was doing the same test sequence, but don't see vbus pulse on the scope.

    You are testing on the Beaglebone Black, not your custom board, right?

    Can you please provide a screenshot of the scope to show how the pulses look like?

    By the way, the SDK rootfs by default loads g_multi driver. You can check what usb gadget driver is loaded using the following command.

    # cat /sys/class/udc/*/uevent

  • Hi Bin,

    Yes, I'm testing on the Beaglebone Black. I attached the screenshot of the pulses. They are approx 2.5V and repeat every 2 seconds.

    I also pasted below the output of the cat command, ran on the sdk image

    root@am335x-evm:~# cat /sys/class/udc/*/uevent
    DRIVER=g_multi
    USB_UDC_NAME=musb-hdrc
    USB_UDC_DRIVER=g_multi

    Our debian based system uses g_ether which I can remove with "modprobe -r g_ether" and that stops the VBUS pulses.

    I tried to remove g_multi in the same way on the sdk image, but the command hangs. The systems still works, just the modprobe command never returns.

    --Tavi

  • Tavi,

    Thanks for the scope screenshot. Now I know what the pulses are. But we need to debug together to find the driver bug which causes the pulses since I am unable to see the problem on my setup.

    When you unplug the usb cable to trigger the pulses, please run the following command on your board and provide its output.

    # cat /sys/devices/platform/ocp/47400000.usb/47401400.usb/musb-hdrc.0/mode

  • Tavi,

    Please ignore my previous debug request, and ensure you use any kernel version which is release in 2019, and double check the kernel already has the following patch applied.

    marc.info/

  • Thank you.

    Applying the patch listed above got rid of the VBUS pulses after unplugging the USB cable.

  • Tavi,

    Thanks for the update. I am glad the issue is solved.