Skip to content

Commit a3ec56c

Browse files
Georgij Cernysiovgalak
authored andcommitted
drivers: counter: stm32: fix LSE clock source for not F4 SoC
Fixes the STM32 counter driver when LSE is the clock source and SoC is not F4. Signed-off-by: Georgij Cernysiov <[email protected]>
1 parent 91ca8aa commit a3ec56c

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

drivers/counter/Kconfig.stm32_rtc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ if !SOC_SERIES_STM32F4X
3636

3737
choice COUNTER_RTC_STM32_LSE_DRIVE
3838
prompt "LSE oscillator drive capability"
39-
depends on RTC_STM32_CLOCK_LSE
39+
depends on COUNTER_RTC_STM32_CLOCK_LSE
4040

4141
config COUNTER_RTC_STM32_LSE_DRIVE_LOW
4242
bool "Low"

drivers/counter/counter_ll_stm32_rtc.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,10 +275,14 @@ static int rtc_stm32_init(struct device *dev)
275275

276276
#else /* CONFIG_COUNTER_RTC_STM32_CLOCK_LSE */
277277

278-
#ifndef(CONFIG_SOC_SERIES_STM32F4X)
278+
#if !defined(CONFIG_SOC_SERIES_STM32F4X) && \
279+
!defined(CONFIG_SOC_SERIES_STM32F2X)
280+
279281
LL_RCC_LSE_SetDriveCapability(
280282
CONFIG_COUNTER_RTC_STM32_LSE_DRIVE_STRENGTH);
281-
#endif /* !CONFIG_SOC_SERIES_STM32F4X */
283+
284+
#endif /* !CONFIG_SOC_SERIES_STM32F4X && !CONFIG_SOC_SERIES_STM32F2X */
285+
282286
LL_RCC_LSE_Enable();
283287

284288
/* Wait until LSE is ready */

0 commit comments

Comments
 (0)