AnsweredAssumed Answered

Issue with USB disconnect event detection in STM32F407

Question asked by nayak.vasanth on Aug 14, 2014
Latest reply on May 7, 2015 by G.Raghavendra
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 ?