From 252c3886b0b73de3ea8365780c95d83f05e52182 Mon Sep 17 00:00:00 2001 From: Leandro Lanzieri Date: Wed, 17 Nov 2021 13:41:32 +0100 Subject: [PATCH 01/22] cpu/esp32: do not expand USEMODULE --- boards/esp32-wemos-lolin-d32-pro/Makefile.default | 1 + boards/esp32-wemos-lolin-d32-pro/Makefile.dep | 2 -- cpu/esp32/Makefile.dep | 4 ---- 3 files changed, 1 insertion(+), 6 deletions(-) create mode 100644 boards/esp32-wemos-lolin-d32-pro/Makefile.default diff --git a/boards/esp32-wemos-lolin-d32-pro/Makefile.default b/boards/esp32-wemos-lolin-d32-pro/Makefile.default new file mode 100644 index 000000000000..1881d1e31740 --- /dev/null +++ b/boards/esp32-wemos-lolin-d32-pro/Makefile.default @@ -0,0 +1 @@ +DEFAULT_MODULE += esp_spi_ram diff --git a/boards/esp32-wemos-lolin-d32-pro/Makefile.dep b/boards/esp32-wemos-lolin-d32-pro/Makefile.dep index 8953d3dac0c1..29d6c99ba8ee 100644 --- a/boards/esp32-wemos-lolin-d32-pro/Makefile.dep +++ b/boards/esp32-wemos-lolin-d32-pro/Makefile.dep @@ -1,3 +1 @@ -USEMODULE += esp_spi_ram - include $(RIOTBOARD)/common/esp32/Makefile.dep diff --git a/cpu/esp32/Makefile.dep b/cpu/esp32/Makefile.dep index 0c1ee1aed376..8b119dd56bef 100644 --- a/cpu/esp32/Makefile.dep +++ b/cpu/esp32/Makefile.dep @@ -66,10 +66,6 @@ ifneq (,$(filter periph_i2c,$(USEMODULE))) endif endif -ifneq (,$(filter esp_spi_ram,$(DISABLE_MODULE))) - USEMODULE := $(filter-out esp_spi_ram,$(USEMODULE)) -endif - ifneq (,$(filter esp_now esp_wifi esp_spi_ram,$(USEMODULE))) # the ESP-IDF heap has to be used if SPI RAM is used USEMODULE += esp_idf_heap From 59d3f0bcc69fceb6f2e4462b3001670f369b4a3d Mon Sep 17 00:00:00 2001 From: Leandro Lanzieri Date: Wed, 17 Nov 2021 17:55:51 +0100 Subject: [PATCH 02/22] cpu/esp32: remove unneeded crypto dependencies --- cpu/esp32/Makefile.dep | 5 ----- 1 file changed, 5 deletions(-) diff --git a/cpu/esp32/Makefile.dep b/cpu/esp32/Makefile.dep index 8b119dd56bef..256d0f35e3c0 100644 --- a/cpu/esp32/Makefile.dep +++ b/cpu/esp32/Makefile.dep @@ -75,11 +75,6 @@ ifneq (,$(filter mtd,$(USEMODULE))) USEMODULE += esp_idf_spi_flash endif -ifneq (,$(filter ndn-riot,$(USEPKG))) - USEMODULE += crypto - USEMODULE += cipher_modes -endif - ifneq (,$(filter periph_rtc,$(USEMODULE))) USEMODULE += rtt_rtc endif From aec9d7a8e54bca943015dfb8067076d7a187d4ac Mon Sep 17 00:00:00 2001 From: Leandro Lanzieri Date: Thu, 18 Nov 2021 14:51:34 +0100 Subject: [PATCH 03/22] makefiles/features_modules: do not generate init for ESP RTT This avoids the generation of the unneeded modules periph_init_rtt_hw_rtc and periph_init_rtt_hw_sys. --- makefiles/features_modules.inc.mk | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/makefiles/features_modules.inc.mk b/makefiles/features_modules.inc.mk index 14b0c72705d3..127fd82732ed 100644 --- a/makefiles/features_modules.inc.mk +++ b/makefiles/features_modules.inc.mk @@ -16,10 +16,15 @@ ifneq (,$(filter periph_init, $(USEMODULE))) periph_common \ periph_flexcomm \ periph_gpio_mux \ + periph_i2c_hw \ + periph_i2c_sw \ periph_rtc_ms \ periph_mcg \ periph_wdog \ + periph_flash \ periph_rtc_rtt \ + periph_rtt_hw_rtc \ + periph_rtt_hw_sys \ periph_clic \ periph_coretimer \ periph_plic \ From e8c00d2b1c988ee42d1005ee37a394e7295b6ba2 Mon Sep 17 00:00:00 2001 From: Leandro Lanzieri Date: Thu, 18 Nov 2021 15:40:45 +0100 Subject: [PATCH 04/22] pkg/esp8266_sdk: add Kconfig --- pkg/Kconfig | 1 + pkg/esp8266_sdk/Kconfig | 11 +++++++++++ 2 files changed, 12 insertions(+) create mode 100644 pkg/esp8266_sdk/Kconfig diff --git a/pkg/Kconfig b/pkg/Kconfig index f1df46303a7e..ece75a55255b 100644 --- a/pkg/Kconfig +++ b/pkg/Kconfig @@ -17,6 +17,7 @@ rsource "driver_bme680/Kconfig" rsource "driver_sx126x/Kconfig" rsource "elk/Kconfig" rsource "emlearn/Kconfig" +rsource "esp8266_sdk/Kconfig" rsource "fff/Kconfig" rsource "gecko_sdk/Kconfig" rsource "gemmlowp/Kconfig" diff --git a/pkg/esp8266_sdk/Kconfig b/pkg/esp8266_sdk/Kconfig new file mode 100644 index 000000000000..c813f196662e --- /dev/null +++ b/pkg/esp8266_sdk/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 PACKAGE_ESP8266_SDK + bool "Vendor library for the ESP8266 MCU RTOS support" + depends on TEST_KCONFIG + depends on HAS_ARCH_ESP8266 From 831101eea5830107d8388669c613e3020582eff7 Mon Sep 17 00:00:00 2001 From: Leandro Lanzieri Date: Thu, 18 Nov 2021 17:14:33 +0100 Subject: [PATCH 05/22] cpu/esp_common/periph_flash: fix dependency --- cpu/esp_common/Makefile.dep | 5 ++++- cpu/esp_common/periph/flash.c | 4 ---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/cpu/esp_common/Makefile.dep b/cpu/esp_common/Makefile.dep index 03b82fead0fc..4ac30362bd95 100644 --- a/cpu/esp_common/Makefile.dep +++ b/cpu/esp_common/Makefile.dep @@ -9,10 +9,13 @@ USEMODULE += esp_idf USEMODULE += log USEMODULE += periph USEMODULE += periph_hwrng -USEMODULE += periph_flash USEMODULE += periph_uart USEMODULE += random +ifneq (,$(filter mtd,$(USEMODULE))) + USEMODULE += periph_flash +endif + ifeq (,$(filter stdio_% slipdev_stdio,$(USEMODULE))) USEMODULE += stdio_uart endif diff --git a/cpu/esp_common/periph/flash.c b/cpu/esp_common/periph/flash.c index 7770851ee2e2..e810279b2f67 100644 --- a/cpu/esp_common/periph/flash.c +++ b/cpu/esp_common/periph/flash.c @@ -18,8 +18,6 @@ * @} */ -#if MODULE_MTD - #include #include #include @@ -568,5 +566,3 @@ static int _flash_power (mtd_dev_t *dev, enum mtd_power_state power) return -ENOTSUP; } - -#endif /* MODULE_MTD */ From 7a8f58ac4c0e8f6ac257fd2e9ef2b65bdf474e5a Mon Sep 17 00:00:00 2001 From: Leandro Lanzieri Date: Thu, 18 Nov 2021 17:15:34 +0100 Subject: [PATCH 06/22] cpu/esp_common: model Kconfig --- cpu/esp_common/Kconfig | 44 ++++++++++++++++++++++++++++ cpu/esp_common/Makefile.features | 6 ++++ cpu/esp_common/esp_common.config | 11 +++++++ cpu/esp_common/freertos/Kconfig | 20 +++++++++++++ cpu/esp_common/periph/Kconfig | 20 +++++++++++++ cpu/esp_common/vendor/xtensa/Kconfig | 15 ++++++++++ 6 files changed, 116 insertions(+) create mode 100644 cpu/esp_common/esp_common.config create mode 100644 cpu/esp_common/freertos/Kconfig create mode 100644 cpu/esp_common/periph/Kconfig create mode 100644 cpu/esp_common/vendor/xtensa/Kconfig diff --git a/cpu/esp_common/Kconfig b/cpu/esp_common/Kconfig index b0dc7df141c9..3359c8644cf7 100644 --- a/cpu/esp_common/Kconfig +++ b/cpu/esp_common/Kconfig @@ -59,3 +59,47 @@ config HAS_ARCH_ESP ## Common CPU symbols config CPU_ARCH default "xtensa" if CPU_ARCH_XTENSA + +config MODULE_ESP_COMMON + bool + depends on TEST_KCONFIG + depends on CPU_COMMON_ESP + default y + select MODULE_LOG # override default log implementation by default + select MODULE_PERIPH + select MODULE_ESP_IDF + help + Common code module for ESP SoCs. + +config MODULE_PERIPH_FLASH + bool + depends on TEST_KCONFIG + depends on CPU_COMMON_ESP + default y if MODULE_MTD + help + Low-level MTD flash driver implementation for ESP SoCs. + +if TEST_KCONFIG + +menu "ESP configurations" + +config MODULE_ESP_LOG_COLORED + bool + default y if MODULE_LOG_COLOR + +config MODULE_ESP_LOG_TAGGED + bool "Add additional information to the log output" + help + Adds the type of the message, the system time in ms and a tag (module + or function) to the output. + +config MODULE_ESP_LOG_STARTUP + bool "Add additional startup information to the log output" + +endmenu + +endif # TEST_KCONFIG + +rsource "freertos/Kconfig" +rsource "periph/Kconfig" +rsource "vendor/xtensa/Kconfig" diff --git a/cpu/esp_common/Makefile.features b/cpu/esp_common/Makefile.features index efb55a6e1062..9e1858dc8782 100644 --- a/cpu/esp_common/Makefile.features +++ b/cpu/esp_common/Makefile.features @@ -19,3 +19,9 @@ FEATURES_PROVIDED += ssp FEATURES_CONFLICT += esp_wifi_ap:esp_now FEATURES_CONFLICT_MSG += "ESP_NOW and ESP_WIFI_AP can not be used at the same time." + +# This configuration enables modules that are only available when using Kconfig +# module modelling +ifeq (1, $(TEST_KCONFIG)) + KCONFIG_ADD_CONFIG += $(RIOTCPU)/esp_common/esp_common.config +endif diff --git a/cpu/esp_common/esp_common.config b/cpu/esp_common/esp_common.config new file mode 100644 index 000000000000..1914c406e8d2 --- /dev/null +++ b/cpu/esp_common/esp_common.config @@ -0,0 +1,11 @@ +CONFIG_MODULE_RANDOM=y +# Should be autoselecting the MODULE_PRNG_HWRNG if possible +# Since the makefile cannot we have to override until end of migration +# Remove when TEST_KCONFIG is complete +CONFIG_MODULE_PRNG_MUSL_LCG=y +CONFIG_MODULE_PERIPH_HWRNG=y +CONFIG_MODULE_PERIPH_UART=y +CONFIG_MODULE_NEWLIB=y + +# Vendor code uses C++ +CONFIG_MODULE_CPP=y diff --git a/cpu/esp_common/freertos/Kconfig b/cpu/esp_common/freertos/Kconfig new file mode 100644 index 000000000000..fabedae262ce --- /dev/null +++ b/cpu/esp_common/freertos/Kconfig @@ -0,0 +1,20 @@ +# 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 && HAS_ARCH_ESP + +config MODULE_ESP_FREERTOS + bool + default y + help + FreeRTOS to RIOT-OS adaption module for ESP SoCs source code compatibility. + +config MODULE_ESP_FREERTOS_COMMON + bool + default MODULE_ESP_FREERTOS + +endif # TEST_KCONFIG && HAS_ARCH_ESP diff --git a/cpu/esp_common/periph/Kconfig b/cpu/esp_common/periph/Kconfig new file mode 100644 index 000000000000..5b9cd63d11d7 --- /dev/null +++ b/cpu/esp_common/periph/Kconfig @@ -0,0 +1,20 @@ +# 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_ESP_COMMON_PERIPH + bool + depends on HAS_ARCH_ESP + default y + +config MODULE_PERIPH_I2C_SW + bool + help + Software implementation of I2C. + +endif # TEST_KCONFIG diff --git a/cpu/esp_common/vendor/xtensa/Kconfig b/cpu/esp_common/vendor/xtensa/Kconfig new file mode 100644 index 000000000000..0234d0fc3383 --- /dev/null +++ b/cpu/esp_common/vendor/xtensa/Kconfig @@ -0,0 +1,15 @@ +# 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_XTENSA + bool + depends on TEST_KCONFIG + depends on HAS_ARCH_ESP + default y + help + Third-party software components used by the RIOT port for ESP32 and + ESP8266. From bfdfbb1a4891bfbeb4f03fad505f46baf0c658f7 Mon Sep 17 00:00:00 2001 From: Leandro Lanzieri Date: Thu, 18 Nov 2021 17:17:04 +0100 Subject: [PATCH 07/22] cpu/esp32: model Kconfig --- boards/esp32-ethernet-kit-v1_0/Kconfig | 1 - boards/esp32-ethernet-kit-v1_1/Kconfig | 1 - boards/esp32-ethernet-kit-v1_2/Kconfig | 1 - boards/esp32-wemos-lolin-d32-pro/Kconfig | 1 - boards/esp32-wrover-kit/Kconfig | 2 +- cpu/esp32/Kconfig | 36 +++++++++++++++++++ cpu/esp32/Makefile.features | 6 ++++ cpu/esp32/esp32.config | 1 + cpu/esp32/periph/Kconfig | 30 ++++++++++++++++ cpu/esp32/periph/Kconfig.i2c | 34 ++++++++++++++++++ cpu/esp32/vendor/esp-idf/Kconfig | 26 ++++++++++++++ cpu/esp32/vendor/esp-idf/driver/Kconfig | 11 ++++++ cpu/esp32/vendor/esp-idf/esp32/Kconfig | 11 ++++++ cpu/esp32/vendor/esp-idf/ethernet/Kconfig | 13 +++++++ .../vendor/esp-idf/ethernet/eth_phy/Kconfig | 11 ++++++ cpu/esp32/vendor/esp-idf/heap/Kconfig | 11 ++++++ cpu/esp32/vendor/esp-idf/nvs_flash/Kconfig | 14 ++++++++ cpu/esp32/vendor/esp-idf/soc/Kconfig | 11 ++++++ cpu/esp32/vendor/esp-idf/spi_flash/Kconfig | 12 +++++++ .../vendor/esp-idf/wpa_supplicant/Kconfig | 10 ++++++ .../esp-idf/wpa_supplicant/port/Kconfig | 13 +++++++ .../esp-idf/wpa_supplicant/src/crypto/Kconfig | 12 +++++++ .../esp-idf/wpa_supplicant/src/wpa2/Kconfig | 10 ++++++ .../wpa_supplicant/src/wpa2/eap_peer/Kconfig | 11 ++++++ .../wpa_supplicant/src/wpa2/tls/Kconfig | 11 ++++++ .../wpa_supplicant/src/wpa2/utils/Kconfig | 11 ++++++ drivers/aip31068/Kconfig | 3 -- drivers/periph_common/Kconfig.i2c | 2 ++ 28 files changed, 308 insertions(+), 8 deletions(-) create mode 100644 cpu/esp32/esp32.config create mode 100644 cpu/esp32/periph/Kconfig create mode 100644 cpu/esp32/periph/Kconfig.i2c create mode 100644 cpu/esp32/vendor/esp-idf/Kconfig create mode 100644 cpu/esp32/vendor/esp-idf/driver/Kconfig create mode 100644 cpu/esp32/vendor/esp-idf/esp32/Kconfig create mode 100644 cpu/esp32/vendor/esp-idf/ethernet/Kconfig create mode 100644 cpu/esp32/vendor/esp-idf/ethernet/eth_phy/Kconfig create mode 100644 cpu/esp32/vendor/esp-idf/heap/Kconfig create mode 100644 cpu/esp32/vendor/esp-idf/nvs_flash/Kconfig create mode 100644 cpu/esp32/vendor/esp-idf/soc/Kconfig create mode 100644 cpu/esp32/vendor/esp-idf/spi_flash/Kconfig create mode 100644 cpu/esp32/vendor/esp-idf/wpa_supplicant/Kconfig create mode 100644 cpu/esp32/vendor/esp-idf/wpa_supplicant/port/Kconfig create mode 100644 cpu/esp32/vendor/esp-idf/wpa_supplicant/src/crypto/Kconfig create mode 100644 cpu/esp32/vendor/esp-idf/wpa_supplicant/src/wpa2/Kconfig create mode 100644 cpu/esp32/vendor/esp-idf/wpa_supplicant/src/wpa2/eap_peer/Kconfig create mode 100644 cpu/esp32/vendor/esp-idf/wpa_supplicant/src/wpa2/tls/Kconfig create mode 100644 cpu/esp32/vendor/esp-idf/wpa_supplicant/src/wpa2/utils/Kconfig diff --git a/boards/esp32-ethernet-kit-v1_0/Kconfig b/boards/esp32-ethernet-kit-v1_0/Kconfig index 37e631c4b286..2fa10fd8bf64 100644 --- a/boards/esp32-ethernet-kit-v1_0/Kconfig +++ b/boards/esp32-ethernet-kit-v1_0/Kconfig @@ -13,7 +13,6 @@ config BOARD_ESP32_ETHERNET_KIT_V1_0 default y select BOARD_COMMON_ESP32 select CPU_MODEL_ESP32_WROVER_B - select HAS_ESP_SPI_RAM select HAS_ESP_JTAG select HAS_PERIPH_ADC select HAS_PERIPH_ETH diff --git a/boards/esp32-ethernet-kit-v1_1/Kconfig b/boards/esp32-ethernet-kit-v1_1/Kconfig index 4c8f8c5bd2b5..ac1190ce3d7a 100644 --- a/boards/esp32-ethernet-kit-v1_1/Kconfig +++ b/boards/esp32-ethernet-kit-v1_1/Kconfig @@ -13,7 +13,6 @@ config BOARD_ESP32_ETHERNET_KIT_V1_1 default y select BOARD_COMMON_ESP32 select CPU_MODEL_ESP32_WROVER_B - select HAS_ESP_SPI_RAM select HAS_ESP_JTAG select HAS_PERIPH_ADC select HAS_PERIPH_ETH diff --git a/boards/esp32-ethernet-kit-v1_2/Kconfig b/boards/esp32-ethernet-kit-v1_2/Kconfig index b7b8124e0e54..2814c5282f78 100644 --- a/boards/esp32-ethernet-kit-v1_2/Kconfig +++ b/boards/esp32-ethernet-kit-v1_2/Kconfig @@ -13,7 +13,6 @@ config BOARD_ESP32_ETHERNET_KIT_V1_2 default y select BOARD_COMMON_ESP32 select CPU_MODEL_ESP32_WROVER_E - select HAS_ESP_SPI_RAM select HAS_ESP_JTAG select HAS_PERIPH_ADC select HAS_PERIPH_ETH diff --git a/boards/esp32-wemos-lolin-d32-pro/Kconfig b/boards/esp32-wemos-lolin-d32-pro/Kconfig index f06706864ac1..d7d2e464379a 100644 --- a/boards/esp32-wemos-lolin-d32-pro/Kconfig +++ b/boards/esp32-wemos-lolin-d32-pro/Kconfig @@ -13,7 +13,6 @@ config BOARD_ESP32_WEMOS_LOLIN_D32_PRO select BOARD_COMMON_ESP32 select CPU_MODEL_ESP32_WROVER select HAS_ARDUINO - select HAS_ESP_SPI_RAM select HAS_PERIPH_ADC select HAS_PERIPH_DAC select HAS_PERIPH_I2C diff --git a/boards/esp32-wrover-kit/Kconfig b/boards/esp32-wrover-kit/Kconfig index 2bde4ba5415f..26b38810756d 100644 --- a/boards/esp32-wrover-kit/Kconfig +++ b/boards/esp32-wrover-kit/Kconfig @@ -14,7 +14,7 @@ config BOARD_ESP32_WROVER_KIT select CPU_MODEL_ESP32_WROVER select HAS_ARDUINO select HAS_ESP_RTC_TIMER_32K - select HAS_ESP_SPI_RAM + select HAS_ESP_JTAG select HAS_PERIPH_ADC select HAS_PERIPH_I2C select HAS_PERIPH_PWM diff --git a/cpu/esp32/Kconfig b/cpu/esp32/Kconfig index 0ad815e2a0bd..0b9a91a7bc6c 100644 --- a/cpu/esp32/Kconfig +++ b/cpu/esp32/Kconfig @@ -21,6 +21,14 @@ config CPU_FAM_ESP32 select HAS_PERIPH_RTT_SET_COUNTER select HAS_PERIPH_RTT_OVERFLOW + select MODULE_PERIPH_RTT if HAS_PERIPH_RTT && MODULE_PM_LAYERED + select MODULE_RTT_RTC if HAS_PERIPH_RTT && MODULE_PERIPH_RTC + select MODULE_PS if MODULE_SHELL + select MODULE_ESP_IDF_DRIVER if TEST_KCONFIG + select MODULE_ESP_IDF_ESP32 if TEST_KCONFIG + select MODULE_ESP_IDF_SOC if TEST_KCONFIG + imply MODULE_NEWLIB_NANO + ## CPU Models config CPU_MODEL_ESP32_WROOM_32 bool @@ -29,14 +37,17 @@ config CPU_MODEL_ESP32_WROOM_32 config CPU_MODEL_ESP32_WROVER bool select CPU_FAM_ESP32 + select HAS_ESP_SPI_RAM config CPU_MODEL_ESP32_WROVER_B bool select CPU_FAM_ESP32 + select HAS_ESP_SPI_RAM config CPU_MODEL_ESP32_WROVER_E bool select CPU_FAM_ESP32 + select HAS_ESP_SPI_RAM config CPU_MODEL_ESP32_D0WD bool @@ -76,6 +87,11 @@ config HAS_PERIPH_ADC_CTRL help Indicates that an ESP32 ADC controller peripheral is present. +config HAS_ESP_SPI_RAM + bool + help + Indicates that the a RAM is present on the SPI bus. + ## Common CPU symbols config CPU_CORE default "xtensa-lx6" if CPU_CORE_XTENSA_LX6 @@ -93,4 +109,24 @@ config CPU_MODEL config CPU default "esp32" if CPU_FAM_ESP32 +menu "ESP32 configurations" + depends on TEST_KCONFIG + depends on HAS_ARCH_ESP32 + +config MODULE_ESP_SPI_RAM + bool "SPI RAM support" + select MODULE_ESP_IDF_HEAP + depends on HAS_ESP_SPI_RAM + select MODULE_ESP_IDF_HEAP + help + Say y to use external SPI RAM connected through the FSPI interface. + +config MODULE_ESP_JTAG + bool "Enable JTAG debugging interface" + depends on HAS_ESP_JTAG + +endmenu + +rsource "periph/Kconfig" +rsource "vendor/esp-idf/Kconfig" source "$(RIOTCPU)/esp_common/Kconfig" diff --git a/cpu/esp32/Makefile.features b/cpu/esp32/Makefile.features index a2b3f037b321..d176c596e0cc 100644 --- a/cpu/esp32/Makefile.features +++ b/cpu/esp32/Makefile.features @@ -11,3 +11,9 @@ FEATURES_PROVIDED += periph_rtc FEATURES_PROVIDED += periph_rtt FEATURES_PROVIDED += periph_rtt_set_counter FEATURES_PROVIDED += periph_rtt_overflow + +# This configuration enables modules that are only available when using Kconfig +# module modelling +ifeq (1, $(TEST_KCONFIG)) + KCONFIG_ADD_CONFIG += $(RIOTCPU)/esp32/esp32.config +endif diff --git a/cpu/esp32/esp32.config b/cpu/esp32/esp32.config new file mode 100644 index 000000000000..811b1f37127b --- /dev/null +++ b/cpu/esp32/esp32.config @@ -0,0 +1 @@ +CONFIG_MODULE_PM_LAYERED=y diff --git a/cpu/esp32/periph/Kconfig b/cpu/esp32/periph/Kconfig new file mode 100644 index 000000000000..d9beb65cac34 --- /dev/null +++ b/cpu/esp32/periph/Kconfig @@ -0,0 +1,30 @@ +# 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_ESP_RTC_TIMER_32K + bool + depends on HAS_ESP_RTC_TIMER_32K + default y if MODULE_PERIPH_RTC + help + Use RTC timer with external 32.768 kHz crystal as RTT. + +config MODULE_PERIPH_ADC_CTRL + bool + depends on HAS_PERIPH_ADC_CTRL + default y if MODULE_PERIPH_ADC || MODULE_PERIPH_DAC + +config MODULE_PERIPH_RTT_HW_SYS + bool + default y if MODULE_PERIPH_RTT + +config MODULE_PERIPH_RTT_HW_RTC + bool + default y if MODULE_PERIPH_RTT + +endif # TEST_KCONFIG diff --git a/cpu/esp32/periph/Kconfig.i2c b/cpu/esp32/periph/Kconfig.i2c new file mode 100644 index 000000000000..9001be216c6f --- /dev/null +++ b/cpu/esp32/periph/Kconfig.i2c @@ -0,0 +1,34 @@ +# 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 + +choice + bool "I2C implementation" + depends on MODULE_PERIPH_I2C + help + Due to the poor and faulty hardware I2C implementation the software one + is used by default for the moment. + +config MODULE_ESP_I2C_SW + bool "Software" + select MODULE_PERIPH_I2C_SW + +config MODULE_ESP_I2C_HW + bool "Hardware" + select MODULE_CORE_THREAD_FLAGS + select MODULE_XTIMER + select MODULE_PERIPH_I2C_HW + +endchoice + +config MODULE_PERIPH_I2C_HW + bool + help + Hardware implementation of I2C. + +endif # TEST_KCONFIG diff --git a/cpu/esp32/vendor/esp-idf/Kconfig b/cpu/esp32/vendor/esp-idf/Kconfig new file mode 100644 index 000000000000..2758d82bd6c3 --- /dev/null +++ b/cpu/esp32/vendor/esp-idf/Kconfig @@ -0,0 +1,26 @@ +# 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_ESP_IDF + bool + depends on TEST_KCONFIG + depends on HAS_ARCH_ESP32 + default y + select MODULE_ESP_IDF_DRIVER + select MODULE_ESP_IDF_ESP32 + select MODULE_ESP_IDF_SOC + help + Espressif IoT Development Framework. + +rsource "driver/Kconfig" +rsource "esp32/Kconfig" +rsource "ethernet/Kconfig" +rsource "heap/Kconfig" +rsource "nvs_flash/Kconfig" +rsource "soc/Kconfig" +rsource "spi_flash/Kconfig" +rsource "wpa_supplicant/Kconfig" diff --git a/cpu/esp32/vendor/esp-idf/driver/Kconfig b/cpu/esp32/vendor/esp-idf/driver/Kconfig new file mode 100644 index 000000000000..e899d2e113bd --- /dev/null +++ b/cpu/esp32/vendor/esp-idf/driver/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 MODULE_ESP_IDF_DRIVER + bool + depends on TEST_KCONFIG + depends on MODULE_ESP_IDF diff --git a/cpu/esp32/vendor/esp-idf/esp32/Kconfig b/cpu/esp32/vendor/esp-idf/esp32/Kconfig new file mode 100644 index 000000000000..51eecd083da7 --- /dev/null +++ b/cpu/esp32/vendor/esp-idf/esp32/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 MODULE_ESP_IDF_ESP32 + bool + depends on TEST_KCONFIG + depends on MODULE_ESP_IDF diff --git a/cpu/esp32/vendor/esp-idf/ethernet/Kconfig b/cpu/esp32/vendor/esp-idf/ethernet/Kconfig new file mode 100644 index 000000000000..2393058a91fc --- /dev/null +++ b/cpu/esp32/vendor/esp-idf/ethernet/Kconfig @@ -0,0 +1,13 @@ +# 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_ESP_IDF_ETH + bool + depends on TEST_KCONFIG + depends on MODULE_ESP_IDF + +rsource "eth_phy/Kconfig" diff --git a/cpu/esp32/vendor/esp-idf/ethernet/eth_phy/Kconfig b/cpu/esp32/vendor/esp-idf/ethernet/eth_phy/Kconfig new file mode 100644 index 000000000000..2415096deb95 --- /dev/null +++ b/cpu/esp32/vendor/esp-idf/ethernet/eth_phy/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 MODULE_ESP_IDF_ETH_PHY + bool + depends on TEST_KCONFIG + depends on MODULE_ESP_IDF_ETH diff --git a/cpu/esp32/vendor/esp-idf/heap/Kconfig b/cpu/esp32/vendor/esp-idf/heap/Kconfig new file mode 100644 index 000000000000..aa89bbed0a2a --- /dev/null +++ b/cpu/esp32/vendor/esp-idf/heap/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 MODULE_ESP_IDF_HEAP + bool + depends on TEST_KCONFIG + depends on MODULE_ESP_IDF diff --git a/cpu/esp32/vendor/esp-idf/nvs_flash/Kconfig b/cpu/esp32/vendor/esp-idf/nvs_flash/Kconfig new file mode 100644 index 000000000000..13161e1a1c72 --- /dev/null +++ b/cpu/esp32/vendor/esp-idf/nvs_flash/Kconfig @@ -0,0 +1,14 @@ +# 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_ESP_IDF_NVS_FLASH + bool + depends on TEST_KCONFIG + depends on MODULE_ESP_IDF + select MODULE_MTD + help + Non-volatile storage library. diff --git a/cpu/esp32/vendor/esp-idf/soc/Kconfig b/cpu/esp32/vendor/esp-idf/soc/Kconfig new file mode 100644 index 000000000000..e0f540260754 --- /dev/null +++ b/cpu/esp32/vendor/esp-idf/soc/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 MODULE_ESP_IDF_SOC + bool + depends on TEST_KCONFIG + depends on MODULE_ESP_IDF diff --git a/cpu/esp32/vendor/esp-idf/spi_flash/Kconfig b/cpu/esp32/vendor/esp-idf/spi_flash/Kconfig new file mode 100644 index 000000000000..09b9aa42956a --- /dev/null +++ b/cpu/esp32/vendor/esp-idf/spi_flash/Kconfig @@ -0,0 +1,12 @@ +# 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_ESP_IDF_SPI_FLASH + bool + depends on TEST_KCONFIG + depends on MODULE_ESP_IDF + default y if MODULE_MTD diff --git a/cpu/esp32/vendor/esp-idf/wpa_supplicant/Kconfig b/cpu/esp32/vendor/esp-idf/wpa_supplicant/Kconfig new file mode 100644 index 000000000000..a0659230191c --- /dev/null +++ b/cpu/esp32/vendor/esp-idf/wpa_supplicant/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. +# + +rsource "port/Kconfig" +rsource "src/crypto/Kconfig" +rsource "src/wpa2/Kconfig" diff --git a/cpu/esp32/vendor/esp-idf/wpa_supplicant/port/Kconfig b/cpu/esp32/vendor/esp-idf/wpa_supplicant/port/Kconfig new file mode 100644 index 000000000000..554e8a84ef4f --- /dev/null +++ b/cpu/esp32/vendor/esp-idf/wpa_supplicant/port/Kconfig @@ -0,0 +1,13 @@ +# 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_ESP_IDF_WPA_SUPPLICANT_PORT + bool + depends on TEST_KCONFIG + depends on MODULE_ESP_IDF + help + esp-idf WPA supplicant port code. diff --git a/cpu/esp32/vendor/esp-idf/wpa_supplicant/src/crypto/Kconfig b/cpu/esp32/vendor/esp-idf/wpa_supplicant/src/crypto/Kconfig new file mode 100644 index 000000000000..bfc1578c6dcb --- /dev/null +++ b/cpu/esp32/vendor/esp-idf/wpa_supplicant/src/crypto/Kconfig @@ -0,0 +1,12 @@ +# 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_ESP_IDF_WPA_SUPPLICANT_CRYPTO + bool + depends on TEST_KCONFIG + depends on MODULE_ESP_IDF + diff --git a/cpu/esp32/vendor/esp-idf/wpa_supplicant/src/wpa2/Kconfig b/cpu/esp32/vendor/esp-idf/wpa_supplicant/src/wpa2/Kconfig new file mode 100644 index 000000000000..fba707c8431d --- /dev/null +++ b/cpu/esp32/vendor/esp-idf/wpa_supplicant/src/wpa2/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. +# + +rsource "eap_peer/Kconfig" +rsource "tls/Kconfig" +rsource "utils/Kconfig" diff --git a/cpu/esp32/vendor/esp-idf/wpa_supplicant/src/wpa2/eap_peer/Kconfig b/cpu/esp32/vendor/esp-idf/wpa_supplicant/src/wpa2/eap_peer/Kconfig new file mode 100644 index 000000000000..8c8f84ce0194 --- /dev/null +++ b/cpu/esp32/vendor/esp-idf/wpa_supplicant/src/wpa2/eap_peer/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 MODULE_ESP_IDF_WPA_SUPPLICANT_WPA2_EAP_PEER + bool + depends on TEST_KCONFIG + depends on MODULE_ESP_IDF diff --git a/cpu/esp32/vendor/esp-idf/wpa_supplicant/src/wpa2/tls/Kconfig b/cpu/esp32/vendor/esp-idf/wpa_supplicant/src/wpa2/tls/Kconfig new file mode 100644 index 000000000000..f1b262340052 --- /dev/null +++ b/cpu/esp32/vendor/esp-idf/wpa_supplicant/src/wpa2/tls/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 MODULE_ESP_IDF_WPA_SUPPLICANT_WPA2_TLS + bool + depends on TEST_KCONFIG + depends on MODULE_ESP_IDF diff --git a/cpu/esp32/vendor/esp-idf/wpa_supplicant/src/wpa2/utils/Kconfig b/cpu/esp32/vendor/esp-idf/wpa_supplicant/src/wpa2/utils/Kconfig new file mode 100644 index 000000000000..48f6d7ddfed9 --- /dev/null +++ b/cpu/esp32/vendor/esp-idf/wpa_supplicant/src/wpa2/utils/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 MODULE_ESP_IDF_WPA_SUPPLICANT_WPA2_UTILS + bool + depends on TEST_KCONFIG + depends on MODULE_ESP_IDF diff --git a/drivers/aip31068/Kconfig b/drivers/aip31068/Kconfig index 4cc202251160..fc53fe315265 100644 --- a/drivers/aip31068/Kconfig +++ b/drivers/aip31068/Kconfig @@ -11,6 +11,3 @@ config MODULE_AIP31068 depends on TEST_KCONFIG select MODULE_XTIMER select MODULE_PERIPH_I2C -# necessary to fix driver initialization on esp32 -# TODO: move this to ESP32 - select MODULE_ESP_I2C_HW if CPU_ESP32 diff --git a/drivers/periph_common/Kconfig.i2c b/drivers/periph_common/Kconfig.i2c index d11237fcf3b9..f5a081c8939d 100644 --- a/drivers/periph_common/Kconfig.i2c +++ b/drivers/periph_common/Kconfig.i2c @@ -30,3 +30,5 @@ config MODULE_PERIPH_INIT_I2C_RECONFIGURE depends on MODULE_PERIPH_I2C_RECONFIGURE endif # MODULE_PERIPH_I2C + +osource "$(RIOTCPU)/$(CPU)/periph/Kconfig.i2c" From 185d1a20df941b78302fd9077577524a5e393ac0 Mon Sep 17 00:00:00 2001 From: Leandro Lanzieri Date: Thu, 18 Nov 2021 17:17:51 +0100 Subject: [PATCH 08/22] cpu/esp8266: model Kconfig --- cpu/esp8266/Kconfig | 19 +++++++++++++++++++ cpu/esp8266/Makefile.features | 6 ++++++ cpu/esp8266/esp8266.config | 2 ++ cpu/esp8266/sdk/Kconfig | 11 +++++++++++ cpu/esp8266/vendor/Kconfig | 9 +++++++++ cpu/esp8266/vendor/esp-gdbstub/Kconfig | 11 +++++++++++ cpu/esp8266/vendor/esp-idf/Kconfig | 18 ++++++++++++++++++ .../vendor/esp-idf/esp8266/source/Kconfig | 11 +++++++++++ cpu/esp8266/vendor/esp-idf/heap/src/Kconfig | 11 +++++++++++ .../vendor/esp-idf/nvs_flash/src/Kconfig | 13 +++++++++++++ cpu/esp8266/vendor/esp-idf/spi_flash/Kconfig | 11 +++++++++++ cpu/esp8266/vendor/esp-idf/util/src/Kconfig | 11 +++++++++++ .../vendor/esp-idf/wpa_supplicant/Kconfig | 9 +++++++++ .../esp-idf/wpa_supplicant/port/Kconfig | 11 +++++++++++ .../esp-idf/wpa_supplicant/src/crypto/Kconfig | 11 +++++++++++ 15 files changed, 164 insertions(+) create mode 100644 cpu/esp8266/esp8266.config create mode 100644 cpu/esp8266/sdk/Kconfig create mode 100644 cpu/esp8266/vendor/Kconfig create mode 100644 cpu/esp8266/vendor/esp-gdbstub/Kconfig create mode 100644 cpu/esp8266/vendor/esp-idf/Kconfig create mode 100644 cpu/esp8266/vendor/esp-idf/esp8266/source/Kconfig create mode 100644 cpu/esp8266/vendor/esp-idf/heap/src/Kconfig create mode 100644 cpu/esp8266/vendor/esp-idf/nvs_flash/src/Kconfig create mode 100644 cpu/esp8266/vendor/esp-idf/spi_flash/Kconfig create mode 100644 cpu/esp8266/vendor/esp-idf/util/src/Kconfig create mode 100644 cpu/esp8266/vendor/esp-idf/wpa_supplicant/Kconfig create mode 100644 cpu/esp8266/vendor/esp-idf/wpa_supplicant/port/Kconfig create mode 100644 cpu/esp8266/vendor/esp-idf/wpa_supplicant/src/crypto/Kconfig diff --git a/cpu/esp8266/Kconfig b/cpu/esp8266/Kconfig index 261e7fb25b5d..cca627a7d61f 100644 --- a/cpu/esp8266/Kconfig +++ b/cpu/esp8266/Kconfig @@ -19,6 +19,17 @@ config CPU_FAM_ESP8266 select HAS_PERIPH_RTT_OVERFLOW select HAS_PERIPH_RTT_SET_COUNTER + select PACKAGE_ESP8266_SDK if TEST_KCONFIG + select MODULE_ESP_SDK if TEST_KCONFIG + select MODULE_ESP_IDF_ESP8266 if TEST_KCONFIG + select MODULE_ESP_IDF_NVS_FLASH if TEST_KCONFIG + select MODULE_ESP_IDF_SPI_FLASH if TEST_KCONFIG + select MODULE_ESP_IDF_UTIL if TEST_KCONFIG + select MODULE_ESP_IDF_WPA_SUPPLICANT_CRYPTO if TEST_KCONFIG + select MODULE_ESP_SDK if TEST_KCONFIG + select MODULE_PERIPH_COMMON if TEST_KCONFIG + select MODULE_RTT_RTC if HAS_PERIPH_RTT && MODULE_PERIPH_RTC + ## CPU Models config CPU_MODEL_ESP8266EX bool @@ -54,3 +65,11 @@ config CPU default "esp8266" if CPU_FAM_ESP8266 source "$(RIOTCPU)/esp_common/Kconfig" + +config MODULE_ESP_I2C_SW + bool + default y if MODULE_PERIPH_I2C + select MODULE_PERIPH_I2C_SW + +rsource "sdk/Kconfig" +rsource "vendor/Kconfig" diff --git a/cpu/esp8266/Makefile.features b/cpu/esp8266/Makefile.features index 02e6197daa83..be0c10b63dd0 100644 --- a/cpu/esp8266/Makefile.features +++ b/cpu/esp8266/Makefile.features @@ -9,3 +9,9 @@ FEATURES_PROVIDED += periph_rtt FEATURES_PROVIDED += periph_rtc FEATURES_PROVIDED += periph_rtt_overflow FEATURES_PROVIDED += periph_rtt_set_counter + +# This configuration enables modules that are only available when using Kconfig +# module modelling +ifeq (1, $(TEST_KCONFIG)) + KCONFIG_ADD_CONFIG += $(RIOTCPU)/esp8266/esp8266.config +endif diff --git a/cpu/esp8266/esp8266.config b/cpu/esp8266/esp8266.config new file mode 100644 index 000000000000..181ceff02378 --- /dev/null +++ b/cpu/esp8266/esp8266.config @@ -0,0 +1,2 @@ +CONFIG_MODULE_MTD=y +CONFIG_MODULE_PS=y diff --git a/cpu/esp8266/sdk/Kconfig b/cpu/esp8266/sdk/Kconfig new file mode 100644 index 000000000000..182509c31ca4 --- /dev/null +++ b/cpu/esp8266/sdk/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 MODULE_ESP_SDK + bool + depends on TEST_KCONFIG + depends on HAS_ARCH_ESP8266 diff --git a/cpu/esp8266/vendor/Kconfig b/cpu/esp8266/vendor/Kconfig new file mode 100644 index 000000000000..101a93369b90 --- /dev/null +++ b/cpu/esp8266/vendor/Kconfig @@ -0,0 +1,9 @@ +# 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. +# + +rsource "esp-gdbstub/Kconfig" +rsource "esp-idf/Kconfig" diff --git a/cpu/esp8266/vendor/esp-gdbstub/Kconfig b/cpu/esp8266/vendor/esp-gdbstub/Kconfig new file mode 100644 index 000000000000..7495b513f9eb --- /dev/null +++ b/cpu/esp8266/vendor/esp-gdbstub/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 MODULE_ESP_GDBSTUB + bool "gdbstub interface support" + depends on TEST_KCONFIG + depends on HAS_ARCH_ESP8266 diff --git a/cpu/esp8266/vendor/esp-idf/Kconfig b/cpu/esp8266/vendor/esp-idf/Kconfig new file mode 100644 index 000000000000..9b9ac22180b3 --- /dev/null +++ b/cpu/esp8266/vendor/esp-idf/Kconfig @@ -0,0 +1,18 @@ +# 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_ESP_IDF + bool + depends on TEST_KCONFIG + depends on HAS_ARCH_ESP8266 + +rsource "esp8266/source/Kconfig" +rsource "heap/src/Kconfig" +rsource "nvs_flash/src/Kconfig" +rsource "spi_flash/Kconfig" +rsource "util/src/Kconfig" +rsource "wpa_supplicant/Kconfig" diff --git a/cpu/esp8266/vendor/esp-idf/esp8266/source/Kconfig b/cpu/esp8266/vendor/esp-idf/esp8266/source/Kconfig new file mode 100644 index 000000000000..cc9a67af364b --- /dev/null +++ b/cpu/esp8266/vendor/esp-idf/esp8266/source/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 MODULE_ESP_IDF_ESP8266 + bool + depends on TEST_KCONFIG + depends on MODULE_ESP_IDF diff --git a/cpu/esp8266/vendor/esp-idf/heap/src/Kconfig b/cpu/esp8266/vendor/esp-idf/heap/src/Kconfig new file mode 100644 index 000000000000..aa89bbed0a2a --- /dev/null +++ b/cpu/esp8266/vendor/esp-idf/heap/src/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 MODULE_ESP_IDF_HEAP + bool + depends on TEST_KCONFIG + depends on MODULE_ESP_IDF diff --git a/cpu/esp8266/vendor/esp-idf/nvs_flash/src/Kconfig b/cpu/esp8266/vendor/esp-idf/nvs_flash/src/Kconfig new file mode 100644 index 000000000000..2887734c5f3b --- /dev/null +++ b/cpu/esp8266/vendor/esp-idf/nvs_flash/src/Kconfig @@ -0,0 +1,13 @@ +# 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_ESP_IDF_NVS_FLASH + bool + depends on TEST_KCONFIG + depends on MODULE_ESP_IDF + help + Non-volatile storage library. diff --git a/cpu/esp8266/vendor/esp-idf/spi_flash/Kconfig b/cpu/esp8266/vendor/esp-idf/spi_flash/Kconfig new file mode 100644 index 000000000000..1adc89c982ef --- /dev/null +++ b/cpu/esp8266/vendor/esp-idf/spi_flash/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 MODULE_ESP_IDF_SPI_FLASH + bool + depends on TEST_KCONFIG + depends on MODULE_ESP_IDF diff --git a/cpu/esp8266/vendor/esp-idf/util/src/Kconfig b/cpu/esp8266/vendor/esp-idf/util/src/Kconfig new file mode 100644 index 000000000000..4253af51a0af --- /dev/null +++ b/cpu/esp8266/vendor/esp-idf/util/src/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 MODULE_ESP_IDF_UTIL + bool + depends on TEST_KCONFIG + depends on MODULE_ESP_IDF diff --git a/cpu/esp8266/vendor/esp-idf/wpa_supplicant/Kconfig b/cpu/esp8266/vendor/esp-idf/wpa_supplicant/Kconfig new file mode 100644 index 000000000000..52391357ae3c --- /dev/null +++ b/cpu/esp8266/vendor/esp-idf/wpa_supplicant/Kconfig @@ -0,0 +1,9 @@ +# 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. +# + +rsource "port/Kconfig" +rsource "src/crypto/Kconfig" diff --git a/cpu/esp8266/vendor/esp-idf/wpa_supplicant/port/Kconfig b/cpu/esp8266/vendor/esp-idf/wpa_supplicant/port/Kconfig new file mode 100644 index 000000000000..7b07f05dbd86 --- /dev/null +++ b/cpu/esp8266/vendor/esp-idf/wpa_supplicant/port/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 MODULE_ESP_IDF_WPA_SUPPLICANT_PORT + bool + depends on TEST_KCONFIG + depends on MODULE_ESP_IDF diff --git a/cpu/esp8266/vendor/esp-idf/wpa_supplicant/src/crypto/Kconfig b/cpu/esp8266/vendor/esp-idf/wpa_supplicant/src/crypto/Kconfig new file mode 100644 index 000000000000..6799ff5c783e --- /dev/null +++ b/cpu/esp8266/vendor/esp-idf/wpa_supplicant/src/crypto/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 MODULE_ESP_IDF_WPA_SUPPLICANT_CRYPTO + bool + depends on TEST_KCONFIG + depends on MODULE_ESP_IDF From b3b468ad8bbf5ab227284075f4ea8ce4cb01988b Mon Sep 17 00:00:00 2001 From: Leandro Lanzieri Date: Thu, 18 Nov 2021 17:18:59 +0100 Subject: [PATCH 09/22] boards/esp32: model Kconfig --- boards/common/esp32/Kconfig | 11 +++++++++++ boards/esp32-heltec-lora32-v2/Kconfig | 2 ++ boards/esp32-ttgo-t-beam/Kconfig | 15 +++++++++++++++ .../esp32-wemos-lolin-d32-pro/Makefile.features | 6 ++++++ .../esp32-wemos-lolin-d32-pro.config | 1 + boards/esp32-wrover-kit/Kconfig | 3 ++- boards/esp32-wrover-kit/Makefile.features | 6 ++++++ boards/esp32-wrover-kit/esp32-wrover-kit.config | 2 ++ 8 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 boards/esp32-wemos-lolin-d32-pro/esp32-wemos-lolin-d32-pro.config create mode 100644 boards/esp32-wrover-kit/esp32-wrover-kit.config diff --git a/boards/common/esp32/Kconfig b/boards/common/esp32/Kconfig index 5123ae92d934..b09f3105cb85 100644 --- a/boards/common/esp32/Kconfig +++ b/boards/common/esp32/Kconfig @@ -10,3 +10,14 @@ config BOARD_COMMON_ESP32 select HAS_PERIPH_GPIO_IRQ select HAS_PERIPH_UART select HAS_PERIPH_UART_MODECFG + + select HAVE_SAUL_GPIO + +config MODULE_BOARDS_COMMON_ESP32 + bool + depends on TEST_KCONFIG + depends on BOARD_COMMON_ESP32 + depends on HAS_ARCH_ESP32 + default y + help + Common ESP32 boards code. diff --git a/boards/esp32-heltec-lora32-v2/Kconfig b/boards/esp32-heltec-lora32-v2/Kconfig index 8717b987856b..65007058a284 100644 --- a/boards/esp32-heltec-lora32-v2/Kconfig +++ b/boards/esp32-heltec-lora32-v2/Kconfig @@ -19,4 +19,6 @@ config BOARD_ESP32_HELTEC_LORA32_V2 select HAS_PERIPH_PWM select HAS_PERIPH_SPI + select HAVE_SX1276 + source "$(RIOTBOARD)/common/esp32/Kconfig" diff --git a/boards/esp32-ttgo-t-beam/Kconfig b/boards/esp32-ttgo-t-beam/Kconfig index 65fb000760db..c79c109d8e92 100644 --- a/boards/esp32-ttgo-t-beam/Kconfig +++ b/boards/esp32-ttgo-t-beam/Kconfig @@ -22,3 +22,18 @@ config BOARD_ESP32_TTGO_T_BEAM select HAS_PERIPH_UART source "$(RIOTBOARD)/common/esp32/Kconfig" + +menu "ESP32 TTGO T-Beam options" + depends on TEST_KCONFIG + depends on BOARD_ESP32_TTGO_T_BEAM + +config MODULE_ESP32_TTGO_T_BEAM_V1_0 + bool "Use V1.0 board variant" + select MODULE_PERIPH_I2C + help + There are at least three board types: rev0, rev1, and V1.0. Versions + rev0 and rev1 are very similar, the only difference is that rev1 has + an additional LED connected to GPIO14. The pinout of V1.0 has more + changes. + +endmenu diff --git a/boards/esp32-wemos-lolin-d32-pro/Makefile.features b/boards/esp32-wemos-lolin-d32-pro/Makefile.features index d8122aa9fd61..fed366b25ad1 100644 --- a/boards/esp32-wemos-lolin-d32-pro/Makefile.features +++ b/boards/esp32-wemos-lolin-d32-pro/Makefile.features @@ -14,3 +14,9 @@ FEATURES_PROVIDED += periph_spi FEATURES_PROVIDED += esp_spi_ram FEATURES_PROVIDED += arduino + +# This configuration enables modules that are only available when using Kconfig +# module modelling +ifeq (1, $(TEST_KCONFIG)) + KCONFIG_ADD_CONFIG += $(BOARDDIR)/esp32-wemos-lolin-d32-pro.config +endif diff --git a/boards/esp32-wemos-lolin-d32-pro/esp32-wemos-lolin-d32-pro.config b/boards/esp32-wemos-lolin-d32-pro/esp32-wemos-lolin-d32-pro.config new file mode 100644 index 000000000000..171440efa1ec --- /dev/null +++ b/boards/esp32-wemos-lolin-d32-pro/esp32-wemos-lolin-d32-pro.config @@ -0,0 +1 @@ +CONFIG_MODULE_ESP_SPI_RAM=y diff --git a/boards/esp32-wrover-kit/Kconfig b/boards/esp32-wrover-kit/Kconfig index 26b38810756d..2fbb3a316316 100644 --- a/boards/esp32-wrover-kit/Kconfig +++ b/boards/esp32-wrover-kit/Kconfig @@ -20,6 +20,7 @@ config BOARD_ESP32_WROVER_KIT select HAS_PERIPH_PWM select HAS_PERIPH_SPI select HAS_SDCARD_SPI - select MODULE_ESP_JTAG + + select HAVE_ILI9341 source "$(RIOTBOARD)/common/esp32/Kconfig" diff --git a/boards/esp32-wrover-kit/Makefile.features b/boards/esp32-wrover-kit/Makefile.features index 0ff032ef0383..26d059db44af 100644 --- a/boards/esp32-wrover-kit/Makefile.features +++ b/boards/esp32-wrover-kit/Makefile.features @@ -15,3 +15,9 @@ FEATURES_PROVIDED += esp_spi_ram FEATURES_PROVIDED += esp_rtc_timer_32k FEATURES_PROVIDED += arduino + +# This configuration enables modules that are only available when using Kconfig +# module modelling +ifeq (1, $(TEST_KCONFIG)) + KCONFIG_ADD_CONFIG += $(BOARDDIR)/esp32-wrover-kit.config +endif diff --git a/boards/esp32-wrover-kit/esp32-wrover-kit.config b/boards/esp32-wrover-kit/esp32-wrover-kit.config new file mode 100644 index 000000000000..2b24cf45d3eb --- /dev/null +++ b/boards/esp32-wrover-kit/esp32-wrover-kit.config @@ -0,0 +1,2 @@ +# Sets up configuration for openocd +CONFIG_MODULE_ESP_JTAG=y From 4be55b7a49135e4370ac3ff717cc9ea3c66ab287 Mon Sep 17 00:00:00 2001 From: Leandro Lanzieri Date: Thu, 18 Nov 2021 17:19:14 +0100 Subject: [PATCH 10/22] boards/common/esp8266: model Kconfig --- boards/common/esp8266/Kconfig | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/boards/common/esp8266/Kconfig b/boards/common/esp8266/Kconfig index 8eb0cffbcbb3..fe0abba89d34 100644 --- a/boards/common/esp8266/Kconfig +++ b/boards/common/esp8266/Kconfig @@ -15,3 +15,14 @@ config BOARD_COMMON_ESP8266 select HAS_PERIPH_SPI select HAS_PERIPH_UART select HAS_PERIPH_UART_MODECFG + + select HAVE_SAUL_GPIO + +config MODULE_BOARDS_COMMON_ESP8266 + bool + depends on TEST_KCONFIG + depends on HAS_ARCH_ESP8266 + depends on BOARD_COMMON_ESP8266 + default y + help + Common ESP8266 boards code. From 63a2b557df936718c88fa1d52672fd197c003519 Mon Sep 17 00:00:00 2001 From: Leandro Lanzieri Date: Thu, 18 Nov 2021 17:21:23 +0100 Subject: [PATCH 11/22] .murdock: add subset of ESP boards to test Kconfig --- .murdock | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.murdock b/.murdock index 8850dc12a1b2..a6cada102cb8 100755 --- a/.murdock +++ b/.murdock @@ -22,6 +22,8 @@ cc1352-launchpad cc2650-launchpad derfmega128 dwm1001 +esp32-heltec-lora32-v2 +esp8266-esp-12x hifive1 mbed_lpc1768 mega-xplained From 9f31dfe28ab182d074d3ce76e07e8ee6d11d0567 Mon Sep 17 00:00:00 2001 From: Leandro Lanzieri Date: Tue, 30 Nov 2021 10:35:16 +0100 Subject: [PATCH 12/22] cpu/esp32: refactor esp_spi_ram feature This feature is provided by all esp32_wrover% models, so group it in the common file. --- boards/esp32-ethernet-kit-v1_0/Makefile.features | 1 - boards/esp32-wemos-lolin-d32-pro/Makefile.features | 3 --- boards/esp32-wrover-kit/Makefile.features | 1 - cpu/esp32/Makefile.features | 4 ++++ 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/boards/esp32-ethernet-kit-v1_0/Makefile.features b/boards/esp32-ethernet-kit-v1_0/Makefile.features index 412194fa4c5c..e22f96a983a9 100644 --- a/boards/esp32-ethernet-kit-v1_0/Makefile.features +++ b/boards/esp32-ethernet-kit-v1_0/Makefile.features @@ -15,4 +15,3 @@ endif # unique features provided by the board FEATURES_PROVIDED += esp_jtag -FEATURES_PROVIDED += esp_spi_ram diff --git a/boards/esp32-wemos-lolin-d32-pro/Makefile.features b/boards/esp32-wemos-lolin-d32-pro/Makefile.features index fed366b25ad1..98d65e5c62f9 100644 --- a/boards/esp32-wemos-lolin-d32-pro/Makefile.features +++ b/boards/esp32-wemos-lolin-d32-pro/Makefile.features @@ -10,9 +10,6 @@ FEATURES_PROVIDED += periph_i2c FEATURES_PROVIDED += periph_pwm FEATURES_PROVIDED += periph_spi -# unique features provided by the board -FEATURES_PROVIDED += esp_spi_ram - FEATURES_PROVIDED += arduino # This configuration enables modules that are only available when using Kconfig diff --git a/boards/esp32-wrover-kit/Makefile.features b/boards/esp32-wrover-kit/Makefile.features index 26d059db44af..63514698b4e8 100644 --- a/boards/esp32-wrover-kit/Makefile.features +++ b/boards/esp32-wrover-kit/Makefile.features @@ -11,7 +11,6 @@ FEATURES_PROVIDED += periph_spi # unique features provided by the board FEATURES_PROVIDED += sdcard_spi -FEATURES_PROVIDED += esp_spi_ram FEATURES_PROVIDED += esp_rtc_timer_32k FEATURES_PROVIDED += arduino diff --git a/cpu/esp32/Makefile.features b/cpu/esp32/Makefile.features index d176c596e0cc..089df2d550e5 100644 --- a/cpu/esp32/Makefile.features +++ b/cpu/esp32/Makefile.features @@ -12,6 +12,10 @@ FEATURES_PROVIDED += periph_rtt FEATURES_PROVIDED += periph_rtt_set_counter FEATURES_PROVIDED += periph_rtt_overflow +ifneq (,$(filter esp32-wrover%,$(CPU_MODEL))) + FEATURES_PROVIDED += esp_spi_ram +endif + # This configuration enables modules that are only available when using Kconfig # module modelling ifeq (1, $(TEST_KCONFIG)) From 53134d0474d3d46540b5b7c388f716afcc1d8c8b Mon Sep 17 00:00:00 2001 From: Leandro Lanzieri Date: Tue, 30 Nov 2021 10:36:20 +0100 Subject: [PATCH 13/22] cpu/esp32: require esp_spi_ram feature to use the module --- cpu/esp32/Makefile.dep | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cpu/esp32/Makefile.dep b/cpu/esp32/Makefile.dep index 256d0f35e3c0..9d737c7eba96 100644 --- a/cpu/esp32/Makefile.dep +++ b/cpu/esp32/Makefile.dep @@ -71,6 +71,10 @@ ifneq (,$(filter esp_now esp_wifi esp_spi_ram,$(USEMODULE))) USEMODULE += esp_idf_heap endif +ifneq (,$(filter esp_spi_ram,$(USEMODULE))) + FEATURES_REQUIRED += esp_spi_ram +endif + ifneq (,$(filter mtd,$(USEMODULE))) USEMODULE += esp_idf_spi_flash endif From 721588b03bb255f13bb7b77e4a7e730c7b8b0d01 Mon Sep 17 00:00:00 2001 From: Leandro Lanzieri Date: Tue, 30 Nov 2021 11:19:45 +0100 Subject: [PATCH 14/22] cpu/esp8266: remove unneeded Makefile --- cpu/esp8266/vendor/esp-idf/nvs_flash/Makefile | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 cpu/esp8266/vendor/esp-idf/nvs_flash/Makefile diff --git a/cpu/esp8266/vendor/esp-idf/nvs_flash/Makefile b/cpu/esp8266/vendor/esp-idf/nvs_flash/Makefile deleted file mode 100644 index 83332d4b1b20..000000000000 --- a/cpu/esp8266/vendor/esp-idf/nvs_flash/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -MODULE=esp_idf_nvs_flash - -include $(RIOTBASE)/Makefile.base - -CFLAGS += -DESP_PLATFORM -CXXFLAGS += -std=c++11 -INCLUDES += -I$(RIOTCPU)/$(CPU)/vendor/esp-idf/log/include -INCLUDES += -I$(ESP8266_RTOS_SDK_DIR)/components/nvs_flash/include -INCLUDES += -I$(ESP8266_RTOS_SDK_DIR)/components/spi_flash/include From 281519881ea5d9cf1392802814ec93c03bdc5f4b Mon Sep 17 00:00:00 2001 From: Leandro Lanzieri Date: Tue, 30 Nov 2021 11:32:29 +0100 Subject: [PATCH 15/22] cpu/esp32: fix esp_jtag dependency In order to work properly dependencies should be placed on the Makefile.dep files, not on Makefile.include. --- cpu/esp32/Makefile.dep | 4 ++++ cpu/esp32/Makefile.include | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cpu/esp32/Makefile.dep b/cpu/esp32/Makefile.dep index 9d737c7eba96..4ab133b991e1 100644 --- a/cpu/esp32/Makefile.dep +++ b/cpu/esp32/Makefile.dep @@ -95,3 +95,7 @@ endif ifneq (,$(filter shell,$(USEMODULE))) USEMODULE += ps endif + +ifneq (,$(filter esp_jtag,$(USEMODULE))) + FEATURES_REQUIRED += esp_jtag +endif diff --git a/cpu/esp32/Makefile.include b/cpu/esp32/Makefile.include index 229687157f22..ca232635572e 100644 --- a/cpu/esp32/Makefile.include +++ b/cpu/esp32/Makefile.include @@ -50,10 +50,6 @@ ifneq (,$(filter esp_eth,$(USEMODULE))) INCLUDES += -I$(ESP32_SDK_DIR)/components/ethernet/include endif -ifneq (,$(filter esp_jtag,$(USEMODULE))) - FEATURES_REQUIRED += esp_jtag -endif - CFLAGS += -DSDK_NOT_USED -DCONFIG_FREERTOS_UNICORE=1 -DESP_PLATFORM CFLAGS += -DLOG_TAG_IN_BRACKETS From b89a62df9b7e2afd762527063ddc7665dbb47348 Mon Sep 17 00:00:00 2001 From: Leandro Lanzieri Date: Tue, 30 Nov 2021 11:33:37 +0100 Subject: [PATCH 16/22] boards/esp32-wrover-kit: provide esp_jtag feature --- boards/esp32-wrover-kit/Makefile.features | 1 + 1 file changed, 1 insertion(+) diff --git a/boards/esp32-wrover-kit/Makefile.features b/boards/esp32-wrover-kit/Makefile.features index 63514698b4e8..17054e846620 100644 --- a/boards/esp32-wrover-kit/Makefile.features +++ b/boards/esp32-wrover-kit/Makefile.features @@ -12,6 +12,7 @@ FEATURES_PROVIDED += periph_spi # unique features provided by the board FEATURES_PROVIDED += sdcard_spi FEATURES_PROVIDED += esp_rtc_timer_32k +FEATURES_PROVIDED += esp_jtag FEATURES_PROVIDED += arduino From 81b93c9b95c58cacd0fbf6d6bfccf7baa445524d Mon Sep 17 00:00:00 2001 From: Leandro Lanzieri Date: Tue, 30 Nov 2021 12:03:13 +0100 Subject: [PATCH 17/22] cpu/esp32/kconfig: move esp_wifi_enterprise feature to esp_common --- cpu/esp32/Kconfig | 6 ------ cpu/esp_common/Kconfig | 6 ++++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cpu/esp32/Kconfig b/cpu/esp32/Kconfig index 0b9a91a7bc6c..abad7755da93 100644 --- a/cpu/esp32/Kconfig +++ b/cpu/esp32/Kconfig @@ -76,12 +76,6 @@ config HAS_ESP_SPI_RAM Indicates that an external RAM is connected via the FSPI interface in the board. -config HAS_ESP_WIFI_ENTERPRISE - bool - help - Indicates that the platform supports WPA2 enterprise mode for the WiFi - interface. - config HAS_PERIPH_ADC_CTRL bool help diff --git a/cpu/esp_common/Kconfig b/cpu/esp_common/Kconfig index 3359c8644cf7..2f0323968c5e 100644 --- a/cpu/esp_common/Kconfig +++ b/cpu/esp_common/Kconfig @@ -56,6 +56,12 @@ config HAS_ARCH_ESP help Indicates that an 'ESP' architecture is being used. +config HAS_ESP_WIFI_ENTERPRISE + bool + help + Indicates that the platform supports WPA2 enterprise mode for the WiFi + interface. + ## Common CPU symbols config CPU_ARCH default "xtensa" if CPU_ARCH_XTENSA From dadaace394f1e5ffe1658f55c9926a8b3fc4434f Mon Sep 17 00:00:00 2001 From: Leandro Lanzieri Date: Tue, 30 Nov 2021 12:24:43 +0100 Subject: [PATCH 18/22] sys/log: check that one and only one backend --- sys/log/Makefile.include | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sys/log/Makefile.include b/sys/log/Makefile.include index 530c972f1191..b9d461414573 100644 --- a/sys/log/Makefile.include +++ b/sys/log/Makefile.include @@ -1,3 +1,15 @@ +# check that one, and only one log backend is being used +USED_LOG_BACKENDS := $(sort $(filter log_%,$(USEMODULE))) + +ifeq (0,$(words $(USED_LOG_BACKENDS))) + $(error The log module is being used but no backend is provided.) +else ifeq (1,$(words $(USED_LOG_BACKENDS))) + # only one backend is provided, this is correct +else + $(info Only one log backend can be used at a time.) + $(error Currently selecting: $(USED_LOG_BACKENDS)) +endif + ifneq (,$(filter log_printfnoformat,$(USEMODULE))) USEMODULE_INCLUDES += $(RIOTBASE)/sys/log/log_printfnoformat endif From b761701ca32531e8a4344c4465bba6996b8ecdf8 Mon Sep 17 00:00:00 2001 From: Leandro Lanzieri Date: Thu, 2 Dec 2021 11:41:46 +0100 Subject: [PATCH 19/22] sys/rtt_rtc/kconfig: do not select RTC feature --- drivers/rtt_rtc/Kconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/rtt_rtc/Kconfig b/drivers/rtt_rtc/Kconfig index 0b4361bd7919..68cbf8c42c42 100644 --- a/drivers/rtt_rtc/Kconfig +++ b/drivers/rtt_rtc/Kconfig @@ -10,6 +10,5 @@ config MODULE_RTT_RTC depends on HAS_PERIPH_RTT depends on TEST_KCONFIG select MODULE_PERIPH_RTT - select HAS_PERIPH_RTC # provides RTC help Basic RTC implementation based on a RTT. From 01e01c459739afb54d5db74f29c3ecf62bb696e5 Mon Sep 17 00:00:00 2001 From: Leandro Lanzieri Date: Tue, 7 Dec 2021 11:27:22 +0100 Subject: [PATCH 20/22] cpu/esp_common: move LINKFLAGS to Makefile.include --- cpu/esp_common/Makefile.dep | 7 ------- cpu/esp_common/Makefile.include | 12 ++++++++---- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/cpu/esp_common/Makefile.dep b/cpu/esp_common/Makefile.dep index 4ac30362bd95..4bb829937f7e 100644 --- a/cpu/esp_common/Makefile.dep +++ b/cpu/esp_common/Makefile.dep @@ -85,10 +85,3 @@ ifneq (,$(filter esp_wifi_any,$(USEMODULE))) USEMODULE += netopt USEMODULE += xtimer endif - -ifneq (,$(filter esp_idf_heap,$(USEMODULE))) - LINKFLAGS += -Wl,-wrap,_malloc_r - LINKFLAGS += -Wl,-wrap,_calloc_r - LINKFLAGS += -Wl,-wrap,_realloc_r - LINKFLAGS += -Wl,-wrap,_free_r -endif diff --git a/cpu/esp_common/Makefile.include b/cpu/esp_common/Makefile.include index 41757bdab6b7..7b7987525cd4 100644 --- a/cpu/esp_common/Makefile.include +++ b/cpu/esp_common/Makefile.include @@ -88,10 +88,14 @@ LINKFLAGS += -L$(ESP_SDK_DIR)/components/$(CPU)/lib endif LINKFLAGS += -nostdlib -Wl,-gc-sections -Wl,-static -ifeq (,$(filter esp_idf_heap,$(USEMODULE))) - # use the wrapper functions for calloc to add correct overflow detection missing - # in the newlib's version. - LINKFLAGS += -Wl,-wrap=_calloc_r +# use the wrapper functions for calloc to add correct overflow detection missing +# in the newlib's version. +LINKFLAGS += -Wl,-wrap,_calloc_r + +ifneq (,$(filter esp_idf_heap,$(USEMODULE))) + LINKFLAGS += -Wl,-wrap,_malloc_r + LINKFLAGS += -Wl,-wrap,_realloc_r + LINKFLAGS += -Wl,-wrap,_free_r endif # LINKFLAGS += -Wl,--verbose From a685e037c70cd36545604bae9c9eb1553470fc86 Mon Sep 17 00:00:00 2001 From: Leandro Lanzieri Date: Tue, 7 Dec 2021 11:27:51 +0100 Subject: [PATCH 21/22] cpu/esp32: check for cpp module instead of used feature --- cpu/esp32/Makefile.include | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpu/esp32/Makefile.include b/cpu/esp32/Makefile.include index ca232635572e..b5c0db3272e0 100644 --- a/cpu/esp32/Makefile.include +++ b/cpu/esp32/Makefile.include @@ -72,7 +72,7 @@ ifneq (,$(filter esp_now,$(USEMODULE))) ARCHIVES += -lespnow -lmesh endif -ifneq (,$(filter cpp,$(FEATURES_USED))) +ifneq (,$(filter cpp,$(USEMODULE))) ARCHIVES += -lstdc++ endif From a8201c03c0a560436492899b1a62bb8be9da30ff Mon Sep 17 00:00:00 2001 From: Leandro Lanzieri Date: Fri, 10 Dec 2021 18:05:47 +0100 Subject: [PATCH 22/22] sys/log/kconfig: change entry-point --- sys/log/Kconfig | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/sys/log/Kconfig b/sys/log/Kconfig index fdc9b10ce311..c00efd51945d 100644 --- a/sys/log/Kconfig +++ b/sys/log/Kconfig @@ -5,28 +5,32 @@ # directory for more details. # - -menuconfig MODULE_LOG +choice bool "Logging system override" + optional depends on TEST_KCONFIG help Say y to override the default logging functions. For more information see core/include/log.h. -choice LOG_BACKEND - bool "Implementation" - depends on MODULE_LOG - config MODULE_LOG_COLOR bool "Colored output" + select MODULE_LOG help Implements a logging module with colored output. config MODULE_LOG_PRINTFNOFORMAT bool "puts-based log" + select MODULE_LOG help Logging is implemented using puts instead of printf. Use it where printf might be too heavy. This also serves as an example for logging implementation. endchoice + +config MODULE_LOG + bool + help + Modules that override the default log implementation shoul select this. + For more information see core/include/log.h.