2023-03-22 03:02 AM
In stm32h743, in SPI, I have a slave device with interrupts enabled. In particular, I'm enabling all the error interrupts (UDR, OVR, CRCERR, FRE, MODF), and the RXP, TXP and EOTIE interrupts, in that order.
If I enable EOTIE the first of all of them, everything goes fine. If I enable it after the TXP (as above), the SPI ISR gets fired endlessly. I read the SR reg. within it and its value is 0x12 (TXTF and TXP set), which makes sense because I didn't fill the TxFIFO, but I don't see why it fires all the time.
Any idea why this happens?
Solved! Go to Solution.
2023-03-23 05:46 AM
As mentioned by Pavel, you should follow the sequence.
Here is another thread about the same topic SPI EOT interrupt triggered right after SPI enable (st.com)
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2023-03-22 07:28 AM
Hello @DGast.1,
> If I enable it after the TXP (as above)
I think the screenshot you intended to share is still not attached.
Would you mind adding it for better understanding?
Thanks
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2023-03-22 10:43 AM
Sorry, I meant if I enable it as I explained above, that is, after TXP. It's difficult to add the code to explain it as it is enabled within a RTOS' driver.
2023-03-22 08:16 PM
> Any idea why this happens?
The ISR will be re-entered immediately again while the interrupt source is active and unmasked (and the whole peripheral's interrupt is enabled in NVIC). This is how NVIC works.
Duplicate:
2023-03-23 05:46 AM
As mentioned by Pavel, you should follow the sequence.
Here is another thread about the same topic SPI EOT interrupt triggered right after SPI enable (st.com)
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.