2025-09-10 12:24 AM
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 |
500 | 500 | No |
500 | 1000 | Yes |
500 | 2000 | Yes |
500 | 4000 | Yes |
500 | 5000 | Yes |
500 | 8000 | Yes |
1000 | 1000 | No |
1000 | 2000 | Yes |
1000 | 4000 | Yes |
1000 | 5000 | Yes |
1000 | 8000 | Yes |
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 bitrate | Prescaler | SJW | Tseg1 | Tseg2 | Tq per bit | Theoretical bitrate (kpbs) |
500 | 16 | 2 | 7 | 2 | 10 | 500 |
1000 | 8 | 2 | 7 | 2 | 10 | 1000 |
Data rates | Prescaler | SJW | Tseg1 | Tseg2 | Tq per bit | Theoretical bitrate (kpbs) |
500 | 16 | 4 | 7 | 2 | 10 | 500 |
1000 | 8 | 2 | 7 | 2 | 10 | 1000 |
2000 | 4 | 4 | 7 | 2 | 10 | 2000 |
Any help would be appreciated,
Best regards
2025-09-10 12:34 AM - edited 2025-09-10 12:39 AM
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.
2025-09-10 1:01 AM
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.
2025-09-10 1:03 AM - edited 2025-09-10 1:07 AM
@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.