2015-04-28 04:56 AM
Hi All,
Hi, I am using the STM32F407IG microcontroller. I am using the USB HID example provided by ST. This code is configured to make USB as USB Device and Self Powered rather than bus powered.
In our board since the USB is configured as self powered, PA9 (VBUS) pin is connected to 3.3v directly. Problem that i am facing is that whenever USB is disconnected, software is becoming unresponsive.Observations are:
1. Since VBUS (PA9) is directly connected to 3.3v, disconnect event will not be generated. 2. Connect USB to host and once the USB is detected by host, disconnect from host. After disconnecting, execution is going to the SysTick_Handler() function present in HAL_CM3.c and the execution is not coming out of this function. Function body of SysTick_Handler() is given below. __asm void SysTick_Handler (void) { PRESERVE8 &sharpifdef IFX_XMC4XXX EXPORT SysTick_Handler_Veneer SysTick_Handler_Veneer &sharpendif BL __cpp(rt_systick) B Sys_Switch ALIGN } 3. Whenever USB is connected back to Host, the software starts executing normally. My Query is that, since VBus is directly connected to 3.3v, USB disconnect event should not be generated. Buy why the software is getting hung in the ISR? Anyone having any idea about this? Thank you. #usb