S32K344 CAN Receive Configuration

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

S32K344 CAN Receive Configuration

跳至解决方案
702 次查看
RegulusCheng
Contributor III

Hi, NXP friends

I am working with S32K3X4EVB-Q172(Part of MCSPTE1AK344), using simulink in matlab 2021b.

I have some questions about configuring CAN receive function:

Today, I solve the problem that TJA1153 can not sent CAN message, and then found that my model can not receive messages I send from a CAN device. I tried the receive demo program and get nothing.

Finally, I successfully receive messages after trying, my sollution is add an "Can_MainFunction_Read" function model. However, I found that all demos relating to CAN receive function don't have this model, so I wondering if this is the right sollution? Why demos don't have it? Can anybody give me some suggestions?

RegulusCheng_0-1705493841750.png

 

0 项奖励
回复
1 解答
686 次查看
robertv
NXP Employee
NXP Employee

Hello @RegulusCheng ,

If you managed to successfully receive a CAN message only by using the Can_MainFunction_Read block, then that indicates that the Can Hardware Object associated to the CAN instance is functioning based on polling.

According to the help section of the Can block, "Can_MainFunction_Read - Service for performing the polling of RX indications when Can_RX_PROCESSING is set to POLLING". 

In this case, I can only suggest double checking if the CAN instance you are trying to receive messages on has an RX Can Hardware Object that is based on interrupts and whether it is configured properly. 

Regards,
Robert V

在原帖中查看解决方案

0 项奖励
回复
2 回复数
687 次查看
robertv
NXP Employee
NXP Employee

Hello @RegulusCheng ,

If you managed to successfully receive a CAN message only by using the Can_MainFunction_Read block, then that indicates that the Can Hardware Object associated to the CAN instance is functioning based on polling.

According to the help section of the Can block, "Can_MainFunction_Read - Service for performing the polling of RX indications when Can_RX_PROCESSING is set to POLLING". 

In this case, I can only suggest double checking if the CAN instance you are trying to receive messages on has an RX Can Hardware Object that is based on interrupts and whether it is configured properly. 

Regards,
Robert V

0 项奖励
回复
668 次查看
RegulusCheng
Contributor III

Hi, Robert

I learned the MCAL configuration today and finally found the reason why I can't receive message in interrupt mode is exactly like you said —— the hardwareObjet configure is wrong. The RX Can Hardware Object that is based on interrupts was configured to receive Extended ID, however, I am keeping sending Stranderd ID.
Thanks for your suggestion!

 

Regards,

Regulus

0 项奖励
回复