A problem about send multiple can messages

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

A problem about send multiple can messages

1,116件の閲覧回数
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 件の賞賛
返信
1 返信

1,045件の閲覧回数
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 件の賞賛
返信