2022-01-11 06:20 AM
I was finally able to find the correct settings to configure my CAN peripherals with correct bitrate after tweaking for a while in STM32CubeMX. The settings that work do not make sense. FDCAN2 is 4 times slower so I had to make clock divider for FDCAN1 4 times higher.
Here are my settings:
The generated code is identical for both peripherals with exception of the clock divider.
I checked the manual, datasheet, errata and FDCAN application note and I didn't find anything about different clocks for FDCAN1 and FDCAN2. Maybe I overlooked something? STM32CubeMX didn't help with the clock calculation, but for another processor I found an example where does STMCubeMX helps with the calculation: https://www.youtube.com/watch?v=JfWlIY0zAIc
Why do FDCAN1 and FDCAN2 have different bitrates for the same settings and vice versa?