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.

AM3517 - Problem with USB-OTG VBUS power.

Other Parts Discussed in Thread: AM3517

Hi,

I am using linux-03.00.01.06 on AM3517 based customized hardware. This kernel does not support hot-plug detection of USB-OTG i.e. host or gadget mode (use-case described below). I made few changes in the USB driver and now I am able to operate it without manually inserting or removing host/gadget drivers.

My use-case is as follows:

  1. When I connect USB memory stick to OTG port of AM3517 it should be detected automatically (no need of any manual operation/command)
  2. When I connect AM3517 based board to PC it should be identified as mass storage device in PC

With this I am facing following strange problems:

  1. When nothing is connected to the USB port, I see on VBUS a very strange behavior i.e. spikes from the Sitara USB0_VBUS pin.
  2. When connecting the USB_OTG cable only with no gadget on it and then disconnect it, the 5V on the USB connector remains on. Only if a gadget was connected and disconnected, then the VBUS will drop back to 0V (with the strange behavior mentioned in point #1). If the user only plugs the USB-OTG cable and then disconnects it and connected a PC to our unit, then we have two 5V power supplies (one from PC and one from am3517 board) connected in parallel. This is not healthy scenario. Basically I want to turn off the VBUS power when I disconnect the USB-OTG cable (no matter gadget is attached with OTG cable or not).

I check patch  from latest git tree - http://arago-project.org/git/projects/?p=linux-omap3.git;a=commit;h=20c003f2f024d9f50f59edf9f1b8f5f035fb15b8 which controls the vbus power still I see same behavior as mentioned above.

USB experts, I will appreciate your inputs to understand root-cause of this behavior and its possible solution.

Regards,

Krunal

  • Krunal,

    PSP 03.00.01.06 and 04.02.00.07 (v2.6.37 based) doesn't support automatic detection of devices for AM35x and the patch you pointed out support it for OMAP35x / AM37x on PSP04.02.00.07. I don't have the changes that you have made but would recommend to refer similar patch done for AM335x platform (on v3.2 kernel based release ar below link ) which is similar to AM35x.

    http://arago-project.org/git/projects/?p=linux-am33x.git;a=commitdiff;h=5b20494150d8c045f152f06bee57da2e64dc4964

    Ajay

  • Hi Ajay,

    I have already gone through this patch but it didn't helped me for particular problem.

    I am able to use OTG hot-plug in both host and gadget mode (without inserting or removing kernel modules). The only problem is as described in my previous post.

    Regards,

    Krunak

  • Krunak,

    I have tested the 2.6.32 kernel in AM35xx PSP 3.0.1.6 release, which does not have any VBUS voltage issue on AM35xx EVM. But the issue happens after applied your 'auto-detection' patch. So I guess your patch is not complete yet. Could you please look at the following points?

    1. In your patch after the USB device disconnected but the cable is still in the port, OTG is in a_wait_bcon or a_wait_vrise state. You have to keep the timer (otg_workaround) running to set OTG back to b_idle state once the ID pin is no longer grounded;

    2. Is it possible that you debug the issue on the AM35xxEVM with vanilla PSP 3.0.1.6 (with your auto-detect patch only) so we are talking on the same.

  • Hi Bin Liu,

    Thanks for the response.

    You are correct, when I revert back our auto detection patch. It solve the VBUS voltage issue, however automatic detection (both host and gadget) is not working.

    Can you please help me to get a patch which can enable automatic detection in both host and gadget mode? Please note we don't want to load/unload the drivers (the traditional methods described on most of TI wiki pages) run-time instead we want to used them as built-in modules, this is a primary requirement. Our patch server this purpose but with VBUS issue - No clue why.

    --

    Regards,

    Krunal

  • 0028.0003-usb-musb-am35x-auto-vbus-control-across-host-and-dev.patch.zip

    Krunal,

    Sorry for  the late response. Please try the attached patch. (Please rename it to remove '.zip' from its name. Seems E2E does not allow to attach .patch files.) It enables the auto-detection and has no VBUS voltage issue on my evm.

    The patch is applicable on OMAPPSP_04.02.00.07 branch on git://arago-project.org/git/projects/linux-omap3.git, in addition to the two patches (named as below) you received before.

    0001-usb-musb-am35x-set-default-VBUS-timeout-value.patch

    0002-usb-musb-am35x-fix-role-switching-issue.patch

  • Hi Bin Liu,

    Thanks for the response.

    We have solved the problem.

    Still, I will revert all my changes and verify patches provided by you. I may be able to do that in next week and let you know the results with your patches.

    Regards,

    Krunal

  • Krunal, thanks for the update. Glad you fixed the issue. And let me know your findings with my patches.