I'm trying to answer the remote frame from another decive or microcrontroller, I'm using TWR-K60F120M, I understand when it receives a remote frame with specific data lenght code, it answer with remote frame or data frame not?. In case of data frame it transmits a data frame with request numbers of data. I'm using the example sci2can but I don't understand how read or how to configure Remot frame for retransmission of data.
I configure the mailbox of this form:
FlexCAN_PrepareRxCANMB(FLEXCAN_RX_MB_START, rxMsgID);
void FlexCAN_PrepareRxCANMB(uint16 iMB, uint32 id)
{
uint32 id2;
// Deactivate the rx MB for cpu write
pFlexCANReg->MB[iMB].CS = FLEXCAN_MB_CS_CODE(FLEXCAN_MB_CODE_RX_INACTIVE); // write inactive code
// Write ID
id2 = id & ~(CAN_MSG_IDE_MASK | CAN_MSG_TYPE_MASK);
if(id & CAN_MSG_IDE_MASK)
{
pFlexCANReg->MB[iMB].ID = id2;
}
else
{
pFlexCANReg->MB[iMB].ID = id2<<FLEXCAN_MB_ID_STD_BIT_NO;
}
// Activate the MB for rx
pFlexCANReg->MB[iMB].CS = FLEXCAN_MB_CS_CODE(FLEXCAN_MB_CODE_RX_RANSWER); //Here I configure for Ranswer, but only responds
//with data frame, DLC=0 and it doesn't return the
// saved data in its buffer.
// flag to caller transfer is started
bMBFlags1 &= ~(1<<iMB);
}
Please Help me!!