S32k CAN Tx issue

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

S32k CAN Tx issue

489 次查看
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,

 

 

 

 

 

 

标记 (1)
0 项奖励
回复
9 回复数

468 次查看
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 项奖励
回复

464 次查看
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 项奖励
回复

446 次查看
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 项奖励
回复

440 次查看
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 项奖励
回复

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

标记 (1)
0 项奖励
回复

420 次查看
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 项奖励
回复

362 次查看
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 项奖励
回复

339 次查看
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 项奖励
回复

325 次查看
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 项奖励
回复