Associate II
April 5, 2016
Question
STM32 CAN interrupt latency problem
- April 5, 2016
- 2 replies
- 1101 views
Posted on April 05, 2016 at 12:21
I am using an STM32F105 on a CAN network. I have initialized the CAN to use an external 8MHz crystal, 100k baud, and enabled the FIFO message pending interrupt. My CAN interrupt service routine reads the CAN message and the current time stamp from the running RTC and printf both to USART (putty).
Now, I can see from the putty output that the interrupt service routine is fast enough to handle a CAN message about every 1 millisecond. However, once in a while there is a latency of ~100 milliseconds until the next CAN interrupt is served. As a result, the CAN FIFO is already full (3 messages) and the overflow bit is set (see attached putty screenshot). Any idea what is causing these dead times of ~100msec in which the CAN interrupt is not served?