S32K312 CAN Tx Status

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

S32K312 CAN Tx Status

885 Views
lua40927
Contributor III

Hello,
I am using the official example program for development

example program source: https://community.nxp.com/t5/S32K-Knowledge-Base/Example-S32K312-CAN-Transmit-amp-Receive-Using-MB-I...

 

My question is: After sending a message using "FlexCAN_Ip_Send" (for speed reasons, I didn't use FlexCAN_Ip_SendBlocking), I used "FlexCAN_Ip_GetTransferStatus" before the next message transmission to check whether the transmission was successful.

However, when the interval between FlexCAN_Ip_Send and FlexCAN_Ip_GetTransferStatus is extremely short, the value returned by FlexCAN_Ip_GetTransferStatus will be "busy", but the message was actually successfully sent.

I understand that adding a delay could solve this problem, but for performance reasons, I don't want to add a delay.

I'd like to ask if there are other faster methods to check whether a message has been successfully transmitted, or if you can provide an approximate minimum interval to avoid falsely identifying it as busy.

Thanks

0 Kudos
Reply
1 Reply

850 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @lua40927,

If you are using interrupts, you can set a flag in the transmit complete event:

Snag_2fa272a0.pngSnag_2fa272a0.png

This method is faster and avoids busy waiting, like polling for the transfer status to change.

Best regards,
Julián

0 Kudos
Reply