-
Notifications
You must be signed in to change notification settings - Fork 7.7k
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?
Changes from 1 commit
5a0898d
ba13cdb
e9b43b9
7285b1a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -456,7 +456,11 @@ static int stm32_clock_control_get_subsys_rate(const struct device *clock, | |
#endif | ||
#if defined(STM32_SRC_HSI) | ||
case STM32_SRC_HSI: | ||
#if defined(CONFIG_SOC_SERIES_STM32L0X) | ||
*rate = STM32_HSI_FREQ / STM32_HSI_DIVISOR; | ||
#else | ||
*rate = STM32_HSI_FREQ; | ||
#endif | ||
break; | ||
#endif | ||
#if defined(STM32_SRC_MSI) | ||
|
@@ -662,7 +666,13 @@ static void set_up_fixed_clock_sources(void) | |
} | ||
} | ||
#if STM32_HSI_DIV_ENABLED | ||
#if defined(CONFIG_SOC_SERIES_STM32L0X) | ||
if (STM32_HSI_DIVISOR == 4) { | ||
LL_RCC_HSI_EnableDivider(); | ||
} | ||
Comment on lines
+670
to
+672
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree, nice catch. |
||
#else | ||
LL_RCC_SetHSIDiv(hsi_divider(STM32_HSI_DIVISOR)); | ||
#endif | ||
#endif | ||
} | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.