I'm using stm33F7 reading sensor via SPI communication, it's working in slave only receive mode, I can read data in interrupt mode perfectly without os, but as I enable FreeRTOS (using STM32CUBE) after a random time interrupt stops firing. I'm also reading data from another sensor via UART communication with and without os, and in both modes it works fine, Is there any problem with using SPI Interrupt and FreeRTOS?
Asked
Active
Viewed 1,000 times
0
-
Tasks keep running even after SPI interrupt stops firing, I also tried a case which there is no task running in program and only toggle led in interrupt routine and still led stops toggling after a random time. – Afra Bazrafshan Mar 04 '20 at 12:31
-
Also I tried to change SPI interrupt priority in HAL_NVIC_SetPriority(SPI4_IRQn, 5, 0) to higher and lower priority but still same problem. – Afra Bazrafshan Mar 04 '20 at 12:39
2 Answers
0
Is the interrupt handler using FreeRTOS API calls? If so you need to ensure the priority is set appropriately and that the STM32 has all priority bits set as preemption priority. This is described on the FreeRTOS website. Additionally, familiarise yourself with the FreeRTOS FAQ that covers common issues and how to detect them.

Richard
- 3,081
- 11
- 9
-
No my Interrupt handler doesn't use any FreeRTOS API calls, STM32CUBE sets all priority bits. – Afra Bazrafshan Mar 07 '20 at 05:37
0
I solved my problem by changing SPI Interrupt Priority to 0. It's working perfectly now.

Afra Bazrafshan
- 11
- 3