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