cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 CAN FD ISO Nominal 500kpbs Data 1Mbps

BBute.1
Associate II

Hello,

I am using STM32 microcontrollers on CAN FD ISO buses.

The problem is that I am not able to configure CAN FD bus with a nominal rate of 500kbps and a data rate of 1Mbps. All others configurations are working as expected, see below all combinations tested:

Nominal rate (kbps)Data Rate (kbps)BRS
500500No
5001000Yes
5002000Yes
5004000Yes
5005000Yes
5008000Yes
10001000No
10002000Yes
10004000Yes
10005000Yes
10008000Yes

I tried the following issue on STM32G431KBU and STM32H723ZGI. CAN input clock is 80MHz, Sys Clk is 512MHz for H7 and peripheral clock is256MHz. On G4, Sys clock is 160MHz and peripheral clock is 160MHz. So on both microcontrollers CAN clock is lower than peripheral clock.

Bit timings for nominal rates are the following:

Nominal bitratePrescalerSJWTseg1Tseg2 Tq per bitTheoretical bitrate (kpbs)
5001627210500
10008272101000
Data ratesPrescalerSJWTseg1Tseg2 Tq per bitTheoretical bitrate (kpbs)
5001647210500
10008272101000
20004472102000

 

Any help would be appreciated,

Best regards

3 REPLIES 3
mƎALLEm
ST Employee

Hello,

1- What do you mean by "I am not able to configure CAN FD bus with a nominal rate of 500kbps and a data rate of 1Mbps." ? please elaborate more because not clear what the issue is..

2- Did you test the same conditions in one of the Loopback modes?

3- If you are using CubeMx, please attach your ioc files with that 500kb/1Mb bitrates.

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,

Thank you for your prompt reply!

1. You are right sorry, I am able to configure the micro with the right bit timings but frames are not sent and generates error frames. When I look with a scope, it looks like the nominal phase is going on at 500kps, but the communication stops soon after bitrate switching to 1Mbps. I tried with two different hardwares to ensure that the issue does not come from my CAN sniffer (Kvaser and Peak).

2. I did not used loopback mode because all other combinations are working properly.

3. I am not able to attach the full IOC file for privacy reason, but I will be happy to share with more parts of the configuration.

 

Side note : I am also using TxDelay compensation with HAL's functions.


@BBute.1 wrote:

2. I did not used loopback mode because all other combinations are working properly.


Need to test that configuration to discard any other external HW issues. The idea is to focus on the FDCAN peripheral itself.

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.