From 888bde94bea2df5f30d6383f0c013bfb907122f5 Mon Sep 17 00:00:00 2001 From: Mickael Bosch Date: Fri, 6 Jun 2025 16:51:10 +0200 Subject: [PATCH] drivers: timer: handle the stm32u0 target Configure the lptim to wake-up from sleep. Signed-off-by: Mickael Bosch --- drivers/timer/stm32_lptim_timer.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/timer/stm32_lptim_timer.c b/drivers/timer/stm32_lptim_timer.c index 5c425501ac9..b38a614e102 100644 --- a/drivers/timer/stm32_lptim_timer.c +++ b/drivers/timer/stm32_lptim_timer.c @@ -519,11 +519,9 @@ static int sys_clock_driver_init(void) /* the LPTIM clock freq is affected by the prescaler */ LL_LPTIM_SetPrescaler(LPTIM, (__CLZ(__RBIT(lptim_clock_presc)) << LPTIM_CFGR_PRESC_Pos)); -#if defined(CONFIG_SOC_SERIES_STM32U5X) || \ - defined(CONFIG_SOC_SERIES_STM32H5X) || \ - defined(CONFIG_SOC_SERIES_STM32WBAX) - LL_LPTIM_OC_SetPolarity(LPTIM, LL_LPTIM_CHANNEL_CH1, - LL_LPTIM_OUTPUT_POLARITY_REGULAR); +#if defined(CONFIG_SOC_SERIES_STM32U5X) || defined(CONFIG_SOC_SERIES_STM32H5X) || \ + defined(CONFIG_SOC_SERIES_STM32WBAX) || defined(CONFIG_SOC_SERIES_STM32U0X) + LL_LPTIM_OC_SetPolarity(LPTIM, LL_LPTIM_CHANNEL_CH1, LL_LPTIM_OUTPUT_POLARITY_REGULAR); #else LL_LPTIM_SetPolarity(LPTIM, LL_LPTIM_OUTPUT_POLARITY_REGULAR); #endif @@ -533,9 +531,8 @@ static int sys_clock_driver_init(void) /* counting start is initiated by software */ LL_LPTIM_TrigSw(LPTIM); -#if defined(CONFIG_SOC_SERIES_STM32U5X) || \ - defined(CONFIG_SOC_SERIES_STM32H5X) || \ - defined(CONFIG_SOC_SERIES_STM32WBAX) +#if defined(CONFIG_SOC_SERIES_STM32U5X) || defined(CONFIG_SOC_SERIES_STM32H5X) || \ + defined(CONFIG_SOC_SERIES_STM32WBAX) || defined(CONFIG_SOC_SERIES_STM32U0X) /* Enable the LPTIM before proceeding with configuration */ LL_LPTIM_Enable(LPTIM);