cancel
Showing results for 
Search instead for 
Did you mean: 

OTG_FS_IRQHandler host fault when slave device removed during operation

dcurran2
Associate II
Posted on January 09, 2012 at 17:14

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 

Dan 
1 REPLY 1
Posted on January 09, 2012 at 20:02

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.
Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..