AnsweredAssumed Answered

FlexCAN Message Buffer initialization

Question asked by Ondřej Urban on Jan 22, 2019

Hello.

 

Im using FlexCAN with CAN FD on MPC5748G.

Im still a little confused about proper initialization of MBs.

 

Lets say I want a simple demo application, that uses loopback mode to transmit and receive one ID message.

 

Then I have to configure one Rx MB by setting its ID filter and mask and also CODE to 0x04 (empty).

Second MB is used for transmission, so I simply write 0 to its CS register.

 

When I want to send a message, I use Tx MB - check its state and write ID, data, and so on... and by writing 0x0C to CODE, the MB enters the arbitration process and the message is transmitted.

 

Am I right?

 

Problem is that when I do the steps above, the Tx MB is not sent - code of the MB still remains 0x0C.

(Rx interrupt is only generated when I use the Rx MB - then, after writing 0x0C to CODE field which is then changed to 0x08. But I guess its simply because I directly modify the Rx MB).

 

Did I miss something, or is the mistake somewhere else in my code?

 

 

Thank you, Ondřej.

Outcomes