diff --git a/boards/xg23-pk6068a/Makefile.dep b/boards/xg23-pk6068a/Makefile.dep index 01d21e337355..abc3287a7b3d 100644 --- a/boards/xg23-pk6068a/Makefile.dep +++ b/boards/xg23-pk6068a/Makefile.dep @@ -3,5 +3,7 @@ ifneq (,$(filter saul_default,$(USEMODULE))) endif ifneq (,$(filter ztimer_msec ztimer_sec,$(USEMODULE))) - USEMODULE += ztimer_periph_lptimer + ifeq (,$(filter ztimer_periph_timer,$(USEMODULE))) + USEMODULE += ztimer_periph_lptimer + endif endif diff --git a/examples/lorawan/Kconfig b/examples/lorawan/Kconfig new file mode 100644 index 000000000000..8a6ea6f49676 --- /dev/null +++ b/examples/lorawan/Kconfig @@ -0,0 +1,8 @@ +config APPLICATION + bool + default y + imply MODULE_PERIPH_RTC if TEST_KCONFIG + +choice ZTIMER_MSEC_BACKEND + default ZTIMER_MSEC_BACKEND_TIMER +endchoice diff --git a/examples/lorawan/Makefile b/examples/lorawan/Makefile index 4c4b2588b6fb..c84723617fa6 100644 --- a/examples/lorawan/Makefile +++ b/examples/lorawan/Makefile @@ -45,6 +45,9 @@ USEMODULE += auto_init_loramac USEMODULE += $(DRIVER) USEMODULE += fmt FEATURES_OPTIONAL += periph_rtc +# Needed to fix the backend o ztimer so the RTC is free +USEMODULE += ztimer_msec +USEMODULE += ztimer_periph_timer # Uncomment the following line to enable Loramac stack state persistence on EEPROM. # Make sure the EEPROM is erased before enabling this and when flashing a board @@ -80,6 +83,10 @@ ifneq (,$(filter test,$(MAKECMDGOALS))) DEFAULT_MODULE += test_utils_interactive_sync endif +# This application provides a 'Kconfig' file and we want to explicitly disable +# Kconfig by default by setting this variable to empty +SHOULD_RUN_KCONFIG ?= + include $(RIOTBASE)/Makefile.include ifndef CONFIG_KCONFIG_USEMODULE_LORAWAN diff --git a/examples/lorawan/app.config.test b/examples/lorawan/app.config.test new file mode 100644 index 000000000000..9b31cb1e31e3 --- /dev/null +++ b/examples/lorawan/app.config.test @@ -0,0 +1,10 @@ +CONFIG_PACKAGE_SEMTECH-LORAMAC=y +CONFIG_MODULE_SX1276=y +CONFIG_MODULE_SX127X=y +CONFIG_MODULE_PRNG_MUSL_LCG=y +CONFIG_MODULE_AUTO_INIT_LORAMAC=y +CONFIG_MODULE_FMT=y + +CONFIG_MODULE_ZTIMER_MSEC=y +CONFIG_MODULE_ZTIMER_PERIPH_TIMER=y +CONFIG_MODULE_ZTIMER=y diff --git a/pkg/semtech-loramac/Kconfig b/pkg/semtech-loramac/Kconfig index a26fbd556d8e..6fce76616e44 100644 --- a/pkg/semtech-loramac/Kconfig +++ b/pkg/semtech-loramac/Kconfig @@ -1,9 +1,43 @@ # Copyright (c) 2020 Freie Universitaet Berlin +# 2022 Inria # # 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 USEPKG_SEMTECH_LORAMAC +config PACKAGE_SEMTECH-LORAMAC + bool "Semtech Loramac-node package" + depends on TEST_KCONFIG + depends on !HAS_ARCH_MSP430 + + select MODULE_RANDOM + select MODULE_HASHES + select MODULE_CRYPTO_AES_128 + select MODULE_ZTIMER_MSEC + + select MODULE_SEMTECH_LORAMAC_CONTRIB + select MODULE_SEMTECH_LORAMAC_MAC + select MODULE_SEMTECH_LORAMAC_MAC_REGION + select MODULE_SEMTECH_LORAMAC_CRYPTO + select MODULE_SEMTECH_LORAMAC_ARCH + +config MODULE_SEMTECH_LORAMAC_CONTRIB + bool + +config MODULE_SEMTECH_LORAMAC_RX + bool + +config MODULE_SEMTECH_LORAMAC_CONTRIB + bool + +config MODULE_SEMTECH_LORAMAC_MAC + bool + +config MODULE_SEMTECH_LORAMAC_MAC_REGION + bool + +config MODULE_SEMTECH_LORAMAC_CRYPTO + bool + +config MODULE_SEMTECH_LORAMAC_ARCH bool - select HAVE_LORAWAN diff --git a/sys/auto_init/Kconfig b/sys/auto_init/Kconfig index b0a7cfb0c984..241397c65ad8 100644 --- a/sys/auto_init/Kconfig +++ b/sys/auto_init/Kconfig @@ -21,6 +21,7 @@ config AUTO_INIT_ENABLE_DEBUG bool "Print a debug message before a module is initialized" default n +rsource "loramac/Kconfig" rsource "screen/Kconfig" rsource "security/Kconfig" rsource "multimedia/Kconfig" diff --git a/sys/auto_init/loramac/Kconfig b/sys/auto_init/loramac/Kconfig new file mode 100644 index 000000000000..48a6bca4763b --- /dev/null +++ b/sys/auto_init/loramac/Kconfig @@ -0,0 +1,9 @@ +# Copyright (c) 2022 Inria +# +# 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 MODULE_AUTO_INIT_LORAMAC + bool "Loramac auto init module" diff --git a/sys/shell/cmds/Kconfig b/sys/shell/cmds/Kconfig index 794bca53d0e0..6d15d5a67732 100644 --- a/sys/shell/cmds/Kconfig +++ b/sys/shell/cmds/Kconfig @@ -273,7 +273,7 @@ config MODULE_SHELL_CMD_SEMTECH-LORAMAC bool "Command to control the Semtech LoRaMAC stack" default y if MODULE_SHELL_CMDS_DEFAULT depends on MODULE_SHELL_CMDS - depends on MODULE_SEMTECH-LORAMAC + depends on PACKAGE_SEMTECH-LORAMAC config MODULE_SHELL_CMD_SHA1SUM bool "Command to compute the SHA1 sum of a file" diff --git a/sys/ztimer/Kconfig b/sys/ztimer/Kconfig index b9b56d422dd5..277a502191f9 100644 --- a/sys/ztimer/Kconfig +++ b/sys/ztimer/Kconfig @@ -60,6 +60,10 @@ config ZTIMER_USEC select MODULE_ZTIMER_USEC select MODULE_ZTIMER_PERIPH_TIMER select MODULE_ZTIMER + select PREFER_ZTIMER_PERIPH_TIMER + +config PREFER_ZTIMER_PERIPH_TIMER + bool config MODULE_ZTIMER_USEC bool @@ -71,6 +75,7 @@ config MODULE_ZTIMER_MSEC choice ZTIMER_MSEC_BACKEND bool "Backend" depends on MODULE_ZTIMER_MSEC + default ZTIMER_MSEC_BACKEND_TIMER if PREFER_ZTIMER_PERIPH_TIMER default ZTIMER_MSEC_BACKEND_LPTIMER if HAVE_ZTIMER_PERIPH_LPTIMER default ZTIMER_MSEC_BACKEND_RTT if !MODULE_ZTIMER_NO_PERIPH_RTT default ZTIMER_MSEC_BACKEND_TIMER @@ -98,6 +103,7 @@ config MODULE_ZTIMER_SEC choice bool "Backend" depends on MODULE_ZTIMER_SEC + default ZTIMER_SEC_BACKEND_TIMER if PREFER_ZTIMER_PERIPH_TIMER default ZTIMER_SEC_BACKEND_LPTIMER if HAVE_ZTIMER_PERIPH_LPTIMER default ZTIMER_SEC_BACKEND_RTT if !MODULE_ZTIMER_NO_PERIPH_RTT default ZTIMER_SEC_BACKEND_TIMER diff --git a/sys/ztimer/Makefile.dep b/sys/ztimer/Makefile.dep index eec51b70b024..ae7daa3f13ff 100644 --- a/sys/ztimer/Makefile.dep +++ b/sys/ztimer/Makefile.dep @@ -87,7 +87,7 @@ endif ifneq (,$(filter ztimer_msec ztimer_sec,$(USEMODULE))) USEMODULE += ztimer - ifeq (,$(filter ztimer_no_periph_rtt,$(USEMODULE))) + ifeq (,$(filter ztimer_no_periph_rtt ztimer_periph_timer,$(USEMODULE))) FEATURES_OPTIONAL += periph_rtt # HACK: periph_rtt will get used only in the next iteration but an updated # state for FEATURES_USED is needed here so include `features_check.inc.mk` diff --git a/tests/drivers/io1_xplained/Makefile b/tests/drivers/io1_xplained/Makefile index 5f91154c3a56..dcbb6c54ecc5 100644 --- a/tests/drivers/io1_xplained/Makefile +++ b/tests/drivers/io1_xplained/Makefile @@ -2,5 +2,7 @@ include ../Makefile.drivers_common USEMODULE += io1_xplained USEMODULE += ztimer_msec +# Hack to prevent some boards from bring in rtt and periph_timer backend +USEMODULE += ztimer_periph_timer include $(RIOTBASE)/Makefile.include diff --git a/tests/pkg/semtech-loramac/Kconfig b/tests/pkg/semtech-loramac/Kconfig new file mode 100644 index 000000000000..e71eaed5dab4 --- /dev/null +++ b/tests/pkg/semtech-loramac/Kconfig @@ -0,0 +1,11 @@ +config APPLICATION + bool + default y + depends on TEST_KCONFIG + imply MODULE_SEMTECH_LORAMAC_RX if !BOARD_HAS_NOT_ENOUGH_MEMORY + select MODULE_PERIPH_EEPROM if HAS_PERIPH_EEPROM + +config BOARD_HAS_NOT_ENOUGH_MEMORY + bool + default y + depends on BOARD_ARDUINO-MEGA2560 || BOARD_I-NUCLEO-LRWAN1 || BOARD_STM32F0DISCOVERY || BOARD_WASPMOTE-PRO diff --git a/tests/pkg/semtech-loramac/Makefile b/tests/pkg/semtech-loramac/Makefile index 2720aad90c6e..4f69966898a0 100644 --- a/tests/pkg/semtech-loramac/Makefile +++ b/tests/pkg/semtech-loramac/Makefile @@ -7,6 +7,7 @@ BOARD_WITHOUT_LORAMAC_RX := \ i-nucleo-lrwan1 \ stm32f0discovery \ waspmote-pro \ + # LORA_DRIVER ?= sx1276 LORA_REGION ?= EU868 @@ -33,4 +34,8 @@ ifneq (,$(filter iotlab%,$(MAKECMDGOALS))) include $(RIOTBASE)/dist/testbed-support/Makefile.iotlab endif +# This application provides a 'Kconfig' file and we want to explicitly disable +# Kconfig by default by setting this variable to empty +SHOULD_RUN_KCONFIG ?= + include $(RIOTBASE)/Makefile.include diff --git a/tests/pkg/semtech-loramac/app.config.test b/tests/pkg/semtech-loramac/app.config.test new file mode 100644 index 000000000000..8cea0160f808 --- /dev/null +++ b/tests/pkg/semtech-loramac/app.config.test @@ -0,0 +1,8 @@ +CONFIG_PACKAGE_SEMTECH-LORAMAC=y +CONFIG_MODULE_SX1276=y +CONFIG_MODULE_SX127X=y +CONFIG_MODULE_PRNG_MUSL_LCG=y +CONFIG_MODULE_AUTO_INIT_LORAMAC=y +CONFIG_MODULE_SHELL=y +CONFIG_MODULE_SHELL_CMDS_DEFAULT=y +CONFIG_MODULE_FMT=y diff --git a/tests/sys/fido2_ctap/Makefile b/tests/sys/fido2_ctap/Makefile index d83c0476c0d2..028aba9560ee 100644 --- a/tests/sys/fido2_ctap/Makefile +++ b/tests/sys/fido2_ctap/Makefile @@ -5,6 +5,8 @@ include ../Makefile.sys_common USEMODULE += fido2_ctap_transport_hid USEMODULE += usbus +# Hack to make the ztimer backend selection more deterministic +USEMODULE += ztimer_periph_timer USEPKG += fido2_tests USB_VID ?= $(USB_VID_TESTING)