S32k CAN Tx issue

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

S32k CAN Tx issue

1,459 Views
Dev15
Contributor III

@PetrS ,

I'm facing some issue in sending CAN messages. Below is my configuration in S32K312

RTD used is 3.0.0

Dev15_1-1717397323323.png

 

Dev15_2-1717397339151.png

 

 

Dev15_3-1717397371968.png

 

 

Dev15_4-1717397389176.png

 

 

Dev15_5-1717397408574.png

 

 

Dev15_6-1717397427104.png

 

I'm calling sbc_can2_task() function in a 10ms task periodically. Here, only one message is getting transmitted (0x700) and other messages are not getting transmitted.

Please guide here.

Thank you,

 

 

 

 

 

 

Tags (1)
0 Kudos
Reply
9 Replies

1,438 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

what is return value of Send function for second call? Is previous transmit finished successfully?
In code it seems you are checking status for MB14, but MB13 is used for sending. Is that correct?

BR, Petr

0 Kudos
Reply

1,434 Views
Dev15
Contributor III
Hi,
I have changed to MB13 and tested. After sending 1st message successfully also it is always in busy state only.

Thank you
0 Kudos
Reply

1,416 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

so is a code going into if-else statements or what is returned from GetTransferStatus. If it passes what is returned by Send function?

BR, Petr

0 Kudos
Reply

1,410 Views
Dev15
Contributor III

Hi @PetrS ,

I have changed the function with FlexCAN_Ip_SendBlocking() and it is working fine, but the receive part is not working. I configured DMA for Flexcan2 and calling the function FlexCAN_Ip_RxFifo() within callback. Below is the screen shot for reference. Please guide here

Dev15_0-1717582221390.png

 

0 Kudos
Reply

1,396 Views
Dev15
Contributor III

@PetrS ,

I have configured Flexcan 2 using DMA and tested. CAN Rx is not working

Evaluation board used is s32k312

RTD 3.0.0

Can you please guide here?

Tags (1)
0 Kudos
Reply

1,390 Views
Dev15
Contributor III

Hi @PetrS 

Please confirm whether FLEXCAN2 works with below

S32K312EVB-Q172 Evaluation Board

We are using external CAN SBC for this testing.

0 Kudos
Reply

1,332 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

you did not specify pins using for FlexCAN2 and outline connection to your external SBC/CAN transceiver. FlexCAN0, using PTA6/PTA7 pins, is connected to CAN transceiver on S32K312EVB-Q172 board.
So if you select right FlexCAN2's pins and connect both properly to active CAN transceiver then it would work normally. If have issues, check module MCR, ECR, ESR1 register to be sure it is working properly.

BR, Petr

0 Kudos
Reply

1,309 Views
Dev15
Contributor III

@PetrS ,

Thank you for your response.

I have configured two CAN channels and they are

1) Flexcan0 - Internal Transceiver

PTA 6 - RX

PTA 7 - TX

Here, both Rx and Tx are working fine.

 

2) Flexcan2 - External TCAN1167 SBC

PTC 6 - CAN RX

PTC 7 - CAN TX

PTC15 - SPI CLK

PTC 14 - SPI CS

PTB3 - SPI MOSI

PTB2 - SPI MISO

Here, Only Tx is working fine with FlexCAN_Ip_SendBlocking() function call. Whereas, rx is not working and it displays ack and dominant error.

 

 

 

0 Kudos
Reply

1,295 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

what does dominant error mean? Rather share ECR/ ESR1 values. Measurement on TX/RX/CAN lines would be great too.

BR, Petr

0 Kudos
Reply