S2K144 FlexCAN not sending frames if receiving other frames

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

S2K144 FlexCAN not sending frames if receiving other frames

1,518 Views
emb02
Contributor IV

Hello,

I'm using S32K144 flexcan0 for sending and receiving frames. I'm using RxFifo for receiving frames (using interrupts) and MB 9 to send frames.

I'm able to receive all frames continuously but not able to send frames while receiving.

I'm not getting how reception is affecting transmission. If there is no frame to receive then I'm able to send frames continuously. But if there are multiple frames to receive I'm not able to send any frame.

I'm getting CAN status = Busy.

Debug.png

I m using same method as describe here - https://community.nxp.com/t5/S32K-Knowledge-Base/S32K1xx-FlexCAN-Mask-Setting-Demo/ta-p/1519753

I'm attaching snapshot of output and my test project for reference.

Please guide me with this.

Thank you.

Regards,

Akanksha

 

0 Kudos
Reply
7 Replies

1,454 Views
emb02
Contributor IV

Hi,

Yes, there can be only one message transmitting across the bus at any given time.

In my case I'm sending 5 messages in 100 mS interval from flexcan0 to CAN tool using FreeRTOS task and 2-3 messages from CAN tool to flexcan0 which are received in interrupt mode. So flexCAN0 is able to receive all messages without any message loss and also sends 5 messages to CAN tool.

But after some time (after sending some frames) flexcan0 is not sending any frame. Transmission is stopped completely. But reception is in progress. I'm using single MB 9 for sending multiple messages and I'm getting MB state as flexcan_mb_tx_busy. So I should use multiple MB's for sending?

I'm not getting this. Can you explain?

 

Regards,

Akanksha

 

0 Kudos
Reply

1,428 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @emb02 

Could you help me clarify if "reception is in progress" mean the CAN Tool or the S32K1 and the same with the transmission?

Could you also tell me if the status of flexcan_mb_tx_busy is maintained or at some point, it changes to success?

Have you checked with a signal analyzer if the transmission is really stopped?

0 Kudos
Reply

1,422 Views
emb02
Contributor IV

Hi,


1. Could you help me clarify if "reception is in progress" mean the CAN Tool or the S32K1 and the same with the transmission?
-> It means S32K144 is receiving frames from CAN tool but not able to transmit any frame to CAN tool.

2. Could you also tell me if the status of flexcan_mb_tx_busy is maintained or at some point, it changes to success?

-> It dose not change. After getting flexcan_mb_tx_busy state, if S32K144 is not receiving any frame (No transmission from CAN tool) it dose not transmit any frame.

3. Have you checked with a signal analyzer if the transmission is really stopped?

-> No I've not checked yet.

Thank you.

 

Regards,

Akanksha

 

 

0 Kudos
Reply

1,391 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @emb02 

Could you help me with the signal analyzer to verify if the transmission stopped to check the behavior of the signals?

0 Kudos
Reply

1,498 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @emb02 

Could you help me clarify if what you want is to send data when you finish receiving data and then send data or to be receiving and sending at the same time?

 

B.R.

VaneB

0 Kudos
Reply

1,489 Views
emb02
Contributor IV

Hi,
I want to send and receive data at the same time. FlexCAN should be receive all frames as well as transmit other frames without any data loss.


Regards,
Akanksha

0 Kudos
Reply

1,465 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @emb02 

The CAN protocol is message-based, meaning all nodes on the bus are capable of both transmitting and receiving messages, and they are always listening for a message to be broadcast. While all nodes are capable of transmitting and receiving messages, there can only be one message transmitting across the bus at any given time.

 

0 Kudos
Reply