cancel
Showing results for 
Search instead for 
Did you mean: 

SPC584xx CAN Message stops receiving via Dedicated Buffer - intermittent issue

SKara.7
Associate II

Hi,

I have configured 5 CAN Rx messages using Dedicated Rx buffers. In between running, I am losing CAN Rx message reception. DRX flag in the IR register is not being set once the problem occurs, thereby missing the Rx messages.

I need a power cycle or software reset to come out of the situation.

Please can somebody help me to solve this issue? Your help is much appreciated as this is an urgent issue to be fixed in our project.

Best regards,

Sreejith

5 REPLIES 5
DCARR
Associate III

Hi Sreejith,

please describe better the issue adding more details about your configuration and what your code do.

Please check the ECR, PSR registers after the problem occurs.

Sorry, but I need to replicate your issue to understand if there is a problem.

Best regards

Domenico

SKara.7
Associate II

Hi Domenico,

Thank you for reaching out.

Please find attached the configuration file that I use. I am facing the issue with mcanconf_CAN3 only, for some reason.

The issue is happening randomly, but frequently. The issue is that all of a sudden Rx frames stop receiving and can_lld_receive() function used to read the Rx buffer returns CAN_MSG_WAIT instead of CAN_MSG_OK.

While the issue is active, the highlighted condition inside can_lld_receive() function is skipped and the control jumps to the next if() condition as shown by the red arrow.

0693W00000LxopaQAB.pngThe Rx frames are read using can_lld_receive() when the Rx callback is called.

0693W00000LxoqOQAR.pngmcanconf_CAN3 is configured at 1Mbps baudrate.

Please let me know if you need any further information.

Best regards,

Sreejith

SKara.7
Associate II

Just to be clear, the switch-case statement shown is called under mcanconf_CAN3_rxreceive() callback function for mcanconf_CAN3 configuration. The functions under each case invoke can_lld_receive() for each message based on the ID defined by the macro.

DCARR
Associate III

Hi Sreejith,

if I well understand you are calling the "can_lld_receive" function inside the callback function, and this call probably is the root cause of your issue. This because we are reading for two consecutive times the same message buffer.

In that case, please remove this call, because you, inside the callback, can read the message buffer content in the first argument of callback function.

Best regards

Domenico

SKara.7
Associate II

Hi Domenico,

Thank you for the guidance.

I will try it out and see if it solves the problem.

Best regards,

Sreejith