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.

C2000-F28004X-POWER-EST-CALC: Help for F28004X CAN REMOTE FRAME RESPONSE

Part Number: C2000-F28004X-POWER-EST-CALC

Hi,

I use C2000 F28004X for can remote function, I need do the steps as below:

1. receive a remote std id 0x701 frame

2. after receive the remote frame , send 0x701 data frame with one byte,

I use only one message object for receive 0x701 remote frame and send 0x701 data frame,  MSG_OBJ_TYPE_RX_REMOTE - CAN receive remote request message object, and can't transmit data frame auto, because one byte data I want to feedback can be changed by software,  if use transmit auto, the one byte data can't be controlled by software, Now I config can drive and mcu know when it receive 0x701 remote frame, then i use the same message object to send data frame, 0x701 data frame can be send, but the length of frame is controlled by remote frame length, if remote frame data length is 0, then the length of 0x701 data frame is also 0 , even if i want to set to 1, I also try to write  CAN_O_IF1MCTL DLC(transmit IF1) to 1 from 0 , or try to write CAN_O_IF2MCTL DLC(receive IF1 when remote frame received) to 1 from 0, it can't work. Can you help how to set DLC , and make it work?

I also try to use the other message id to only send 0x701 data frame, i find mcu will send 0x701 data frame with one byte after it receive a 0x701 data frame ,not a remote frame, if I want to get the two steps work well in the beginning , how i should config can drive? one message object for remote , one for data with the same id, or only one message object for receive and transmit ?

  • Hello

    You can't change the DLC size. When you receive a remote frame, the response frame must have the same DLC size, this is a requirement of the CAN protocol. If you can change (if possible in your system) so the remote frame DLC is 1, then you can respond with your 1 byte of data.
    If you go with receiving a regular frame, as you mentioned in your second paragraph, you should set up a message object to receive it and then a 2nd message object to transmit your byte.

    Best regards
    Chris
  • it solved after I config a receive frame and a send frame with one byte, what i do is to set receive remote frame DLC to two bytes, and set send frame DLC with the same id to one byte, then whether remote frame length is zero,one or two, I can receive the remote frame, I will send the same id frame with one byte message, it works well, thanks again.