This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS570LS3137: canIsRxMessageArrived function issue

Part Number: TMS570LS3137

Hi,

I wanted to know how to work canIsRxMessageArrived function of can.h. I am using CAN interface in polling mode, so I am checking for new data in the CAN buffer. However, canIsRxMessageArrived returns '0x1' every time (I understand that this function have to return 0 if  no data has been received). Considfering this, how can I do to clear the Rx CAN buffer and use canIsRxMessageArrived without problems?

Thanks and regards,

Leandro

  • The NewDat bit is set to indicate that new data has been received. The CPU should reset the NewDat bit when it reads the message object.

    Typically the CPU will write first 0x1F to bits [23:16] and then the number of the message object to bits [7:0] of the Command Register. That combination will transfer the whole received message from the Message RAM into the Interface Register set. Additionally, the bits NewDat and IntPnd are cleared in the Message RAM.

    node->IF2CMD = 0x17U;

    /** - Copy data into IF2 */
    /*SAFETYMCUSW 93 S MR: 6.1,6.2,10.1,10.2,10.3,10.4 <APPROVED> "LDRA Tool issue" */
    node->IF2NO = (uint8) messageBox;

  • Thanks QJ,

    That worked! Regards