2013-02-25 09:37 PM
While trying to get an interrupt working that monitors the USB VCC voltage to detect USB cable connection/disconnection, I found a very strange problem. Whenever USB is enabled (as it should since that's what I'm monitoring), the EXTI9_5 interrupt will not fire. This is despite my attempts to ensure that EXTI9_5 interrupt has higher (lower value) priority.
If I disable USB by not allowing the USB connection to start, the interrupt triggers as expected, so the initialization code is correct in that sense. After looking at the reference code for the STM32L152D-EVAL, I noticed that in the Mass Storage section, the Joystick interrupts are disabled before the USB is enabled: /* Disable the JoyStick interrupts */ Demo_IntExtOnOffConfig(DISABLE); They joystick uses the same EXTI9_5 interrupt. This is in mass storage start. So, I am suspecting that there's something that prevents EXT (I'm using EXTI6 ) from working with USB. Is this the case? Why is the joystick disabled beforehand? Are the USB interrupts interfereing with EXTI9_5? I'd appreciate any insight into this.2013-02-25 11:52 PM
> Whenever USB is enabled (as it should since that's what I'm monitoring), the EXTI9_5 interrupt will not fire.
Does your board mount a USB ESD protection chip, like USBLC6-2 ? USBLC6-2 http://www.st.com/st-web-ui/static/active/en/resource/technical/document/datasheet/CD00050750.pdf This chip disturbs detection of VBUS drop (ie. disconnection of USB plug). This chip has an internal diode across D+/D- and VBUS. D+ -->|-- VBUS While D+ pull-up is enabled, the VBUS voltage is kept in 'high'' level, passing through this diode. In this reason, ESD protection chips with high-side diodes aren't good for USB devices, which require VBUS sense. USBLC6-2 should be applied just for the downstream ports of hosts/hubs. Replace the chip with the other one, which doesn't have high-side diode, like NUP4016P5T5G http://www.onsemi.com/pub_link/Collateral/NUP4016P5-D.PDF It is a pity that the reference designs, such as ST STM3210B-EVAL, STM32L152D-EVAL (optional), Keil MCBSTM32, mount this chip. If you've already mount this chip, cut the VBUS trace to this chip. Tsuneo2013-02-26 07:14 AM