Hello
I'm working on ControlCARD F2837xD.
I'm using the CAN library (C:\ti\controlSUITE\device_support\F2837xD\v200\F2837xD_common\driverlib\can.c / .h)
So I want do something but I can't find the good way to reach it.
In fact, I want implement the CANOpen protocol.
TO do this, the board can receive both these frames (Exemple)
HeartBeat frame : ID = 0x705, Data = 0xNN, length = 1 => internal Software must be notified upon reception of this frame
Node Guarding frame: ID = 0x705 (Remote frame), Data = NONE, Length = 0. => internal Software must be notified upon reception of this frame and AUTOMATIC response frame (Not a REMOTE) should be transmitted with some data, this could be done automaticcaly without software intervention id possible..
To resume, I want receive the HeartBeat frame with data, and then I want be notified by the Remote frame receive and then make a response ID = 0x705, Data=0xYY, length = 1.
To do this, I made the following:
/* sMsgObjHeart object will be fit if ID = 0x705, 0x605,..*/.
sMsgObjHeart.ulMsgID = 0x005;
sMsgObjHeart.ulMsgIDMask = 0x01F;
sMsgObjHeart.ulFlags = MSG_OBJ_USE_ID_FILTER;
CANMessageSet(CAN0_BASE, 1 , &sMsgObjHeart, MSG_OBJ_TYPE_RX)
sMsgRemote.ulMsgID = 0x705;
sMsgRemote.ulMsgIDMask = 0;
sMsgRemote.ulFlags =0;
CANMessageSet(CAN0_BASE, 2 , &sMsgRemote, MSG_OBJ_TYPE_RXTX_REMOTE)
Then with this code, I expect to:
- On receive of frame 0x605: 0xAA, 0xBB.. Make Object 1 match : CANStatusGet(CAN0_BASE, CAN_STS_NEWDAT) return 0x0001 => test is OK
- On receive of frame 0x705: 0xCC, 0xDD.. Make Object 1 match : CANStatusGet(CAN0_BASE, CAN_STS_NEWDAT) return 0x0001 => test is OK
- On receive of REMOTE frame 0x705: length = 0. Make Object 2 match : CANStatusGet(CAN0_BASE, CAN_STS_NEWDAT) return 0x0002 and have an hardware automatic response with the buffer transmited on last CANMessageSet(CAN0_BASE, 2 ,...) => NOK, in this case, it is the Object 1 which match, and no automatic hardware response is done...
Now, on my configuration, If I change the ID of the Object 2 (REMOTE) from 0x705 to 0x706:
- On receive of REMOTE frame 0x706: length = 0. Make Object 2 match : CANStatusGet(CAN0_BASE, CAN_STS_NEWDAT) return 0x0002 and have an hardware automatic response with the buffer transmited on last CANMessageSet(CAN0_BASE, 2 ,...) => NOK, in this case, No object match, but automatic hardware response is done with an REMOTE FRAME without any data specified by sMsgRemote.
Then it seems have the following restrictions:
- The Object filtering notification is only done on CAN ID, note also according if it is a REMOTE frame or NOT.
- In the case of Automatic response is done by hardware when receive a REMOTE frame, the application can't be notified by this
-The Automatic response done when REMOTE frame is received is mandatory a REMOTE Tx Frame
Is these restrictions are right? or have you a solution to not have these restrictions?
Is I ask is possible with the F2837xD?
Is I ask is possible with the CAN library, if yes, by which configuration?
Edit: I not seen any difference on object receive when it is configured in MSG_OBJ_TYPE_RX or MSG_OBJ_TYPE_RX_REMOTE. We receive twice whatever the received frame is a normal frame or remote frame. Just the ui32Flag has MSG_OBJ_REMOTE_FRAME set on REMOTE frame case...
Thank you





