Closed intercreate closed 4 years ago
Hi InterCreate,
Thank you for having created this issue. It will be forwarded to our development teams for deeper analysis. I also add @FRASTM into the loop as he has reported the same issue via this pull-request.
I also indicate the link to your post for the ST Community.
I will be back to you as soon as I get an answer. Thank you for your patience and thank you both, you and @FRASTM, once more, for having reported the issue.
With regards,
ST Internal Reference: 79947
Hi InterCreate,
This issue has been fixed. The fix is available in the frame of the STM32CubeG4 v1.2.0 which has been recently published on GitHub.
Thank you for your patience and thank you both (@intercreate and @FRASTM) for your contribution. This issue can be closed now.
With regards,
Describe the set-up
Describe the bug The function
LL_PLL_ConfigSystemClock_HSI()
instm32g4xx_ll_utils.c
temporarily divides the AHB clock by 2 if the SYSCLK divider is 1. According to the comments, this is to "Prevent undershoot at highest frequency by applying intermediate AHB prescaler 2".The issue is that during this temporary AHB clock rate, the
SystemCoreClock
is updated to also be 1/2 the expected clock.Although
LL_PLL_ConfigSystemClock_HSI()
resets the AHB clock properly, it does not reset the global variableSystemCoreClock
.This incorrect value is exposed when trying to set the UART baud rate later on in
stm32g4xx_hal_uart.c
.Note that Zephyr uses the latest (0f8a4fd) with this recent pull-request integrated.
How To Reproduce
LL_PLL_ConfigSystemClock_HSI()
to configure PLLs using the pull-request mentioned above.See https://github.com/zephyrproject-rtos/zephyr/blob/master/drivers/clock_control/clock_stm32_ll_common.c#L346 for use of
LL_PLL_ConfigSystemClock_HSI()
Additional context
This patch fixes the problem in my environment.
Screenshots N/A