A problem about send multiple can messages

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

A problem about send multiple can messages

597 Views
wbj5238
Contributor III

      I  want use Can1 to send multiple can messages and Can0 to receive multiple Can messages. But  I can only receive one  message. I observed that MB index is always 1, so I think it can only send one messages. Attached is the Simulink model by MATLAB2019A. 

      Please give me an example to implement this function.

  Look forward to your solution ,thank you very much!

0 Kudos
1 Reply

526 Views
constantinrazva
NXP Employee
NXP Employee

Hello wbj5238@163.com ,

Yes, you can send multiple messages on CAN (also true for receiving).

I saw that you use in your model MB1 and MB2 for sending the 2 messages over CAN1. If you take a look at the generated code, you'll find the following lines:

FLEXCAN_DRV_ConfigTxMb(1, 2, &txInfo, 0x3FA);

FLEXCAN_DRV_Send(1, 2, &txInfo, 0x3FA, data);

[...]

FLEXCAN_DRV_Send(1, 1, &txInfo, 0x3FF, data);

These lines set-up the transmission of 2 separate messages, one on MB1 (with ID 0x3FF) and one on MB2 (with ID 0x3FA).

Kind regards,

Razvan.

0 Kudos