diff --git a/boards/common/nucleo/Kconfig b/boards/common/nucleo/Kconfig index 029c99aa6c..e0947d2ef3 100644 --- a/boards/common/nucleo/Kconfig +++ b/boards/common/nucleo/Kconfig @@ -15,3 +15,5 @@ config MODULE_BOARDS_COMMON_NUCLEO stm32 common nucleo code. endif # TEST_KCONFIG + +rsource "../stm32/Kconfig" diff --git a/cpu/stm32/Kconfig b/cpu/stm32/Kconfig index 8ab8c6e5f1..f8e6b0ab4e 100644 --- a/cpu/stm32/Kconfig +++ b/cpu/stm32/Kconfig @@ -16,6 +16,9 @@ config CPU_STM32 select HAS_PERIPH_UART_MODECFG select HAS_PERIPH_UART_NONBLOCKING + # This CPU requires periph_rtc when periph_rtc_mem + select MODULE_PERIPH_RTC if MODULE_PERIPH_RTC_MEM && HAS_PERIPH_RTC + # Common CPU symbol config CPU default "stm32" if CPU_STM32 diff --git a/drivers/periph_common/Kconfig b/drivers/periph_common/Kconfig index a1b958375e..d594757d79 100644 --- a/drivers/periph_common/Kconfig +++ b/drivers/periph_common/Kconfig @@ -126,6 +126,11 @@ config MODULE_PERIPH_RTT_SET_COUNTER bool "rtc_set_counter() implementation in the RTT peripheral driver" depends on HAS_PERIPH_RTT_SET_COUNTER && MODULE_PERIPH_RTT +config MODULE_PERIPH_INIT_RTT_SET_COUNTER + bool "Auto initialize rtc_set_counter() with RTT" + default y if MODULE_PERIPH_INIT + depends on MODULE_PERIPH_RTT_SET_COUNTER + config MODULE_PERIPH_INIT_RTT bool "Auto initialize RTT peripheral" default y if MODULE_PERIPH_INIT diff --git a/drivers/periph_common/Kconfig.rtc b/drivers/periph_common/Kconfig.rtc index 45bd98fe3b..080b4361d6 100644 --- a/drivers/periph_common/Kconfig.rtc +++ b/drivers/periph_common/Kconfig.rtc @@ -15,5 +15,21 @@ config MODULE_PERIPH_INIT_RTC default y if MODULE_PERIPH_INIT depends on MODULE_PERIPH_RTC +config MODULE_PERIPH_RTC_MEM + bool "Low-Power RTC Memory" + depends on HAS_PERIPH_RTC_MEM + help + Provides an interface to access low-power memory present on some RTCs. + This memory is retained even when the rest of the system is powered off. + +# TODO: this module is actually just an artifact from the way periph_init_% +# modules are handled in Makefile. We need to define it to keep the list the +# same for now. We should be able to remove it later on. + +config MODULE_PERIPH_INIT_RTC_MEM + bool + default y if MODULE_PERIPH_INIT + depends on MODULE_PERIPH_RTC_MEM + # Include CPU specific configurations osource "$(RIOTCPU)/$(CPU)/periph/Kconfig.rtc" diff --git a/sys/ztimer/Kconfig b/sys/ztimer/Kconfig index c6720f6b13..5ef3b42afa 100644 --- a/sys/ztimer/Kconfig +++ b/sys/ztimer/Kconfig @@ -76,8 +76,7 @@ choice depends on MODULE_ZTIMER_SEC default ZTIMER_SEC_BACKEND_RTC if !BOARD_NATIVE && \ !CPU_COMMON_SAM0 && \ - !CPU_COMMON_EFM32 && \ - !CPU_FAM_F1 + !CPU_COMMON_EFM32 default ZTIMER_SEC_BACKEND_RTT config ZTIMER_SEC_BACKEND_TIMER diff --git a/tests/periph_rtc/Kconfig b/tests/periph_rtc/Kconfig new file mode 100644 index 0000000000..6384225e04 --- /dev/null +++ b/tests/periph_rtc/Kconfig @@ -0,0 +1,11 @@ +# Copyright (c) 2021 HAW Hamburg +# +# This file is subject to the terms and conditions of the GNU Lesser +# General Public License v2.1. See the file LICENSE in the top level +# directory for more details. +# + +config APPLICATION + bool + default y + imply MODULE_PERIPH_RTC_MEM diff --git a/tests/periph_rtc/Makefile b/tests/periph_rtc/Makefile index c717733c39..eef8bb11ac 100644 --- a/tests/periph_rtc/Makefile +++ b/tests/periph_rtc/Makefile @@ -8,4 +8,7 @@ DISABLE_MODULE += periph_init_rtc USEMODULE += xtimer +# avoid running Kconfig by default +SHOULD_RUN_KCONFIG ?= + include $(RIOTBASE)/Makefile.include diff --git a/tests/periph_rtt/Kconfig b/tests/periph_rtt/Kconfig index a2d35dbf35..7f55c6f9b9 100644 --- a/tests/periph_rtt/Kconfig +++ b/tests/periph_rtt/Kconfig @@ -9,4 +9,5 @@ config APPLICATION bool default y imply MODULE_PERIPH_RTT_SET_COUNTER + imply MODULE_PERIPH_RTC_MEM depends on TEST_KCONFIG diff --git a/tests/periph_rtt/Makefile b/tests/periph_rtt/Makefile index 75b7c29ac3..288072512b 100644 --- a/tests/periph_rtt/Makefile +++ b/tests/periph_rtt/Makefile @@ -7,6 +7,9 @@ FEATURES_OPTIONAL += periph_rtc_mem DISABLE_MODULE += periph_init_rtt +# avoid running Kconfig by default +SHOULD_RUN_KCONFIG ?= + include $(RIOTBASE)/Makefile.include # Put board specific dependencies here