cancel
Showing results for 
Search instead for 
Did you mean: 

INVSTATE hard fault with SPI interrupt handler. STM32F405

AWats.4
Associate II

I'm attempting to have my program run some code when a SPI transfer is complete using the RXNE flag. Setting the RXNEIE bit invokes SPI2_IRQHandler() as expected but it always results in a hard fault (CFSR register = 0x20000), without any additions to SPI2_IRQHandler().

I don't have much experience in debugging of this kind so any help/tips would be appreciated.

2 REPLIES 2

Perhaps break-point the code an step it?

Make sure all the call-back addresses in the structure are properly populated

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
AWats.4
Associate II

Reading the spi data register and clearing the RXNE flag in the first line of the interrupt handler seems to have fixed it.