Skip to content

Commit 33278e9

Browse files
committed
[Generic F401Rx] Fix clock settings
Signed-off-by: Frederic Pillon <[email protected]>
1 parent a5baee3 commit 33278e9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

variants/Generic_F401Rx/variant.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ static uint8_t SetSysClock_PLL_HSE(uint8_t bypass)
143143

144144
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
145145
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
146-
RCC_OscInitStruct.PLL.PLLM = 8; // VCO input clock = 1 MHz (8 MHz / 8)
146+
RCC_OscInitStruct.PLL.PLLM = HSE_VALUE / 1000000L; // Expects an 8 MHz external clock by default. Redefine HSE_VALUE if not
147147
RCC_OscInitStruct.PLL.PLLN = 336; // VCO output clock = 336 MHz (1 MHz * 336)
148148
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV4; // PLLCLK = 84 MHz (336 MHz / 4)
149149
RCC_OscInitStruct.PLL.PLLQ = 7; // USB clock = 48 MHz (336 MHz / 7) --> OK for USB

0 commit comments

Comments
 (0)