1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #16483 from MrKevinWeiss/pr/kconfig/stm32

cpu/stm32f1: Add Kconfig dependency modeling
This commit is contained in:
Leandro Lanzieri 2021-07-02 16:39:16 +02:00 committed by GitHub
commit c52da5745f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 129 additions and 8 deletions

View File

@ -10,6 +10,7 @@
: ${TEST_KCONFIG_BOARDS_AVAILABLE:="
native
samr21-xpro
nucleo-f103rb
"}
: ${TEST_KCONFIG_ENFORCE_APP_GROUPS:="

View File

@ -67,9 +67,14 @@ ifeq ($(strip $(ASSMSRC))$(NO_AUTO_SRC),)
ASSMSRC := $(wildcard *.S)
endif
ifneq (,$(SRCXX))
ifeq (,$(filter cpp,$(FEATURES_USED)))
$(error Found C++ source, but feature "cpp" is not used. Add "FEATURES_REQUIRED += cpp")
ifeq (,$(filter cpp,$(USEMODULE)))
ifneq (1,$(TEST_KCONFIG))
$(error Found C++ source, but feature "cpp" is not used. Add "FEATURES_REQUIRED += cpp")
else
$(error Found C++ source, but "cpp" module is not used. Enable the MODULE_CPP in Kconfig)
endif
endif
endif

View File

@ -104,7 +104,13 @@ FEATURES_OPTIONAL += no_idle_thread
ifneq (,$(filter libstdcpp,$(FEATURES_USED)))
# Also use C++ if libstdc++ is used
FEATURES_REQUIRED += cpp
USEMODULE += cpp
USEMODULE += libstdcpp
endif
ifneq (,$(filter cpp,$(FEATURES_USED)))
# Also use C++ if libstdc++ is used
USEMODULE += cpp
endif
ifneq (,$(filter test_utils_interactive_sync,$(USEMODULE)))

View File

@ -623,7 +623,7 @@ else
endif
# variables used to compile and link c++
ifneq (,$(filter cpp,$(FEATURES_USED)))
ifneq (,$(filter cpp,$(USEMODULE)))
CPPMIX ?= 1
endif

View File

@ -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

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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

28
cpu/stm32/periph/Kconfig Normal file
View File

@ -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.

1
cpu/stm32/stm32.config Normal file
View File

@ -0,0 +1 @@
CONFIG_MODULE_PM_LAYERED=y

10
cpu/stm32/stmclk/Kconfig Normal file
View File

@ -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

10
cpu/stm32/vectors/Kconfig Normal file
View File

@ -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

View File

@ -20,6 +20,7 @@ PSEUDOMODULES += cord_ep_standalone
PSEUDOMODULES += core_%
PSEUDOMODULES += cortexm_fpu
PSEUDOMODULES += cortexm_svc
PSEUDOMODULES += cpp
PSEUDOMODULES += cpu_check_address
PSEUDOMODULES += dbgpin
PSEUDOMODULES += devfs_%
@ -75,6 +76,7 @@ PSEUDOMODULES += ieee802154_submac
PSEUDOMODULES += ina3221_alerts
PSEUDOMODULES += l2filter_blacklist
PSEUDOMODULES += l2filter_whitelist
PSEUDOMODULES += libstdcpp
PSEUDOMODULES += lis2dh12_i2c
PSEUDOMODULES += lis2dh12_int
PSEUDOMODULES += lis2dh12_spi

View File

@ -58,6 +58,18 @@ rsource "usb/Kconfig"
rsource "xtimer/Kconfig"
rsource "ztimer/Kconfig"
config MODULE_CPP
bool "Use CPP compiler"
depends on TEST_KCONFIG
depends on HAS_CPP
config MODULE_LIBSTDCPP
bool "Use the CPP standard library"
depends on TEST_KCONFIG
depends on HAS_LIBSTDCPP
depends on HAS_CPP
select MODULE_CPP
config MODULE_SYS
bool
default y

View File

@ -6,8 +6,7 @@ ifneq (,$(filter arduino,$(USEMODULE)))
FEATURES_REQUIRED += cpp
FEATURES_REQUIRED += periph_gpio
FEATURES_REQUIRED += periph_uart
SKETCH_MODULE ?= arduino_sketches
USEMODULE += $(SKETCH_MODULE)
USEMODULE += arduino_sketches
USEMODULE += fmt
USEMODULE += ztimer_usec
USEMODULE += ztimer_msec

View File

@ -5,14 +5,26 @@
# directory for more details.
#
config MODULE_ARDUINO_SKETCHES
bool
menuconfig MODULE_ARDUINO
bool "Arduino support"
imply MODULE_ARDUINO_PWM
imply MODULE_PERIPH_ADC
imply MODULE_PERIPH_I2C
imply MODULE_PERIPH_SPI
depends on HAS_ARDUINO
depends on HAS_PERIPH_GPIO
depends on HAS_CPP
depends on TEST_KCONFIG
select MODULE_PERIPH_GPIO
select MODULE_CPP
select MODULE_ARDUINO_SKETCHES
select MODULE_FMT
select MODULE_ZTIMER
select MODULE_ZTIMER_MSEC
select MODULE_ZTIMER_USEC
config MODULE_ARDUINO_PWM
bool "PWM support for Arduino"

View File

@ -1,6 +1,7 @@
# Add Arduino sketches to the application as a module
SKETCHES = $(wildcard $(APPDIR)/*.sketch)
SKETCH_MODULE = arduino_sketches
ifneq (,$(SKETCHES))
# Define application sketches module, it will be generated into $(BINDIR)

View File

@ -77,7 +77,7 @@ choice
default ZTIMER_SEC_BACKEND_RTC if !BOARD_NATIVE && \
!CPU_COMMON_SAM0 && \
!CPU_COMMON_EFM32 && \
!CPU_COMMON_STM32F1
!CPU_FAM_F1
default ZTIMER_SEC_BACKEND_RTT
config ZTIMER_SEC_BACKEND_TIMER

View File

@ -3,4 +3,3 @@
CONFIG_MODULE_PERIPH_GPIO=y
CONFIG_MODULE_SHELL=y
CONFIG_MODULE_ARDUINO=y
CONFIG_MODULE_XTIMER=y