Skip to content

Commit 7650d91

Browse files
erwangonashif
authored andcommitted
drivers/clock_control: stm32: Fixes around LSE clock
Fix macro used in g4 file to enable LSE clock. Then, to avoid no-op configurations, generate an error when MSI Hardware auto calibration is selected but LSE clock is not enabled. Signed-off-by: Erwan Gouriou <[email protected]>
1 parent 84c5a46 commit 7650d91

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

drivers/clock_control/clock_stm32_ll_common.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,10 @@ int stm32_clock_control_init(const struct device *dev)
462462
LL_RCC_MSI_SetCalibTrimming(0);
463463

464464
#if STM32_MSI_PLL_MODE
465+
466+
#ifndef STM32_LSE_CLOCK
467+
#error "MSI Hardware auto calibration requires LSE clock activation"
468+
#endif
465469
/* Enable MSI hardware auto calibration */
466470
LL_RCC_MSI_EnablePLLMode();
467471
#endif

drivers/clock_control/clock_stm32g4.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ void config_enable_default_clocks(void)
4949
/* Enable the power interface clock */
5050
LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_PWR);
5151

52-
#ifdef STM32_LSE
52+
#ifdef STM32_LSE_CLOCK
5353
/* LSE belongs to the back-up domain, enable access.*/
5454

5555
/* Set the DBP bit in the Power control register 1 (PWR_CR1) */

0 commit comments

Comments
 (0)