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.

TMS320F28377D: How to change the CAN ID in sentding message

Part Number: TMS320F28377D

Dear team:

One of my customers needs to update its data domain and arbitration domain when sending CAN message. 

I found in the official driverlib library that the CAN_sendMessage function interface can be used to update the data field of a message obj, but I did not find an interface to update the CAN ID. If I want to update the CAN ID, do I need to call CAN_setupMessageObject again?

  • Hi Green,

    Yes, you are correct.  The only functions that update CAN message objects are CAN_sendMessage for the data and CAN_setupMessageObject to initialize everything (control bits, including ID and data).  If only the CAN ID needs to be updated, I think this is possible although I have not done it myself but register descriptions seem to support this.  I think the sequence below might work

    - Write the new CAN ID in CAN_IF1ARB (if interface register set 1 is used)

    - Write 0xB0 to CAN_IF1CMD[23:16] and the message object # that you are trying to modify the CAN ID in bits[7:0]

    Regards,

    Joseph