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.

AWR1642BOOST: Reading a message ID from a received CAN frame(DCAN)

Part Number: AWR1642BOOST


I am having issues reading the ACTUAL message ID of a received CAN message. 

I am using the DCAN module and can successfully initialize and configure the CAN subsystem to receive and transmit CAN frames. I have verified this with a third party CAN sniffer.

However, upon receiving a CAN frame, I cannot read the actual message ID of the received CAN frames. I have modified the DCAN driver to grab the message ID from the IFARB register in this source file:
C:\ti\mmwave_sdk_01_00_00_05\packages\ti\drivers\can\src\dcan.c

The modification to the driver successfully reads the message ID, but it's the same message ID I configured the message object with. No matter what mask or ID bits I change for this message box, the ID I read from received frame is simply the message ID the CAN message object is configured for. It does not provide the message ID of the received frame. I would like to access the actual message ID from the received frame, not from the message object configuration. 

Is there a way to access the CAN message ID of a received CAN frame using the DCAN module?

Thanks,
Erik

  • Hello Erik,

    We should be able to get the message ID from the received DCAN message.

    Could you please help me with below information :
    1. What is the message Id of the message sent from the external CAN node?
    2. What is the message Id configured for the message box which is receiving this frame ?
    3. What is the mask value that you have set?
    4. What is the value in the "IF2ARB " register ?

    Thanks,
    Raghu
  • Hi Raghu,

    1. The message ID sent from the external CAN node is 0x83 (arbitrarily chosen)

    2. The message ID for the message object receiving the frame is 0x99 (also arbitrarily chosen)

    3. The mask I have set is 0x00000000, chosen to accept all message IDs to help solve this issue.

    4. The value in IF2ARB is always 0x99

    Additional information:

    -My transmit message box ID is 0x70 (Chosen to echo back CAN messages I receive)

    -Reading IF1ARB always provides the value 0x70 when reading it back

    -Reading IF3ARB always provides the value 0x00 when reading it back

    -I am reading the IFARB register immediately after the dcan.c driver grabs the 8 bytes of data from DCAN_IFDATB

    Thanks,
    Erik

  • Hello Erik,

    I was able to reproduce the issue you mentioned for reading the messageID.

    The problem I see is in the configuration of the "ifCmd" in "DCANGetData()" .
    We will need to enable the "Access mask bits(DCAN_IFCMD_MASK_MASK)" and "Access arbitration bits(DCAN_IFCMD_ARB_MASK)" before writing to the IFCMD register.

    Please make the below modifications in the DCANGetData():

    Old Code:
    ifCmd = (DCAN_IFCMD_DATAA_MASK |
    DCAN_IFCMD_DATAB_MASK |
    DCAN_IFCMD_CONTROL_MASK |
    DCAN_IFCMD_TXRQST_NEWDAT_MASK );

    New Code:
    ifCmd = (DCAN_IFCMD_DATAA_MASK |
    DCAN_IFCMD_DATAB_MASK |
    DCAN_IFCMD_CONTROL_MASK |
    DCAN_IFCMD_TXRQST_NEWDAT_MASK |
    DCAN_IFCMD_ARB_MASK |
    DCAN_IFCMD_MASK_MASK);


    With this change you should be able to read the message ID in the IFARB register as well.

    Please let me know if solves your issue.

    Thanks,
    Raghu
  • Raghu,

    Thank you, this solved the issue.

    Thanks,
    Erik