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: The ID and data are misaligned

Part Number: TMS570LS3137
Other Parts Discussed in Thread: HALCOGEN

Hi team,

Here's an issue from the customer may need your help:

Data is sent using the CAN of the TMS570LS3137, the ID is using the 29-bit extended ID, and the last 8 bits of the ID are handled with a cumulative frame number, i.e. the first frame is 00 and the second frame is 01, and so on, the last frame is FF.

When sending data, it will have the following problem:

          ID                                                         DATA

  xx xx xx 00                                      xx xx xx xx xx xx xx xx

  xx xx xx 02                                      xx xx xx xx xx xx xx xx

  xx xx xx 03                                      xx xx xx xx xx xx xx xx

          .                                                             .                                            

          .                                                             .

          .                                                             .

  xx xx xx FF                                     xx xx xx xx xx xx xx xx            

The second frame ID should have a minimum of 8 bits of 01, but it becomes 02, and the data is still the data of the second frame and the subsequent IDs are OK. Call canUpdateID to change the ID before sending, then canTransmit to send the data.

The customer would like to know how to resolve this problem. Could you help check it? Thanks.

Best Regards,

Cherry

  • Hi Cherry,

    The assumption of HALCoGen generated canTransmit() API is the messages transmitted by the mailbox (for example mailbox1) has a predefined message ID. The predefined message ID is defined in canInit() or by calling canUpdateID(). 

    uint32 canTransmit(canBASE_t *node, uint32 messageBox, const uint8 * data)  --> doesn't include the message ID 

    If you don't use the predefined the message ID, you have to call canUpdateID() before calling canTransmit().

    Do your customer use the APIs generated by HALCOGen?

  • Did customer call canUpdateID() to update the message ID to 0x1 before sending the message with ID=1?

    How did your customer check if the message was transmitted or not in the table below? 

        ID                                                         DATA

      xx xx xx 00                                      xx xx xx xx xx xx xx xx

      xx xx xx 02                                      xx xx xx xx xx xx xx xx

      xx xx xx 03                                      xx xx xx xx xx xx xx xx

              .                                                             .                                            

              .                                                             .

              .                                                             .

      xx xx xx FF                                     xx xx xx xx xx xx xx xx          

  • Hi,

    Thanks for your help.

    Do your customer use the APIs generated by HALCOGen?

    Yes.

    Did customer call canUpdateID() to update the message ID to 0x1 before sending the message with ID=1?

    Yes, before canTransmit, they have called canUpdateID to update ID.

    Thanks and regards,

    Cherry

  • Hi,

    May I know is there any updates regarding the info above?

    Thanks and regards,

    Cherry

  • If the message ID in mailbox1 is updated before calling canTranmi() function, the message with new message ID in mailbox1 should be transmitted.

    You can use 

    msgID = canGetID(canREG1, canMESSAGE_BOX1);

    to readback the ID to make sure the ID has been updated.

    or you can configure the message RAM as RDA:

    1. DCAN CTL |= 1<<7;  //enable TEST mode

    2. DCAN_TEST |= 1<<9;  //configure CAN msg RAM as RDA