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: TMS570LC4357

Part Number: TMS570LC4357
Other Parts Discussed in Thread: HALCOGEN

i am using TMS570lc43xx controller and used the halco gen for generating the code for CAN communication.
But when i was trying to receive some data over CAN 1 i found that the data buffer is not updating for the ID which are coming from the other nodes. i have tried for external loopback and it was ok!
As we know halco specified CAN Msg box 2 for RX in CAN1 having ID 2 when we tried to receive some data over CANID 2 then its working fine but as soon as we update the ID using UpdateId() driver's function it is not working properly.
I have also tried to check registers like IF3UpdEn, NDAT[1-4] but i got nothing there.
so how can i get data through any ID over the CAN1 Msgbox 2 ?

Please find the attached screenshots also

.

  • Hello,

    If you use 11-bit CAN ID, the ID is programmed to ID[28:18] rather than ID[10:0], so the msgBoxArbitVal should be adjusted for 11-bit mode.

  • hello wang,

    i am using both 11 and 19 bit ID with J1939 protocol but i am unable to use single msgbox for all the ID.  can you please tell me what should be the  msgBoxArbitVal ? and if i use msgbox1 for ID xx and msgbox2 for yy then the data of xx is copying into yy while periodic transmission of both the id.

  • Hi,

    For 11-bit ID, If you use HALCoGen generated code, the canInit() will program the ID to ID[28:18]. If you use your own code to update the message ID, please left shift the ID by 18:

    IF1ARB |= (msgID & 0x7FFU) << 18;

    For 29-bit ID, you can program the ID to IFxARB directly:

    IF1ARB |= (msgID & 0x1FFFFFFF);

  • thank you buddy for the reply ...actually i have applied different approach in the driver section. 

    i have added two lines in the function where we get he ID from the receiving end. 

    /* Read Message Box ID from Arbitration register. */


    msgBoxID = (node->IF2ARB & 0x1FFFFFFFU);
    CAN_Rx_LLD_t.RxMsgID = msgBoxID;

    this resolved my issue of updating ID in the msg buffer as well as now i am using single buffer for the multiple signals like msg buffer 1 for 

    Tx and rest for the Rx.