in which case should I use function ConfigTxMb?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

in which case should I use function ConfigTxMb?

490 次查看
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" ? 

标记 (4)
0 项奖励
5 回复数

473 次查看
VaneB
NXP TechSupport
NXP TechSupport

Hi @buccno 

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

0 项奖励

465 次查看
buccno
Contributor III
Ah sorry s32k116
0 项奖励

452 次查看
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 项奖励

445 次查看
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 项奖励

438 次查看
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 项奖励