S32K144 CAN RX AND TX SIMULTANEOUSLY

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

S32K144 CAN RX AND TX SIMULTANEOUSLY

2,792 次查看
sushma
Contributor III

Hello

I'm able to receive and transmit from one controller to other by settings of MB, baud rate etc.

But I want to configure my CAN to receive from an unknown source. I'm facing issue there I have configured my CAN0 pins (E4 and E5) and connected these pins to external CAN transceiver. The CANH and CANL pins from transceiver is given to a CAN analyzer. I test with the CAN Analyzer to send and receive data to my controller. I'm successfully able to transfer data; but I'm not able to receive any. I have attached the snippets of the settings and code.

image.png
image.png
image.png
image.png
image.png
image.png
image.png

Kindly, let me know what would be possibly going wrong Regards

标签 (1)
0 项奖励
回复
6 回复数

2,373 次查看
sushma
Contributor III

Hello PetrS

i observe that the MB2 is not getting updated, And i made the changes as if(FLEXCAN_DRV_GetTransferStatus(INST_CANCOM1, MB2) == STATUS_SUCCESS to print data

Kindly let me know, where I may be going wrong

Thank you

0 项奖励
回复

2,373 次查看
PetrS
NXP TechSupport
NXP TechSupport

do you see any errors detected on MCU and/or CAN tool? If not message is received by module and ACKed back, but it is not moved into MB2 due to

- MB is not free-to-receive. Could be inactive or locked

- MB is not set to accept ID send by CAN tool, check MB setting and mask register

BR, Petr

0 项奖励
回复

2,373 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

unfortunately I am not able to view pictures. Could you please share the code in different way.

Did you try to test any demo code either from S32DS or posted here? e.g. 

https://community.nxp.com/docs/DOC-343091

BR, Petr

0 项奖励
回复

2,373 次查看
sushma
Contributor III

Hello PetrS

Sorry for the delay,

Here are the images1.png2.png3.png4.png5.png7.png6.png

Hope you would be able to view the screenshots now.

Kindly let me know, where I might be going wrong.

Also suggest an example where flexCAN is used for both (reception and transmission) Rx and Tx of CAN messages

Thank you

0 项奖励
回复

2,373 次查看
sushma
Contributor III

Hello PetrS‌ , could you please look into this issue and guide

0 项奖励
回复

2,373 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

the configuration looks normal, so what does not work on RX side? MB2 is never updated with receive data?

Or do you see any errors detected on MCU and/or CAN tool?

Is the TX frame in the CAN tool defined to have standard or extended ID (0x123)? 

The "dataInfo" in the code specifies if MB will accept std or ext ID, unless it is masked. 

Also the usage of 

if(FLEXCAN_DRV_GetTransferStatus(INST_CANCOM1, MB2) == STATUS_BUSY) is little bit weird.

Should not be there "while" instead of "if" to pass after MB2 receives a frame? or at least use 

if(FLEXCAN_DRV_GetTransferStatus(INST_CANCOM1, MB2) == STATUS_SUCCESS to print data after MB2 is updated.

BR, Petr

0 项奖励
回复