Skip to content

Commit 73493b9

Browse files
committed
STM-can-api: Fixed variable name for H7
- can_frequency uses f instead of hz for can frequency - Also added comment to system_clock
1 parent 2a13fa1 commit 73493b9

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

targets/TARGET_STM/TARGET_STM32G4/TARGET_STM32G474xx/TARGET_NUCLEO_G474RE/system_clock.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ uint8_t SetSysClock_PLL_HSE(uint8_t bypass)
105105
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
106106
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
107107
RCC_OscInitStruct.PLL.PLLM = RCC_PLLM_DIV6;
108+
//! 170MHz as a core frequency for FDCAN is not suitable for many frequencies,
109+
//! as it provides low accuracy. When no FDCAN is used, the full capacity of 170 MHz
110+
//! should be standard.
108111
#if DEVICE_CAN
109112
RCC_OscInitStruct.PLL.PLLN = 80;
110113
#else

targets/TARGET_STM/can_api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ int can_frequency(can_t *obj, int f)
287287
#else
288288
// STM32H7 doesn't support yet HAL_RCCEx_GetPeriphCLKFreq for FDCAN
289289
// Internal ST ticket 92465
290-
int ntq = 10000000 / hz;
290+
int ntq = 10000000 / f;
291291
#endif
292292

293293
int nominalPrescaler = 1;

0 commit comments

Comments
 (0)