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?
Solved! Go to Solution.
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
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
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