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
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
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.