On the CAN, continuous transmission of multi-frame data, the need to increase the delay function。

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

On the CAN, continuous transmission of multi-frame data, the need to increase the delay function。

1,211 Views
jia_xuan
Contributor I

If there is no delay function, can only send first frame out。


SendCANData(TX_MAILBOX, 0x01000001, canbuf, 8);
delay(100);

SendCANData(TX_MAILBOX, 0x01000002, canbuf, 8);
delay(100);

SendCANData(TX_MAILBOX, 0x01000003, canbuf, 8);
delay(100);

SendCANData(TX_MAILBOX, 0x01000004, canbuf, 8);
delay(100);

SendCANData(TX_MAILBOX, 0x01000005, canbuf, 8);
delay(100);

SendCANData(TX_MAILBOX, 0x010000A1, canbuf, 8);
delay(100);

Please help me.

Thank you.

Best Regards.

0 Kudos
Reply
2 Replies

1,030 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

If using the same MB for transmissions, then you must be sure the MB is successfully transmitted before you are going to fill it again. So instead of delay you can use driver function FLEXCAN_DRV_GetTransferStatus, for example as

 

/* Wait until the previous FlexCAN transmit is completed */

while(FLEXCAN_DRV_GetTransferStatus(FSL_CANCOM1, TX_MAILBOX) == STATUS_BUSY);

BR, Petr

1,030 Views
jia_xuan
Contributor I

Think you

0 Kudos
Reply