2012-01-09 08:14 AM
Folks
has anyone come accross a fix for when the end user removes a USB slave device from a STM32F2XX while its part way through an read/write operation eg USB memstick plugged in and the user removes because they can. In testing I can now repeatadly cause a fault where the OTG_FS_IRQHandler is callled endlessly and this in effects locks up the system. At the moment I have a simple system that says if I get a certain number of consectutive ISR calls I reset the hardware but I am looking for a something a little more elegant. thanks Dan2012-01-09 11:02 AM
In testing I can now repeatadly cause a fault where the OTG_FS_IRQHandler is callled endlessly and this in effects locks up the system.
Usually such interrupt storms occur when the explicit interrupt source is not cleared/handled and it tail-chains over and over, and starves foreground tasks. For serial you'll get this kind of thing if the TXE is flagged/interrupts and you have no data to satiate it, you have to clear the TXE interrupt enable. So try to identify, by looking at the peripheral registers, what interrupt is signalling, or if the removal is a condition that can be reflected in those registers, or a GPIO.