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.

CAN bus - Remote frame - Auto answer

Hi!

I have 2 piccolos on a CAN bus. One is sending a remote frame and the other one is set as transmit mailbox with AAM=1.

I don't know why I only get the data frame only once. Unfortunately it's hard to monitor what is happening on both piccolos. Is there a way to connect to 2 targets in the same debug session?

Here is what I'm trying to do:

On the TX side:

    for(;;)
    {
             ECanaShadow.CANRFP.all = ECanaRegs.CANRFP.all;
            do
            {
             GpioDataRegs.GPBSET.bit.GPIO34 = 1;
              ECanaShadow.CANRFP.all = ECanaRegs.CANRFP.all;
            } while(ECanaShadow.CANRFP.bit.RFP0 != 1 );

      ECanaRegs.CANRFP.all = 0x00000001;
 //     ECanaRegs.CANTRR.all = 0x00000001;
      GpioDataRegs.GPBCLEAR.bit.GPIO34 = 1;
      DELAY_US(500000);

  }

On the RX side:

for(;;)
    {

        ECanaRegs.CANTRS.all = 0x00000001;  // Set TRS for transmit mailbox 0 sending RTR
        while(ECanaRegs.CANRMP.all != 0x00000001 )
        {
            GpioDataRegs.GPBCLEAR.bit.GPIO34 = 1;
       // DELAY_US(1000000);
        }
        ECanaRegs.CANRMP.all = 0x00000001;
        
        GpioDataRegs.GPBSET.bit.GPIO34 = 1;
        DELAY_US(1000000);

}

First time the RX side sends the remote frame, I see the LEDs on both boards going on-off. After that both targets remain in the while() waiting for the RFP and the RMP bits to set. I've tried to force the RMP bits in the debugger to 1, but still the execution remains in the while(). I'm not sure I can actually set the bit, because I have to disable polite real-time mode.

I can only get one data frame from one node? or I have to update the data in the TX mailbox?

Thanks,

Monica

  • I've just noticed in the debugger that the RTR bit is cleared after the first sending of the remote frame request. Is that the reason I don't get the next data frame from TX? actually the 2nd remote frame request is not sent. I've tried setting the RTR bit before setting the TRS, but still no second data frame received....

  • Hi Monica 

     

     Is there a way to connect to 2 targets in the same debug session? 

     

    You  can easy connect 2 or 3 targets to one JTAG and then debag it simultaneously. To do so you need to connect your targets in daisy chain style (TDO of the first target to TDI of the second and so on). After this open CCS setup utility, create new connection and add as many processors as you need. 

    I think there are some notes according parallel debugging in CCS help.

    If you need to connect 4 or more targets to one JTAG you need to use some booster for the JTAG lines.   

     

    Roman 

  • I have got same case with you about only receive first data. Have you solve this problem so far ?