-
Notifications
You must be signed in to change notification settings - Fork 7.6k
STM32L0: fix PLL input frequency division by HSI clock divider #92546
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
8c3c4de
to
e7e3710
Compare
@@ -662,7 +662,13 @@ static void set_up_fixed_clock_sources(void) | |||
} | |||
} | |||
#if STM32_HSI_DIV_ENABLED | |||
#if defined(CONFIG_SOC_SERIES_STM32L0X) | |||
if (LL_RCC_IsActiveFlag_HSIDIV()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand why this check is there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replaced with STM32_HSI_DIVISOR check.
e7e3710
to
7cd19aa
Compare
7cd19aa
to
a7d69e8
Compare
Add hsi clock for stm32l0. Signed-off-by: Khaoula Bidani <khaoula.bidani-ext@st.com>
Enable support for HSI_DIV and its use as a clock source on STM32L0 SoCs. Signed-off-by: Khaoula Bidani <khaoula.bidani-ext@st.com>
a7d69e8
to
94bf03b
Compare
Updated the clk_hsi node to use the "st,stm32l0-hsi-clock" compatible to use hsi divider. Signed-off-by: Khaoula Bidani <khaoula.bidani-ext@st.com>
Updated the PLL input frequency calculation to include division by the HSI clock divider. Enable HSI divider using LL_RCC_HSI_EnableDivider(). Signed-off-by: Khaoula Bidani <khaoula.bidani-ext@st.com>
94bf03b
to
7285b1a
Compare
|
@nordic-krch PTAL |
if (STM32_HSI_DIVISOR == 4) { | ||
LL_RCC_HSI_EnableDivider(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The disable function should also be called in an else. I think it is necessary if for example an MCUBoot enables the divider, but the application wants it disabled
In the STM32L0 clock driver the HSI clock divider is not considered when calculating the PLL source frequency (register value RCC_CR/HSIDIV).
Add new clocks bindings for stm32l0 series "st,stm32l0-hsi-clock" to use hsi-div property.
Updated the clk_hsi node to use the "st,stm32l0-hsi-clock" compatible to enable support for the HSI clock divider (hsi-div property).