Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd4a0b3c

Browse files
committed
variant(g4): correct the clock config for HSE8 on WeAct G474CEU
* Override HSE value to 8 MHz not 24* Keep PLL input above 2.66 MHz spec* Set VCO to a multiple of USB48 and feed that from PLL, sysclk becomes 144
1 parent65677a2 commitd4a0b3c

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

‎variants/STM32G4xx/G473C(B-C-E)U_G474C(B-C-E)U_G483CEU_G484CEU/variant_WEACT_G474CE.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,9 @@ WEAK void SystemClock_Config(void)
111111
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
112112
RCC_OscInitStruct.HSI48State = RCC_HSI48_ON;
113113
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
114-
RCC_OscInitStruct.PLL.PLLM =RCC_PLLM_DIV4;
114+
RCC_OscInitStruct.PLL.PLLM =RCC_PLLM_DIV2;
115115
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
116-
RCC_OscInitStruct.PLL.PLLN =85;
116+
RCC_OscInitStruct.PLL.PLLN =72;
117117
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
118118
RCC_OscInitStruct.PLL.PLLQ = RCC_PLLQ_DIV6;
119119
RCC_OscInitStruct.PLL.PLLR = RCC_PLLR_DIV2;
@@ -135,7 +135,7 @@ WEAK void SystemClock_Config(void)
135135
#ifdef USBCON
136136
/* Initializes the peripherals clocks*/
137137
PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_USB;
138-
PeriphClkInit.UsbClockSelection =RCC_USBCLKSOURCE_HSI48;
138+
PeriphClkInit.UsbClockSelection =RCC_USBCLKSOURCE_PLL;
139139
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK) {
140140
Error_Handler();
141141
}
@@ -146,4 +146,4 @@ WEAK void SystemClock_Config(void)
146146
}// extern "C"
147147
#endif
148148

149-
#endif/*ARDUINO_NUCLEO_G431RB*/
149+
#endif/*ARDUINO_WEACT_G474CE*/

‎variants/STM32G4xx/G473C(B-C-E)U_G474C(B-C-E)U_G483CEU_G484CEU/variant_WEACT_G474CE.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,10 @@
184184
#defineHAL_QSPI_MODULE_ENABLED
185185
#endif
186186

187+
#ifndefHSE_VALUE
188+
#defineHSE_VALUE 8000000U
189+
#endif
190+
187191
/*----------------------------------------------------------------------------
188192
* Arduino objects - C++ only
189193
*----------------------------------------------------------------------------*/

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp