Skip to content

Commit 9d161e2

Browse files
manchozfacchinm
authored andcommitted
STM32H7: FDCAN: use PLL1Q frequency for calculations - Part 2
1 parent 2f31a22 commit 9d161e2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

targets/TARGET_STM/can_api.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,9 @@ int can_frequency(can_t *obj, int f)
289289
int ntq = HAL_RCCEx_GetPeriphCLKFreq(RCC_PERIPHCLK_FDCAN) / f;
290290
#else
291291
// STM32H7 doesn't support yet HAL_RCCEx_GetPeriphCLKFreq for FDCAN
292-
// Internal ST ticket 92465
293-
int ntq = 10000000 / f;
292+
PLL1_ClocksTypeDef pll1_clocks;
293+
HAL_RCCEx_GetPLL1ClockFreq(&pll1_clocks);
294+
int ntq = pll1_clocks.PLL1_Q_Frequency / f;
294295
#endif
295296

296297
int nominalPrescaler = 1;

0 commit comments

Comments
 (0)