cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with USB disconnect event detection in STM32F407

vasanth
Associate
Posted on August 14, 2014 at 13:26

Hi, I am using the Keil MCBSTM32f400 evaluation board and currently experimenting with the USB HID example code provided by ST. This code is configured so that the device is self powered rather than bus powered.

I am seeing the following observations.

1) The voltage on PA9(VBUS pin) is ~2.2V on the evaluation board even when no USB cable from the host is connected.

2) When the USB cable from the host is connected, the voltage jumps to ~5V.

3) When the cable is disconnected, the voltage falls back to ~2.2V.

As a consequence of this, since the voltage does not fall below 0.8V (per datasheet), the USB session end interrupt is not triggered. Additionally, the USB session request interrupt is fired even when no USB connection is detected (as the default voltage is ~2.2V).

the VBUS pin is configured as follows

  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9;

  GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;

  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;

  GPIO_InitStructure.GPIO_OType = GPIO_OType_OD;

  GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL ;

  GPIO_Init(GPIOA, &GPIO_InitStructure);

Also, NOVBUSSENS bit is reset and VBUSBSEN bit is set in OTG_FS_GCCFG register.

I am not seeing any issues with the code. Is there anything i am missing ? Any idea why 2.2V is seen even if there is no USB cable connected ?

#usb-vbus #usb-vbus
3 REPLIES 3
tsuneo
Senior
Posted on August 15, 2014 at 02:21

> Any idea why 2.2V is seen even if there is no USB cable connected ?

 

It is caused by the TVS diode array (IC5 and IC8: USBLC6-4).

When USB cable is disconnected, VBUS_FS (VBUS_HS) is still pulled up by D+ line, passing through high-side protection diode in this chip, on self-powered configuration.

For temporary workaround,

a) lift up or cut off pin 6 (VBUS) of this chip

or

b) remove this part entirely from the board

USBLC6-4 datasheet

http://www.st.com/web/en/resource/technical/document/datasheet/CD00047494.pdf

USBLC6-4 and USBLC6-2 are wrong options for USB Device protection.

These parts are good for Host downstream port protection, but never use them for Device upstream port protection.

I have warned to Keil on this issue,

http://www.keil.com/forum/24795/usb1-vbus-sensing-with-mcb4357/

For USB Device protection, TVS array chip just with low-side diodes is applied.

For example,

ST ESDAULC6-3BP6

http://www.st.com/st-web-ui/static/active/en/resource/technical/document/datasheet/CD00165276.pdf

ON Semi NUP4060AXV6 (for full-/low-speed)

http://www.onsemi.com/pub_link/Collateral/NUP4060AXV6-D.PDF

Tsuneo

vasanth
Associate
Posted on September 05, 2014 at 11:31

Hi chinzei.tsuneo,

Your suggestion was most helpful. We removed the IC suggested by you and now the voltage falls to ~0V. Thanks a lot.

Vasanth

raghavendra
Associate
Posted on May 07, 2015 at 11:06

Hi chinzei.tsuneo,

Thank you very much for the suggestion.

By doing that change, VBus voltage is getting reduced. But i am not getting the UsbDisconnect Interrupt all the times. Some times it is coming and majority of the times it hangs.

Can you please help?

Regards,

Raghavendra G