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.

USB OTG operation on AM335x

Other Parts Discussed in Thread: AM3354

Hi,

I have a problem with the USB OTG operation on a AM3354 CPU. I am using Windows Embedded Compact 7 as OS.

On our board the VBUS line is connected to GND via an 4.7 uF capacitor. This value has been choosen based on the USB 2.0 OTG specification, and should allow operation of my platform as USB Host (to access an USB memory stick) and USB Device (to access a virtual serial comm port).

The strange thing now is, that when I try to connect an USB stick to my device, the stick is not recognized and the corresponding mass storage device is not loaded by the OS. When I exchange the capacitor with one that has 147 uF (which is the capacity needed for USB Host only operation according to the USB 2.0 specification), USB sticks are detected correctly and the mass storage driver can be loaded without problems.

Has anybody also encountered this problem (especially with Windows Embedded Compact 7)? Do I have to set some "operation bit" in one of the undocumented registers of the AM335x platform to switch to "REAL" USB OTG operation or what is going on inside the USB controller?

Your input would be very appreciated here.

Best regards

Simon

  • Hi Simon,

    There is a dedicated WinCE forum here: http://e2e.ti.com/support/embedded/wince/f/353.aspx

    Please also note that WinCE is supported by Adeneo.

    Best regards,
    Miroslav

  • Hi Miroslav

    my problem is not strongly related to Windows CE7. Also in the StarterWare library I cannot find any code where the device is explicitly switched to some form of "USB OTG" operation.

    My main problem is that USB Hosts do not correctly work when a capacity of 4.7 uF (1 .. 6.5 uF according to the USB OTG specification) is connected to VBUS. With a capacity of 147 uF the USB Host works but the USB OTG specification is not met. So generally the USB communication stack works. It just seems to be something wrong regarding the initialization of the USB PHY.

    I need to know WHAT goes wrong and WHAT needs to be done to configure the chip to handle the capacity on the VBUS line correctly, no matter which operation system is used.

    Currently our electronic engineers say that the capacity of 4.7 uF is correct and it is a software issue. Adeneo says (yes, they have modified the BSP I am using) that it is a hardware issue and the electronic has some defect.

    So could you please help me to escape this circle and give me some more detailed information that can explain the behavior and guide me to a resolution of this problem?

    Best regards,

    Simon

  • Hi Simon,

    Do you have a power switch on your VBUS rail, that's driven by the USBx_DRVVBUS processor pin? If your USB port is working in OTG mode you should see short voltage spikes on the VBUS rail (after the switch) without any external device attached.

  • ello Biser

    I see these spikes. I think ADP and SRP are working correctly.

    Best regards

    Simon

  • This is correct. The USB port is working in OTG mode. Where is the VBUS bulk capacitor placed? It should be after the power switch, close to the USB connector.

  • Hello Biser

    the capacitor is indeed place right after the power switch. Currently we have some modifications on the board that lead to the capacitor not beeing as closed as possible to the USB connector. Additionally we placed an emi ferrite between the capacitor and the connector. Do you think that this could lead to our problems?

    Best regards

    Simon

  • Simon,

    Simon Gantenbein said:

    My main problem is that USB Hosts do not correctly work when a capacity of 4.7 uF (1 .. 6.5 uF according to the USB OTG specification) is connected to VBUS. With a capacity of 147 uF the USB Host works but the USB OTG specification is not met. So generally the USB communication stack works. It just seems to be something wrong regarding the initialization of the USB PHY.

    I need to know WHAT goes wrong and WHAT needs to be done to configure the chip to handle the capacity on the VBUS line correctly, no matter which operation system is used.

    You have to understand that OTG (which uses 4.7uF CAP) by OTG Specs only supports a list of limited USB devices which have been tested and are known to work. It is so called OTG Whitelist. For some USB devices for example which have higher in-rush current, OTG is unable to support them.

    If you really want to get most if not all USB devices enumerated, you have to follow the USB2.0 (host) Spces, not the OTG Specs. The USB2.0 Specs require > 120uF cap on VBUS to support higher in-rush current.

    So you have to pick one of the choices - true OTG (SRP, HNP...) or true HOST. You can make both to be supported in the same system.

  • Bin Liu said:
    You can make both to be supported in the same system.

    I meant you cannot.

  • Hello Bin

    I just woul have been asking how I can switch between true USB Host and true USB Device :-).

    Are you sure that there is no possibility to support USB OTG Device with higher inrush current? I am currently thinking about the possibility of connecting/disconnecting the bigger capacitor needed via a transistor that can be steered with a GPIO. What do you think, could this work?

    The problem is, that for our device we really need both functions (device and host) on the same USB connector. Everthing else would mean a quite big change in our electronic design and especially in our mechanic design (some of the mechanical production tools are already developed).

    At least I will measure the inrush current of the USB sticks that are not working. If you are right, they should exeed this 100 mA limitation.

    Best regards

    Simon

  • It's not possible to be compliant to both specifications at the same time as they have completely different use-cases. Also, I wouldn't concern myself with measuring the in-rush current of various devices...the USB2 spec is clear in that Hosts must provide a minimum of 120uF on VBUS. If you are interested in learning why, check out section 7.2.4.1 of the USB specification...it's more about preventing VBUS droop than it is about protecting devices from excessive in-rush current.

    All that said, it is possible to do what you are suggesting...but there exists the problem that you need to know which mode you wish to connect in BEFORE you actually connect. In other words, the appropriate capacitance needs to be present upon device insertion. This may not be an issue depending on your particular implementation, but it's something you need to be aware of. Take a look at the AM335x GP EVM for an example of how the capacitance is switched between Host and Device modes...it's not ideal by any means but it is functional and serves the needs of an evaluation board.

    It's also important that you are using the correct connector for your proposed implementation (GPIO-switched capacitance)...the only valid choice is the micro-AB connector.