s32k312 flexcan interrupt

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

s32k312 flexcan interrupt

跳至解决方案
743 次查看
fengba_360
Contributor III

Hello, I am implementing FlexCAN transmission and reception on an S32K312 using interrupts, but the data transmitted by the S32K312 does not match what I receive using a CAN card. Could you please advise me on possible reasons for this? Attached is an illustration of my configuration setup.微信图片_20240903112421.png微信图片_20240903112337.png微信图片_20240903112144.png微信图片_20240903112513.png

0 项奖励
回复
1 解答
703 次查看
Senlent
NXP TechSupport
NXP TechSupport

Hi@fengba_360

1.first, the demo you send to me can build sucess cause missing some file. please double check it.

2.second, In your code, the “dummyData” array has not been modified, so the data in your screenshot is inconsistent with your code.

在原帖中查看解决方案

0 项奖励
回复
7 回复数
724 次查看
Senlent
NXP TechSupport
NXP TechSupport

Hi@fengba_360

Could you please provided your project so that we can help you find the root cause.

0 项奖励
回复
721 次查看
fengba_360
Contributor III

hello,The attachment is the project information. Please check it. I feel like I sent the address information. thanks。

0 项奖励
回复
704 次查看
Senlent
NXP TechSupport
NXP TechSupport

Hi@fengba_360

1.first, the demo you send to me can build sucess cause missing some file. please double check it.

2.second, In your code, the “dummyData” array has not been modified, so the data in your screenshot is inconsistent with your code.

0 项奖励
回复
696 次查看
fengba_360
Contributor III

The CAN transmission is called in the following part of the code.

dummyData[8]={1,2,3,4,5,6,7,8}

 

微信图片_20240903152907.png

0 项奖励
回复
680 次查看
Senlent
NXP TechSupport
NXP TechSupport

Hi@fengba_360

There is a problem with the usage of C pointer.

Please try to change the highlighted part below.

Senlent_0-1725354043327.png

 

0 项奖励
回复
652 次查看
fengba_360
Contributor III

Thank you. I made a big mistake. I'm sorry.

0 项奖励
回复
700 次查看
fengba_360
Contributor III

Hello, no matter what data I fill in the dummy array, the data I receive through the CAN card is always the same (the CAN ID is correct, but the CAN data seems to be address information). The attachment is the latest successfully compiled code. It is consistent with the phenomenon I described.

0 项奖励
回复