Skip to main content
markus-muc
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?
    This topic has been closed for replies.

    2 replies

    markus-muc
    Associate II
    April 6, 2016
    Posted on April 06, 2016 at 15:23

    Problem solved. Culprit was indeed the USART, and I could resolve it by adding a software managed buffer and increase the USART speed to 268800 baud.

    Walid FTITI_O
    Visitor II
    April 6, 2016
    Posted on April 06, 2016 at 18:20

    Hi t.markus,

    Thanks for your contribution and sharing what you have found.

    -Hannibal-