AnsweredAssumed Answered

SPC56EL60 FlexCAN RX mailboxes

Question asked by Patrik Schantl on Jan 28, 2016
Latest reply on Feb 2, 2016 by Erwan Y
Hello,

I have a system with an SPC56EL60 with CAN communication at 500kBaud/s. 20 messages are send with cycle time of 200ms. I am using SPC5 Studio and the integrated CAN drivers and configured it to have 16 RX and 16 TX mailboxes.
In the past, this setting works fine but since I changed the cycle time for all messages from 200ms to 20ms it seems that I am "loosing" messages over the CAN bus.
Investigation of the SFRs with the debugger shows me two things:
1) If I use Real Time Access to SFRs of FLEXCAN fewer messages get lost and the communication works better (maybe because the mailboxes are unlocked when the debugger reads SFRs?)
2) Only the first message buffer is used for RX, all other message buffers are correctly initialized but never written by the microcontroller

I think because only the first mailbox is used incoming messages are stored there but where overwritten by other incoming messages.
How do I have to configure the driver to use more than one mailbox for receiving messages and how can I easily check if all mailboxes where used by the microcontroller?
Would it be better in my case to use FIFO functionality of FlexCAN? Is there any sample project avaliable which shows using of FlexCAN FIFO?

Thanks and best regards,
Patrik

Outcomes