Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion stm32cube/stm32g4xx/README
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,10 @@ License Link:
https://opensource.org/licenses/BSD-3-Clause

Patch List:
none

*stm32g4xx: wrong clock setup
In case the actual value is AHB prescaler 1, it must be set,
after setting the AHB prescaler to 2.
Impacted files:
drivers/src/stm32g4xx_ll_utils.c
ST Bug tracker ID: 78880
4 changes: 2 additions & 2 deletions stm32cube/stm32g4xx/drivers/src/stm32g4xx_ll_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ ErrorStatus LL_PLL_ConfigSystemClock_HSI(LL_UTILS_PLLInitTypeDef *UTILS_PLLInitS
status = UTILS_EnablePLLAndSwitchSystem(pllfreq, UTILS_ClkInitStruct);

/* Apply definitive AHB prescaler value if necessary */
if((status == SUCCESS) && (hpre != 0U))
if((status == SUCCESS) && (hpre == LL_RCC_SYSCLK_DIV_1))
{
UTILS_ClkInitStruct->AHBCLKDivider = LL_RCC_SYSCLK_DIV_1;
LL_RCC_SetAHBPrescaler(UTILS_ClkInitStruct->AHBCLKDivider);
Expand Down Expand Up @@ -416,7 +416,7 @@ ErrorStatus LL_PLL_ConfigSystemClock_HSE(uint32_t HSEFrequency, uint32_t HSEBypa
status = UTILS_EnablePLLAndSwitchSystem(pllfreq, UTILS_ClkInitStruct);

/* Apply definitive AHB prescaler value if necessary */
if((status == SUCCESS) && (hpre != 0U))
if((status == SUCCESS) && (hpre == LL_RCC_SYSCLK_DIV_1))
{
UTILS_ClkInitStruct->AHBCLKDivider = LL_RCC_SYSCLK_DIV_1;
LL_RCC_SetAHBPrescaler(UTILS_ClkInitStruct->AHBCLKDivider);
Expand Down