cancel
Showing results for 
Search instead for 
Did you mean: 

Problem after execute SPI Send Data Interrupt function, code stuck at infinite loop line in startup code

WM_IR
Senior

I detect my source problem why the code is not working , when debugging using step into, during the execution of SPI_SendDataIT(), after it execute the return state line, The code is stuck at startup file at line b infinite loop. What is the cause of this problem?

0693W00000BbE58QAF.pngThe code stuck here:

0693W00000BbE5IQAV.pngWhat is the cause of this problem?

2 REPLIES 2

Which STM32?

Isn't that also the hardfault handler?

Do you have a proper interrupt service routine (ISR) defined for given SPI interrupt, with name matching that in the vector table?

JW

Here is how I initialize my gpio interrupt, im using PB6, when it detects LOW, the interrupt is at line EXTI9_5.

0693W00000BckVFQAZ.pngThen, this my IRQHandler:

0693W00000BckVKQAZ.png 

So, my program, the SPI interrupt will trigger when data received in the RXFIFO, which means the event flag is RXNE.

But the problem is, when I sent dummy data to fetch the real data using SPI_SendDataIT function, the program goes to the default handler which is infinite loop. I suspect my code inside the SPI_SendDataIT is missing something but I did not know what it is. Here is my SPI_SendData function code:

0693W00000BckVPQAZ.png 

This is how my SPI_SendDataIT is called:

0693W00000BckVZQAZ.png