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.

TMS570LC4357: Programmatically changing the CAN MessageID for Transmission

Part Number: TMS570LC4357
Other Parts Discussed in Thread: HALCOGEN

I need to be able to change the Message ID of a CAN transmission at runtime, and I'm having difficulty understanding how to use CanUpdateID() to accomplish this. Furthermore, I'm reading conflicting information about the need to reset MsgVal -- which I'm not even sure how to do, if it's even truly required for TRANSMISSION. 

Q: What are the precise steps, using HalCoGen's generated functions, to change a messagebox's MsgID from one value to another?

Example: I'd like mailbox 17's MsgID to change from 0x084F300D to 0x084F3015 and also 0x084F310D.

  • Hi Joe,

    If you want to change the MsgID of a mailbox which is used for transmitting message, you can use the HalCOGen function: CanUpdateID().

    If you want to change the MsgID of a mailbox which is used for receiving message, you have to clear the MsgVal before calling the HALCoGen function: CanUpdateID().

  • Looking at the issue with fresh eyes, I realize I wasn't setting bits 30, 29, and 0 appropriately. Thank you for verifying that I didn't need to reset MsgVal.