Other Parts Discussed in Thread: C2000WARE
Hello,
I would like to setup a CAN mailbox to receive RTR frames only but it looks like the device receives both, RTR and DATA frames.
I configured mailbox 1 for reception of RTR frames (but with no auto-response), CAN ID = 0x707, use ID filter for all identifier bits.
DLC is set to 1 for the intended response DATA frame:
CAN_setupMessageObject(
CANB_BASE,
1,
0x707,
CAN_MSG_FRAME_STD,
CAN_MSG_OBJ_TYPE_TX_REMOTE,
0x7FF,
CAN_MSG_OBJ_USE_ID_FILTER,
1
);
I check for received RTR frames, clear the 'New Data' bit by reading the RTR message and then send the response message:
uint8_t responseData[8]; // initialized with zeroes
if (CAN_getNewDataFlags(CANB_BASE) & 0x00000001))
{
uint8_t dummy[8];
CAN_readMessage(CANB_BASE, 1, dummy);
CAN_sendMessage(CANB_BASE, 1, 1, responseData);
responseData[0] ^= 0x80; // toggle upper bit for each response message being sent
}
As long as RTR frames are being received, the above procedure works well.
(incoming frame is successfully detected, response DATA frame is sent as expected)
The problem arises when DATA frames (with the same CAN ID) are being received.
It looks like it does not only listen to RTR frames but also to DATA frames.
In case of DATA frames the above procedure turns into a strange behaviour:
* The DATA frames are recognized and can be received
* Executing the 'CAN_sendMessage' does now send an RTR frame instead of a DATA frame (why??)
My question:
Is it possible to setup a mailbox to listen to RTR frames only?
(I would like to accept RTR only and drop/ignore DATA frames for this mailbox)
The used C2000Ware is version 3.04.00.00.
Thank you,
Markus