in which case should I use function ConfigTxMb?

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

in which case should I use function ConfigTxMb?

1,398件の閲覧回数
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 返答(返信)

1,381件の閲覧回数
VaneB
NXP TechSupport
NXP TechSupport

Hi @buccno 

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

0 件の賞賛
返信

1,373件の閲覧回数
buccno
Contributor III
Ah sorry s32k116
0 件の賞賛
返信

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

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

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