Skip to content

Commit 2a13fa1

Browse files
committed
STMG4-sys-clk: If can PLLQ=160MHz, else 170MHz
- with 170MHz as can-core-frequency, the accuracy for many baudrates is too low. 160MHz is better for a broad range of frequencies
1 parent d0c8ad7 commit 2a13fa1

File tree

1 file changed

+5
-1
lines changed
  • targets/TARGET_STM/TARGET_STM32G4/TARGET_STM32G474xx/TARGET_NUCLEO_G474RE

1 file changed

+5
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,13 @@ 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+
#if DEVICE_CAN
108109
RCC_OscInitStruct.PLL.PLLN = 80;
110+
#else
111+
RCC_OscInitStruct.PLL.PLLN = 85;
112+
#endif
109113
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
110-
RCC_OscInitStruct.PLL.PLLQ = RCC_PLLQ_DIV4;
114+
RCC_OscInitStruct.PLL.PLLQ = RCC_PLLQ_DIV2;
111115
RCC_OscInitStruct.PLL.PLLR = RCC_PLLR_DIV2;
112116
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
113117
return 0; // FAIL

0 commit comments

Comments
 (0)