diff --git a/boards/common/nucleo/Kconfig b/boards/common/nucleo/Kconfig new file mode 100644 index 0000000000..62dc8f8f61 --- /dev/null +++ b/boards/common/nucleo/Kconfig @@ -0,0 +1,17 @@ +# 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. +# + +if TEST_KCONFIG + +config MODULE_BOARDS_COMMON_NUCLEO + bool + default y + select MODULE_SAUL_GPIO if MODULE_SAUL_DEFAULT && HAS_PERIPH_GPIO + help + stm32 common nucleo code. + +endif # TEST_KCONFIG diff --git a/boards/common/nucleo144/Kconfig b/boards/common/nucleo144/Kconfig index b6ef23e689..ead4e3fe18 100644 --- a/boards/common/nucleo144/Kconfig +++ b/boards/common/nucleo144/Kconfig @@ -13,4 +13,5 @@ config BOARD_COMMON_NUCLEO144 select BOARD_HAS_HSE if !CPU_FAM_L4 && !CPU_FAM_L5 select BOARD_HAS_LSE +source "$(RIOTBOARD)/common/nucleo/Kconfig" source "$(RIOTBOARD)/common/stm32/Kconfig" diff --git a/boards/common/nucleo32/Kconfig b/boards/common/nucleo32/Kconfig index 0d05550a33..bebcefa25e 100644 --- a/boards/common/nucleo32/Kconfig +++ b/boards/common/nucleo32/Kconfig @@ -12,4 +12,5 @@ config BOARD_COMMON_NUCLEO32 # Clock configuration select BOARD_HAS_LSE if (CPU_FAM_L0 || CPU_FAM_L4) && !BOARD_NUCLEO_L011K4 +source "$(RIOTBOARD)/common/nucleo/Kconfig" source "$(RIOTBOARD)/common/stm32/Kconfig" diff --git a/boards/common/nucleo64/Kconfig b/boards/common/nucleo64/Kconfig index 705fd28cd1..a718be7db0 100644 --- a/boards/common/nucleo64/Kconfig +++ b/boards/common/nucleo64/Kconfig @@ -13,4 +13,5 @@ config BOARD_COMMON_NUCLEO64 select BOARD_HAS_HSE if !CPU_FAM_G0 && !CPU_FAM_L0 && !CPU_FAM_L1 && !CPU_FAM_L4 select BOARD_HAS_LSE if !BOARD_NUCLE0_L152RE +source "$(RIOTBOARD)/common/nucleo/Kconfig" source "$(RIOTBOARD)/common/stm32/Kconfig" diff --git a/cpu/stm32/Kconfig b/cpu/stm32/Kconfig index 16572c18dc..8ab8c6e5f1 100644 --- a/cpu/stm32/Kconfig +++ b/cpu/stm32/Kconfig @@ -36,4 +36,12 @@ orsource "kconfigs/*/Kconfig" orsource "kconfigs/*/Kconfig.lines" orsource "kconfigs/*/Kconfig.models" +if TEST_KCONFIG + +rsource "periph/Kconfig" +rsource "stmclk/Kconfig" +rsource "vectors/Kconfig" + +endif # TEST_KCONFIG + source "$(RIOTCPU)/cortexm_common/Kconfig" diff --git a/cpu/stm32/Makefile.features b/cpu/stm32/Makefile.features index bcb562bec4..030649304f 100644 --- a/cpu/stm32/Makefile.features +++ b/cpu/stm32/Makefile.features @@ -51,4 +51,11 @@ ifneq (,$(filter $(CPU_MODEL),$(STM32_WITH_MPU))) FEATURES_PROVIDED += cortexm_mpu endif +# Add stm32 configs after including cortexm_common so stm32 takes precendence +# This configuration enables modules that are only available when using Kconfig +# module modelling +ifeq (1, $(TEST_KCONFIG)) + KCONFIG_ADD_CONFIG += $(RIOTCPU)/stm32/stm32.config +endif + include $(RIOTCPU)/cortexm_common/Makefile.features diff --git a/cpu/stm32/periph/Kconfig b/cpu/stm32/periph/Kconfig new file mode 100644 index 0000000000..24c613286f --- /dev/null +++ b/cpu/stm32/periph/Kconfig @@ -0,0 +1,28 @@ +# 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 MODULE_PERIPH + bool + default y + select MODULE_XTIMER if MODULE_PERIPH_USBDEV + help + stm32 common peripheral code. + +config MODULE_PERIPH_UART_NONBLOCKING + depends on HAS_PERIPH_UART_NONBLOCKING + depends on MODULE_PERIPH_UART + select MODULE_TSRB + +config MODULE_PERIPH_CAN + bool + depends on HAS_PERIPH_CAN + depends on HAS_PERIPH_GPIO + depends on HAS_PERIPH_GPIO_IRQ + select MODULE_PERIPH_GPIO_IRQ + select MODULE_PERIPH_I2C + help + STM32 CAN peripheral controller. diff --git a/cpu/stm32/stm32.config b/cpu/stm32/stm32.config new file mode 100644 index 0000000000..811b1f3712 --- /dev/null +++ b/cpu/stm32/stm32.config @@ -0,0 +1 @@ +CONFIG_MODULE_PM_LAYERED=y diff --git a/cpu/stm32/stmclk/Kconfig b/cpu/stm32/stmclk/Kconfig new file mode 100644 index 0000000000..846db93c84 --- /dev/null +++ b/cpu/stm32/stmclk/Kconfig @@ -0,0 +1,10 @@ +# 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 MODULE_STM32_CLK + bool + default y diff --git a/cpu/stm32/vectors/Kconfig b/cpu/stm32/vectors/Kconfig new file mode 100644 index 0000000000..93c7ab1081 --- /dev/null +++ b/cpu/stm32/vectors/Kconfig @@ -0,0 +1,10 @@ +# 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 MODULE_STM32_VECTORS + bool + default y