Flexcan overrun detection

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Flexcan overrun detection

1,077 Views
bharathn3402
Contributor III

Hi @PetrS ,

How can we determine if a message buffer (MB) is in an overrun state or any other state? Is there an interrupt to check the status in FlexCAN?

In my case, I’m using FlexCAN with a callback function to copy the received data triggered by the `FLEXCAN_EVENT_RX_COMPLETE` event. However, occasionally, my application fails to catch that interrupt and process the data in time. As a result, when a new message arrives in the same MB, the MB cannot receive the data.

How can I detect when the MB goes into an overrun state to service it appropriately? How should I address this issue?
can you provide me an sample code of dettecting the overun and handle it to normal state

0 Kudos
Reply
3 Replies

1,059 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

overrun is only indicated by MB CODE field. So once MB interrupt is serviced the user RXbuffer is updated with MB content, RXbuffer.CS contains value of MB's CS word where CODE field can be read. 
You should ensure MB is read in time. Try to set higher priority for FlexCAN module MB interrupts.

BR, Petr

0 Kudos
Reply

350 Views
bharathn3402
Contributor III

HI @PetrS ,

How can I detect an overrun using Cs code, and how do I recover from the overrun state? Is there any sample code available to handle recovery after detecting an overrun? I'm using a callback function to receive can data.

0 Kudos
Reply

856 Views
stevenlutz
Contributor III
How do you set the interrupt as a higher priority with the SDK?
0 Kudos
Reply