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.

TMS470MF06607: Actual ID of received CAN message

Part Number: TMS470MF06607
Other Parts Discussed in Thread: HALCOGEN

Hello,

In my project I have a need that all the messages that interrupts my HW should be collected. For the same, I simply used the message box1 and I configured the box as this

id = 0xAB (Should not matter right?)

Mask = 0x00

Now I should get all the messages in. This is for sure happening and am getting an interrupt on any message. I am also able to get the data using canGetData but then started the issue!

How do I know which message came with this data? HOw do I get the actual message identifier and DLC? The bits 28 through 18 in the IF2->ARB always shows me 0xAB irrespective of what ID knocked the door.

From code point, this is what am trying in the notification function

void canMessageNotification(canBASE_t *node, uint32 messageBox)
{
    if((node==canREG2) && (messageBox == 1))                       // CHECK THE INTERRUPT BECAUSE OF MESSAGE OBJECT 1
    {
        //All Rx messages are recieved in message box 1
        memset(&Msg_Data[0],0,8);
        canGetData(canREG2, canMESSAGE_BOX1, &Msg_Data[0]);    //This always works, I get the right data
        messageid = canREG2->IF2ARB;                             // I always see 0xAB bits 28 through 18
 
     }
}

How do I know the actual CAN Message identifier that came in to my HW (message box)? Please help

Regards,

Shankar

  • There is a standard function to call (canGetID).
    If the ID is not extended, then the ID value is returned shifted to the left 18 bits (11 bit non-extended, 29 bit extended), so you would need to perform the right shift based on the extended bit.
  • Well, I also was under an impression that there must be a canGetID function available. Unfortunately it is not available. I checked several times and also regenerated the Halcogen. No function. Do you have the implementation of that function? Please help
  • For the target I have (RM46 HDK), the canGetID function is found in can.h/c.

    If you really do not have that function for your target, then you have already the most important part of the puzzle in IF2ARB (bits 28:0). IF2ARB should also contain the extended/non-extended bit. Be sure to check your target device technical manual to confirm bits in case this is not the same
    (node->IF2ARB & 0x40000000U)
  • Ok the catch was the canREG2->IF2CMD that is generated by Halcogen. It is this line in can init

    canREG2->IF2CMD = 0x17;

    The problem is that this setting is asking the if2 to not update MSg ctrl and Arb fields from new message. (Please refer Page no. 419 is Tech Ref manual). for this we need to modify the line as below

    canREG2->IF2CMD = 0x17 | 0x70;

    And thus, issue resolved! Thanks for the support