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 remote frame with F2837xD Peripheral Driver Library

Other Parts Discussed in Thread: CONTROLSUITE

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

 

  • Hello

    By parsing this forum, I found a part of the solution.

    By configuring like following:

    Object 1: MSG_OBJ_TYPE_RX; ID/Mask (0x005 / 0x01F in my exemple) ; Flags MSG_OBJ_USE_ID_FILTER | MSG_OBJ_USE_DIR_FILTER,

    Object 2: MSG_OBJ_TYPE_RXTX_REMOTE; ID/Mask (0x705 / 0 in my exemple) ; Flags  MSG_OBJ_USE_DIR_FILTER;

     

    By this way,

    - I get event of Object 1 when a normal frame 0x705, 0x605... is received =>Ok

    - I not get event of object 1 when a remote frame 0x705 is received => Ok

    - An automatic Tx response with the specified buffer data/Length is done by the hardware when Remote frame 0x705 is received => OK

    - I get an event of object 2 when this Remote frame 0x705 is received => NOK: Event is not generated.

    I d'ont know how detect if remote frame is received, because in this case, I must make change a toggle bit on the next Remote frame tx response...

    This seems be the same problem at the end of this post, but no solution was given :-(

  • Hello,

                Our Driver Library is not written with HLPs in mind. For assistance with HLPs like CANopen, you could engage with a 3rd party. With that being said, are these your questions/concerns?

     

    1. The driver library does not differentiate between the reception of a normal frame and a remote frame. Also, there is no "system notification" when a remote frame is received. (Clarify what you mean by "system notification"). IOW, what does the driver library do differently when it receives a Remote frame as opposed to a data frame?
    2. Is an interrupt generated automatically when a remote frame is received?
    3. Can a Remote-frame be received and responded to from the same mailbox? Does the Driverlib support this option?

  • Hello.

    On my last reply, I indicated a part of my question was resolved: This concerned the filter on Remote or Normal frame.

    This is Ok.

    Now, I have always the second part which is not resolved:

    My ECU has the following scheme:

    It receive a remote frame with length =0 and must respond with a Normal frame containing data:

    The to do this, I have two solution:

    1 - Use an object of type MSG_OBJ_TYPE_RXTX_REMOTE. By this way, the response will be automaticcaly triggered by the Hardware controller when remote frame will received:

    2- Use two objects. First an MSG_OBJ_TYPE_RX_REMOTE to be notified a remote frame is received. Then In the software, send the TX FRAME with an object MSG_OBJ_TYPE_TX:

    This work fine.

    Now, the problem is on CANOpen protocol, the response from the remote contain a field named "Toggle" bit. This means the response data must changed on each response by making a bit toggle. Then, The software must be notified on each received REMOTE frame to change this bit. This is ok by using the second solution exposed above (The notification should be a polling mode or an interrupted mode anyway..):

    But if I want use the hardware capability (first solution exposed above), the software can't be notified to prepare data to send on the next REMOTE frame received:

    Are they a means to know a REMOTE frame was received when configured in Automatic hardware response?

  • You should be able to use the TX interrupt of the message object that responds to the remote frame. When you get the interrupt, the response has been sent and it's okay to update the data. Does that work for you?

    If you also want to know when the remote frame arrives, you can use a separate receive object for that.

  • Ok

    This seems to be a good solution,

    I will test it.