From d70e96ea96c9a5a7fe3081a263176522adfc50d5 Mon Sep 17 00:00:00 2001 From: Francois Ramu Date: Wed, 27 Mar 2024 11:45:47 +0100 Subject: [PATCH] soc: st: stm32 mcus setting the lptim clock source Select the LPTIM clock source STM32_LPTIM_CLOCK to be LSE or LSI depending on the DTS clocks property of the stm32_lp_tick_source node. This will also affect the SYS_CLOCK_TICKS_PER_SEC depending on the lptim prescaler Signed-off-by: Francois Ramu --- soc/st/stm32/Kconfig.defconfig | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/soc/st/stm32/Kconfig.defconfig b/soc/st/stm32/Kconfig.defconfig index 9b06788796f..d90ce9b7da8 100644 --- a/soc/st/stm32/Kconfig.defconfig +++ b/soc/st/stm32/Kconfig.defconfig @@ -44,6 +44,11 @@ config SYS_CLOCK_TICKS_PER_SEC default 250 if "$(dt_node_int_prop_int,$(DT_STM32_LPTIM_PATH),$(DT_ST_PRESCALER))" = 128 depends on STM32_LPTIM_TIMER && STM32_LPTIM_CLOCK_LSI +choice STM32_LPTIM_CLOCK + default STM32_LPTIM_CLOCK_LSE if "$(dt_node_ph_array_prop_int,$(DT_STM32_LPTIM_PATH),clocks,1,bus)" = 2 + default STM32_LPTIM_CLOCK_LSI if "$(dt_node_ph_array_prop_int,$(DT_STM32_LPTIM_PATH),clocks,1,bus)" = 3 +endchoice + config CLOCK_CONTROL_STM32_CUBE default y depends on CLOCK_CONTROL