in which case should I use function ConfigTxMb?

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

in which case should I use function ConfigTxMb?

1,417 Views
buccno
Contributor III

I can send data only with the flexcan_drv_send function, in which case should I use the function ConfigTxMb? This two func gets the same parameters.

In FLEXCAN_Set_TxMsgBuff, "Then this function will copy the user's buffer into the message buffer data area and configure the message buffer as required for transmission." 

Why we need to "transmit message buffer configuration" ? 

0 Kudos
Reply
5 Replies

1,400 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @buccno 

Could you please specify which MCU and software you are using?

0 Kudos
Reply

1,392 Views
buccno
Contributor III
Ah sorry s32k116
0 Kudos
Reply

1,379 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @buccno 

The flexcan_driver.c file comes with a detailed explanation of the functions:

VaneB_0-1673992761537.pngVaneB_1-1673992793205.png

Let me know if this does not clarify your inquiry.

 

B.R.

VaneB

 

0 Kudos
Reply

1,372 Views
buccno
Contributor III
Actually, my confusion is, with configTxMb, we activated MB, cleared the corresponding IRQ flag, write the ID register in MB, write payload data bytes in MB, and updated the control and status word. But not need this configuration, I send data only using the flexcan_drv_send function.

What's the benefit of flexcan_drv_configTxMb before sending data using? Which case should I use?
0 Kudos
Reply

1,365 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @buccno 

Using FLEXCAN_DRV_ConfigTxMb (configure TX message buffer with index TX_MSG_ID and TX_MAILBOX) before FLEXCAN_DRV_Send (execute send non-blocking), you ensure that the Mb is correctly configured to be used it.

The usage of these functions together depends on your application, but one suggested case is to send data via CAN to the specified mailbox with the specified message-id.

I hope this will help you

0 Kudos
Reply