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.

TI AM335x - USB Over Current Observation

Other Parts Discussed in Thread: UNIFLASH

Hi,

We are developing an HealthCare IOT product using AM335x processor & SDK8 software.

We are using USB in OTG mode for following purposes

1. for connecting the SmartPhone using USB tethering

2. for connecting Pen drive (Mass storage device)

3. eMMC flashing using USB RNDIS mode & Uniflash tool

In first two cases, USB port on AM335x acts as USB host. In the USB host mode, we have a USB switch to limit the VBUS power to 150mA.

In USB tethering mode, setup always fails with VBUS ERROR with Over Current condition.

After analyzing the issue and USB packet captures on CATC analyzer, we wanted to understand a particular behaviour in the Linux mUSB Stack.

Behavior:

- In the CATC analyzer, we found that the Mobile phone is requesting for 500mA power through Configuration Descriptor request.

- We have configured the maxPower to 150mA in Linux mUSB stack

- After receiving the configuration descriptor, Linux mUSB stack should reject the configuration as it cannot give 500mA as per USB 2.0 Specification. But it is observed that Linux mUSB stack is accepting the configuration by sending SET_CONFIGURATION request.

- Because of this, Mobile phone starts sourcing more current and end-up in VBUS Error.

Questions:

1. Is this condition be avoided by some changes in the stack?

2. Or is it that we need to provide the 500mA power (minimum) in hardware to over come this condition?

Other observations:

1. Mobile phone (MotoG and few other mobile phone) has only one configuration with 500mA power requirement. In this case, what happens the Linux mUSB stack rejects the configuration?

2. VBUS error is observed on USB Pen Drive from SanDisk, Transcend, etc. Here, it requires 200mA power.

Please let us know if you have any thoughts or suggestions.

Regards,

Kamal

  • Hi Kamal,

    I will ask the USB experts to look at this.

  • Kamalesh Basavaraju said:
    - After receiving the configuration descriptor, Linux mUSB stack should reject the configuration as it cannot give 500mA as per USB 2.0 Specification. But it is observed that Linux mUSB stack is accepting the configuration by sending SET_CONFIGURATION request.

    I see the MUSB stack works as expected on AM335x GPEVM with SDK8.0.

    The patch limits the USB1 port current to 150mA is

    diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi
    index 9ee8029..cc8aa2b 100644
    --- a/arch/arm/boot/dts/am33xx.dtsi
    +++ b/arch/arm/boot/dts/am33xx.dtsi
    @@ -552,7 +552,7 @@
                                    mentor,multipoint = <1>;
                                    mentor,num-eps = <16>;
                                    mentor,ram-bits = <12>;
    -                               mentor,power = <500>;
    +                               mentor,power = <150>;
                                    phys = <&usb1_phy>;
    
                                    dmas = <&cppi41dma 15 0 &cppi41dma 16 0
    
    

    And the kernel rejects enumerating the thumb drive which can only works with 500mA.

    [  505.048671] usb 2-1: new high-speed USB device number 2 using musb-hdrc
    [  505.189455] usb 2-1: device v0781 p5530 is not supported
    [  505.195075] usb 2-1: New USB device found, idVendor=0781, idProduct=5530
    [  505.202179] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    [  505.209715] usb 2-1: Product: Cruzer
    [  505.213474] usb 2-1: Manufacturer: SanDisk
    [  505.217779] usb 2-1: SerialNumber: 2004260570144A923897
    [  505.227205] usb 2-1: rejected 1 configuration due to insufficient available bus power
    [  505.235540] usb 2-1: no configuration chosen from 1 choice
    

    Kamalesh Basavaraju said:
    2. Or is it that we need to provide the 500mA power (minimum) in hardware to over come this condition?

    If the tethering device can only work with 500mA, then MUSB has to provide 500mA to enumerate the device.

    Kamalesh Basavaraju said:
    1. Mobile phone (MotoG and few other mobile phone) has only one configuration with 500mA power requirement. In this case, what happens the Linux mUSB stack rejects the configuration?

    Rejection happens, then the phone will not be enumerated.

  • Hello Bin,

    Thank you for your response!

    DTS changes were done wrongly in our setup. We confirm the behavior.

    Regards,

    Kamal

  • Thanks Kamal for the update.