cancel
Showing results for 
Search instead for 
Did you mean: 

FDCAN: Retransmissions Configuration

MFrie.7
Associate III

Good afternoon
I am working on the STM32H755 and am dealing with the retransmissions from my CAN FD periphery. According to the ISO-11898-1:2024 standard, the number of retransmissions should be configurable:
"
- from 0 (no retransmission),
- to at least 6 (6 retransmission attempts),
- and the highest number in this range can allow unlimited retransmission attempts.
"
Currently I have FunctionalState AutoRetransmission in FDCAN_InitTypeDef set to ENABLE and on the oscilloscope I see an infinite number of retransmissions when I disconnect between two nodes. Now I want to limit the retransmission count to 6 retransmissions.
Can I do this?
Thank you very much for your answer.
Manuel

1 ACCEPTED SOLUTION

Accepted Solutions

@MFrie.7 wrote:

Understood. And is there no way to count the number of retransmissions and stop them after a certain number (except by polling the TEC register)?


Indeed. There is no interrupt on a specific value of TEC counter.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

View solution in original post

9 REPLIES 9
ahsrabrifat
Senior II

You can monitor the Transmit Error Counter (TEC) in the FDCAN Protocol Status Register (PSR) and count the retransmissions in software. If the transmission is failing, keep a counter and manually stop retransmission after 6 attempts.

Hello, thank you for your reply.
The monitoring from the TEC is basically a good approach. The problem is that I want to stop the transmission after a few retransmissions (<= 10). Since there is no interrupt when the TEC is increased, I would have to poll this register constantly, which I consider to be an unreasonable solution.

Hello,


@MFrie.7 wrote:

The problem is that I want to stop the transmission after a few retransmissions (<= 10). 


I don't think this is possible according to what you said previously: "Now I want to limit the retransmission count to 6 retransmissions."

It seems the ISO-11898-1:2024 standard (which we can no have access) is something new and does not implies to STM32H7 which follows the standard 11898-1: 2015.

Hope that answers your question.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

Hello and thank you for your reply.
I don't understand the statement:

"I don't think this is possible according to what you said previously: "Now I want to limit the retransmission count to 6 retransmissions.""

Do you mean that it is not possible to configure the number of retransmissions? So you can only switch retransmissions on (unlimited retransmissions) or off (no retransmissions)?

Best Regards,

Manuel

Yes I mean that's not possible to configure the number of the retransmission..

It's either Off or unlimited retransmissions.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

Understood. And is there no way to count the number of retransmissions and stop them after a certain number (except by polling the TEC register)?


@MFrie.7 wrote:

Understood. And is there no way to count the number of retransmissions and stop them after a certain number (except by polling the TEC register)?


Indeed. There is no interrupt on a specific value of TEC counter.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

Isn't the TEC counter in the FDCAN_ECR (FDCAN error counter register) register?

Perhaps the interrupt "PEA: Protocol error in arbitration phase (nominal bit time is used)" or "PED: Protocol error in data phase (data bit time is used)" is triggered by an error.
TEC could be checked in the handler.

Hello
The problem with this solution is that if the arbitration contests is lost this is not counted as an error. That means with your implementation it would simply come to a retransmission if there was an error during the transmission, but not if the arbitration contests is lost. This is not a possible solution in my case, as I have a lot of nodes communicating and there would therefore be a lot of losses in the arbitration phases. Since I have adapted my concept and only want to repeat the packages that have lost the arbitration test, I have implemented the following workaround:

Solved: Re: Enable FDCAN_IT_ARB_PROTOCOL_ERROR - STMicroelectronics Community