Hello,
I am working S32K144 FLEXCAN driver. I configured message buffer as receiver. Every 100ms I am receiving CAN frames. When I received first CAN frame CODE field in RAM register is written with 0x02 (FULL). After first frame, the CODE filled is written with 0x06 (OVERRUN). I am reading timestamp in RAM register and TIMER register to lock the buffer.
How to solve this overrun issue. Please help me. Waiting for your response.
Thanks & Regards,
Yashwanth
Hi Yashwanth,
You must read the MB C/S word to lock the MB. Otherwise new frame can be moved into this MB and CODE will be updated to OVERRUN.
The MB is unlocked when the CPU reads the Free Running Timer Register or the C/S word of another MB.
BR, Petr
Hi Stancik,
Thanks for replay. I am reading C/S word also. Below one is my logic.
u32_RxCode = ((p_stgFlexCANRegsAccess[u8_lFlexCANCh]->RAM[u8_fMbNo * FCAN_MB_SIZE + 0] & \
FLEXCAN_MB_CODE_MASK) >> 24);
FLEXCAN_MB_CODE_MASK = 0x0F000000
After reading also I am getting overrun.
Any changes I need to do. Please help me.
Thanks & Regards,
Yashwanth
Hi Yashwanth,
OVERRUN means the new coming message moved into MB before CPU serviced it (MB C/S word was read and unlocked by reading TIMER or other MB C/S word).
So do you really read the MB each time the message was moved into that MB?
BR, Petr