STM32 FDCAN Example: conflicting settings for bitrate switching?
Show older comments
Hello,
I've been trying to setup and test CAN-FD communication (with bitrate switching) between two STM32 microcontrollers with a built-in CAN-FD peripheral, and started by following this example from Mathworks.
The example sets the CAN-FD timing parameters in STM32CubeMX for a nominal rate of 1 Mbps and a data rate of 2.5 Mbps. On the other hand, it is asking to set the "Frame Format" parameter in STM32CubeMX to "FD mode without BitRate Switching".
Setting the Frame Format to "...without BitRate Switching" would cause the FDCAN_CCCR.BRSE bit to be 0, and based on STM32 documentation (e.g. STM32H7 reference manual): "With FDCAN_CCCR.FDOE = 1 and FDCAN_CCCR.BRSE = 0, only bit FDF of a Tx buffer element is evaluated. With FDCAN_CCCR.FDOE = 1 and FDCAN_CCCR.BRSE = 1, transmission of CAN FD frames with bitrate switching is enabled."
So it seems like the Frame Format setting will override the different bit rates, and the generated application will communicate at a fixed rate of 1 Mbps. Is this an error in the instructions given for the example, or am I missing something?
3 Comments
Torsten
on 18 Sep 2026
AI says that you are completely correct, and you have spotted a genuine contradiction in that MathWorks example documentation.
Contact support for confirmation:
Mohammed Shaheen
on 22 Sep 2026
Hi Ali,
This is a valid point and would be best addressed by MathWorks Technical Support. I recommend contacting Technical Support directly: https://www.mathworks.com/support/contact_us.html
Thanks.
Ali Reza
on 23 Sep 2026
Accepted Answer
More Answers (0)
Categories
Find more on STMicroelectronics Discovery Boards in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!