CAN RTR (Remote transmission request) frames: request and response

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

CAN RTR (Remote transmission request) frames: request and response

Jump to solution
1,983 Views
francisco_rico
Contributor II

Dear NXP support,

Do you have any sample code for CAN RTR messaging, on the receiver side (the one that receives the message and issues the response)?

 

I'd like to know:

1) if the buffer has to be filled every time, after the response is issued.

2) if there is any restriction on filling the buffer (as I've seen in other microcontrollers that a double response could be issued when filling the buffer while the RTR frame is received).

#s32k144

Thank you,

Javier Rico

Labels (1)
Tags (3)
0 Kudos
1 Solution
1,868 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi Francisco,

yes, this could be an option if you do not want to have automatic response.

BR, Petr

View solution in original post

0 Kudos
5 Replies
1,964 Views
francisco_rico
Contributor II

Thanks Petr, 

It is still not clear to me how the mailbox can be filled without the risk of the CAN RTR message being received in the middle of this process, resulting in sending a response that is incomplete or mixing old and new data in the same message. Any advice?

Regards,

Javier

0 Kudos
1,918 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

updating the MB with new data should be done when MB is inactive. So if you inactive used MB and it is done before content moving-out into SMB, then no response will be send. If inactivation is done after message is in Tx SMB, then response will be transmitted, but you will not see double response. 

BR, Petr

0 Kudos
1,877 Views
francisco_rico
Contributor II
Hi Petr,

Main intention is to always send a response. For what you mention, the best course of action would be to assert CTRL2[RRS] to avoid sending an automatic response, and then explicitly send such response.
0 Kudos
1,869 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi Francisco,

yes, this could be an option if you do not want to have automatic response.

BR, Petr

0 Kudos
1,968 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

per my understanding, the FLEXCAN_DRV_ConfigRemoteResponseMb function can be used to prepare MB for remote request response. This need to be called just once, you need not to config MB every time.
No restriction should be there.

BR, Petr

0 Kudos