cancel
Showing results for 
Search instead for 
Did you mean: 

SPC56EL60 FlexCAN RX mailboxes

Patriks
Senior
Posted on January 28, 2016 at 07:54

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
1 REPLY 1
Erwan YVIN
ST Employee
Posted on February 02, 2016 at 17:41

Hello Patrik ,

did you try to optimize your code by the compiler option  ?

do you use HAL or RLA drivers  ?

we have just some simple CAN Applications. (RLA & HAL)

Anyway, i am checking with CAN Experts

  Best Regards

               Erwan