Merge pull request #17232 from leandrolanzieri/pr/cpu/esp/model_kconfig

cpu/esp{32,8266}: model kconfig
This commit is contained in:
Gunar Schorcht 2021-12-11 08:53:31 +01:00 committed by GitHub
commit 85313ccc02
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
73 changed files with 718 additions and 68 deletions

View File

@ -27,6 +27,8 @@ cc1352-launchpad
cc2650-launchpad cc2650-launchpad
derfmega128 derfmega128
dwm1001 dwm1001
esp32-heltec-lora32-v2
esp8266-esp-12x
hifive1 hifive1
mbed_lpc1768 mbed_lpc1768
mega-xplained mega-xplained

View File

@ -10,3 +10,14 @@ config BOARD_COMMON_ESP32
select HAS_PERIPH_GPIO_IRQ select HAS_PERIPH_GPIO_IRQ
select HAS_PERIPH_UART select HAS_PERIPH_UART
select HAS_PERIPH_UART_MODECFG 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.

View File

@ -15,3 +15,14 @@ config BOARD_COMMON_ESP8266
select HAS_PERIPH_SPI select HAS_PERIPH_SPI
select HAS_PERIPH_UART select HAS_PERIPH_UART
select HAS_PERIPH_UART_MODECFG 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.

View File

@ -13,7 +13,6 @@ config BOARD_ESP32_ETHERNET_KIT_V1_0
default y default y
select BOARD_COMMON_ESP32 select BOARD_COMMON_ESP32
select CPU_MODEL_ESP32_WROVER_B select CPU_MODEL_ESP32_WROVER_B
select HAS_ESP_SPI_RAM
select HAS_ESP_JTAG select HAS_ESP_JTAG
select HAS_PERIPH_ADC select HAS_PERIPH_ADC
select HAS_PERIPH_ETH select HAS_PERIPH_ETH

View File

@ -15,4 +15,3 @@ endif
# unique features provided by the board # unique features provided by the board
FEATURES_PROVIDED += esp_jtag FEATURES_PROVIDED += esp_jtag
FEATURES_PROVIDED += esp_spi_ram

View File

@ -13,7 +13,6 @@ config BOARD_ESP32_ETHERNET_KIT_V1_1
default y default y
select BOARD_COMMON_ESP32 select BOARD_COMMON_ESP32
select CPU_MODEL_ESP32_WROVER_B select CPU_MODEL_ESP32_WROVER_B
select HAS_ESP_SPI_RAM
select HAS_ESP_JTAG select HAS_ESP_JTAG
select HAS_PERIPH_ADC select HAS_PERIPH_ADC
select HAS_PERIPH_ETH select HAS_PERIPH_ETH

View File

@ -13,7 +13,6 @@ config BOARD_ESP32_ETHERNET_KIT_V1_2
default y default y
select BOARD_COMMON_ESP32 select BOARD_COMMON_ESP32
select CPU_MODEL_ESP32_WROVER_E select CPU_MODEL_ESP32_WROVER_E
select HAS_ESP_SPI_RAM
select HAS_ESP_JTAG select HAS_ESP_JTAG
select HAS_PERIPH_ADC select HAS_PERIPH_ADC
select HAS_PERIPH_ETH select HAS_PERIPH_ETH

View File

@ -19,4 +19,6 @@ config BOARD_ESP32_HELTEC_LORA32_V2
select HAS_PERIPH_PWM select HAS_PERIPH_PWM
select HAS_PERIPH_SPI select HAS_PERIPH_SPI
select HAVE_SX1276
source "$(RIOTBOARD)/common/esp32/Kconfig" source "$(RIOTBOARD)/common/esp32/Kconfig"

View File

@ -22,3 +22,18 @@ config BOARD_ESP32_TTGO_T_BEAM
select HAS_PERIPH_UART select HAS_PERIPH_UART
source "$(RIOTBOARD)/common/esp32/Kconfig" 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

View File

@ -13,7 +13,6 @@ config BOARD_ESP32_WEMOS_LOLIN_D32_PRO
select BOARD_COMMON_ESP32 select BOARD_COMMON_ESP32
select CPU_MODEL_ESP32_WROVER select CPU_MODEL_ESP32_WROVER
select HAS_ARDUINO select HAS_ARDUINO
select HAS_ESP_SPI_RAM
select HAS_PERIPH_ADC select HAS_PERIPH_ADC
select HAS_PERIPH_DAC select HAS_PERIPH_DAC
select HAS_PERIPH_I2C select HAS_PERIPH_I2C

View File

@ -0,0 +1 @@
DEFAULT_MODULE += esp_spi_ram

View File

@ -1,3 +1 @@
USEMODULE += esp_spi_ram
include $(RIOTBOARD)/common/esp32/Makefile.dep include $(RIOTBOARD)/common/esp32/Makefile.dep

View File

@ -10,7 +10,10 @@ FEATURES_PROVIDED += periph_i2c
FEATURES_PROVIDED += periph_pwm FEATURES_PROVIDED += periph_pwm
FEATURES_PROVIDED += periph_spi FEATURES_PROVIDED += periph_spi
# unique features provided by the board
FEATURES_PROVIDED += esp_spi_ram
FEATURES_PROVIDED += arduino 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

View File

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

View File

@ -14,12 +14,13 @@ config BOARD_ESP32_WROVER_KIT
select CPU_MODEL_ESP32_WROVER select CPU_MODEL_ESP32_WROVER
select HAS_ARDUINO select HAS_ARDUINO
select HAS_ESP_RTC_TIMER_32K select HAS_ESP_RTC_TIMER_32K
select HAS_ESP_SPI_RAM select HAS_ESP_JTAG
select HAS_PERIPH_ADC select HAS_PERIPH_ADC
select HAS_PERIPH_I2C select HAS_PERIPH_I2C
select HAS_PERIPH_PWM select HAS_PERIPH_PWM
select HAS_PERIPH_SPI select HAS_PERIPH_SPI
select HAS_SDCARD_SPI select HAS_SDCARD_SPI
select MODULE_ESP_JTAG
select HAVE_ILI9341
source "$(RIOTBOARD)/common/esp32/Kconfig" source "$(RIOTBOARD)/common/esp32/Kconfig"

View File

@ -11,7 +11,13 @@ FEATURES_PROVIDED += periph_spi
# unique features provided by the board # unique features provided by the board
FEATURES_PROVIDED += sdcard_spi FEATURES_PROVIDED += sdcard_spi
FEATURES_PROVIDED += esp_spi_ram
FEATURES_PROVIDED += esp_rtc_timer_32k FEATURES_PROVIDED += esp_rtc_timer_32k
FEATURES_PROVIDED += esp_jtag
FEATURES_PROVIDED += arduino 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

View File

@ -0,0 +1,2 @@
# Sets up configuration for openocd
CONFIG_MODULE_ESP_JTAG=y

View File

@ -21,6 +21,14 @@ config CPU_FAM_ESP32
select HAS_PERIPH_RTT_SET_COUNTER select HAS_PERIPH_RTT_SET_COUNTER
select HAS_PERIPH_RTT_OVERFLOW 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 ## CPU Models
config CPU_MODEL_ESP32_WROOM_32 config CPU_MODEL_ESP32_WROOM_32
bool bool
@ -29,14 +37,17 @@ config CPU_MODEL_ESP32_WROOM_32
config CPU_MODEL_ESP32_WROVER config CPU_MODEL_ESP32_WROVER
bool bool
select CPU_FAM_ESP32 select CPU_FAM_ESP32
select HAS_ESP_SPI_RAM
config CPU_MODEL_ESP32_WROVER_B config CPU_MODEL_ESP32_WROVER_B
bool bool
select CPU_FAM_ESP32 select CPU_FAM_ESP32
select HAS_ESP_SPI_RAM
config CPU_MODEL_ESP32_WROVER_E config CPU_MODEL_ESP32_WROVER_E
bool bool
select CPU_FAM_ESP32 select CPU_FAM_ESP32
select HAS_ESP_SPI_RAM
config CPU_MODEL_ESP32_D0WD config CPU_MODEL_ESP32_D0WD
bool bool
@ -65,17 +76,16 @@ config HAS_ESP_SPI_RAM
Indicates that an external RAM is connected via the FSPI interface in Indicates that an external RAM is connected via the FSPI interface in
the board. 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 config HAS_PERIPH_ADC_CTRL
bool bool
help help
Indicates that an ESP32 ADC controller peripheral is present. 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 ## Common CPU symbols
config CPU_CORE config CPU_CORE
default "xtensa-lx6" if CPU_CORE_XTENSA_LX6 default "xtensa-lx6" if CPU_CORE_XTENSA_LX6
@ -93,4 +103,24 @@ config CPU_MODEL
config CPU config CPU
default "esp32" if CPU_FAM_ESP32 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" source "$(RIOTCPU)/esp_common/Kconfig"

View File

@ -66,22 +66,17 @@ ifneq (,$(filter periph_i2c,$(USEMODULE)))
endif endif
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))) ifneq (,$(filter esp_now esp_wifi esp_spi_ram,$(USEMODULE)))
# the ESP-IDF heap has to be used if SPI RAM is used # the ESP-IDF heap has to be used if SPI RAM is used
USEMODULE += esp_idf_heap USEMODULE += esp_idf_heap
endif endif
ifneq (,$(filter mtd,$(USEMODULE))) ifneq (,$(filter esp_spi_ram,$(USEMODULE)))
USEMODULE += esp_idf_spi_flash FEATURES_REQUIRED += esp_spi_ram
endif endif
ifneq (,$(filter ndn-riot,$(USEPKG))) ifneq (,$(filter mtd,$(USEMODULE)))
USEMODULE += crypto USEMODULE += esp_idf_spi_flash
USEMODULE += cipher_modes
endif endif
ifneq (,$(filter periph_rtc,$(USEMODULE))) ifneq (,$(filter periph_rtc,$(USEMODULE)))
@ -100,3 +95,7 @@ endif
ifneq (,$(filter shell,$(USEMODULE))) ifneq (,$(filter shell,$(USEMODULE)))
USEMODULE += ps USEMODULE += ps
endif endif
ifneq (,$(filter esp_jtag,$(USEMODULE)))
FEATURES_REQUIRED += esp_jtag
endif

View File

@ -11,3 +11,13 @@ FEATURES_PROVIDED += periph_rtc
FEATURES_PROVIDED += periph_rtt FEATURES_PROVIDED += periph_rtt
FEATURES_PROVIDED += periph_rtt_set_counter FEATURES_PROVIDED += periph_rtt_set_counter
FEATURES_PROVIDED += periph_rtt_overflow 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))
KCONFIG_ADD_CONFIG += $(RIOTCPU)/esp32/esp32.config
endif

View File

@ -48,10 +48,6 @@ ifneq (,$(filter esp_eth,$(USEMODULE)))
INCLUDES += -I$(ESP32_SDK_DIR)/components/ethernet/include INCLUDES += -I$(ESP32_SDK_DIR)/components/ethernet/include
endif endif
ifneq (,$(filter esp_jtag,$(USEMODULE)))
FEATURES_REQUIRED += esp_jtag
endif
CFLAGS += -DSDK_NOT_USED -DCONFIG_FREERTOS_UNICORE=1 -DESP_PLATFORM CFLAGS += -DSDK_NOT_USED -DCONFIG_FREERTOS_UNICORE=1 -DESP_PLATFORM
CFLAGS += -DLOG_TAG_IN_BRACKETS CFLAGS += -DLOG_TAG_IN_BRACKETS
@ -74,7 +70,7 @@ ifneq (,$(filter esp_now,$(USEMODULE)))
ARCHIVES += -lespnow -lmesh ARCHIVES += -lespnow -lmesh
endif endif
ifneq (,$(filter cpp,$(FEATURES_USED))) ifneq (,$(filter cpp,$(USEMODULE)))
ARCHIVES += -lstdc++ ARCHIVES += -lstdc++
endif endif

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

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

30
cpu/esp32/periph/Kconfig Normal file
View File

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

View File

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

26
cpu/esp32/vendor/esp-idf/Kconfig vendored Normal file
View File

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

11
cpu/esp32/vendor/esp-idf/driver/Kconfig vendored Normal file
View File

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

11
cpu/esp32/vendor/esp-idf/esp32/Kconfig vendored Normal file
View File

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

View File

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

View File

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

11
cpu/esp32/vendor/esp-idf/heap/Kconfig vendored Normal file
View File

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

View File

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

11
cpu/esp32/vendor/esp-idf/soc/Kconfig vendored Normal file
View File

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

View File

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

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.
#
rsource "port/Kconfig"
rsource "src/crypto/Kconfig"
rsource "src/wpa2/Kconfig"

View File

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

View File

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

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.
#
rsource "eap_peer/Kconfig"
rsource "tls/Kconfig"
rsource "utils/Kconfig"

View File

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

View File

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

View File

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

View File

@ -19,6 +19,17 @@ config CPU_FAM_ESP8266
select HAS_PERIPH_RTT_OVERFLOW select HAS_PERIPH_RTT_OVERFLOW
select HAS_PERIPH_RTT_SET_COUNTER 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 ## CPU Models
config CPU_MODEL_ESP8266EX config CPU_MODEL_ESP8266EX
bool bool
@ -54,3 +65,11 @@ config CPU
default "esp8266" if CPU_FAM_ESP8266 default "esp8266" if CPU_FAM_ESP8266
source "$(RIOTCPU)/esp_common/Kconfig" 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"

View File

@ -9,3 +9,9 @@ FEATURES_PROVIDED += periph_rtt
FEATURES_PROVIDED += periph_rtc FEATURES_PROVIDED += periph_rtc
FEATURES_PROVIDED += periph_rtt_overflow FEATURES_PROVIDED += periph_rtt_overflow
FEATURES_PROVIDED += periph_rtt_set_counter 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

View File

@ -0,0 +1,2 @@
CONFIG_MODULE_MTD=y
CONFIG_MODULE_PS=y

11
cpu/esp8266/sdk/Kconfig Normal file
View File

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

9
cpu/esp8266/vendor/Kconfig vendored Normal file
View File

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

11
cpu/esp8266/vendor/esp-gdbstub/Kconfig vendored Normal file
View File

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

18
cpu/esp8266/vendor/esp-idf/Kconfig vendored Normal file
View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -56,6 +56,56 @@ config HAS_ARCH_ESP
help help
Indicates that an 'ESP' architecture is being used. 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 ## Common CPU symbols
config CPU_ARCH config CPU_ARCH
default "xtensa" if CPU_ARCH_XTENSA 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"

View File

@ -9,10 +9,13 @@ USEMODULE += esp_idf
USEMODULE += log USEMODULE += log
USEMODULE += periph USEMODULE += periph
USEMODULE += periph_hwrng USEMODULE += periph_hwrng
USEMODULE += periph_flash
USEMODULE += periph_uart USEMODULE += periph_uart
USEMODULE += random USEMODULE += random
ifneq (,$(filter mtd,$(USEMODULE)))
USEMODULE += periph_flash
endif
ifeq (,$(filter stdio_% slipdev_stdio,$(USEMODULE))) ifeq (,$(filter stdio_% slipdev_stdio,$(USEMODULE)))
USEMODULE += stdio_uart USEMODULE += stdio_uart
endif endif
@ -82,10 +85,3 @@ ifneq (,$(filter esp_wifi_any,$(USEMODULE)))
USEMODULE += netopt USEMODULE += netopt
USEMODULE += xtimer USEMODULE += xtimer
endif 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

View File

@ -19,3 +19,9 @@ FEATURES_PROVIDED += ssp
FEATURES_CONFLICT += esp_wifi_ap:esp_now FEATURES_CONFLICT += esp_wifi_ap:esp_now
FEATURES_CONFLICT_MSG += "ESP_NOW and ESP_WIFI_AP can not be used at the same time." 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

View File

@ -88,10 +88,14 @@ LINKFLAGS += -L$(ESP_SDK_DIR)/components/$(CPU)/lib
endif endif
LINKFLAGS += -nostdlib -Wl,-gc-sections -Wl,-static 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
# use the wrapper functions for calloc to add correct overflow detection missing # in the newlib's version.
# in the newlib's version. LINKFLAGS += -Wl,-wrap,_calloc_r
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 endif
# LINKFLAGS += -Wl,--verbose # LINKFLAGS += -Wl,--verbose

View File

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

View File

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

View File

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

View File

@ -18,8 +18,6 @@
* @} * @}
*/ */
#if MODULE_MTD
#include <assert.h> #include <assert.h>
#include <errno.h> #include <errno.h>
#include <string.h> #include <string.h>
@ -568,5 +566,3 @@ static int _flash_power (mtd_dev_t *dev, enum mtd_power_state power)
return -ENOTSUP; return -ENOTSUP;
} }
#endif /* MODULE_MTD */

15
cpu/esp_common/vendor/xtensa/Kconfig vendored Normal file
View File

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

View File

@ -11,6 +11,3 @@ config MODULE_AIP31068
depends on TEST_KCONFIG depends on TEST_KCONFIG
select MODULE_XTIMER select MODULE_XTIMER
select MODULE_PERIPH_I2C select MODULE_PERIPH_I2C
# necessary to fix driver initialization on esp32
# TODO: move this to ESP32
select MODULE_ESP_I2C_HW if CPU_ESP32

View File

@ -30,3 +30,5 @@ config MODULE_PERIPH_INIT_I2C_RECONFIGURE
depends on MODULE_PERIPH_I2C_RECONFIGURE depends on MODULE_PERIPH_I2C_RECONFIGURE
endif # MODULE_PERIPH_I2C endif # MODULE_PERIPH_I2C
osource "$(RIOTCPU)/$(CPU)/periph/Kconfig.i2c"

View File

@ -10,6 +10,5 @@ config MODULE_RTT_RTC
depends on HAS_PERIPH_RTT depends on HAS_PERIPH_RTT
depends on TEST_KCONFIG depends on TEST_KCONFIG
select MODULE_PERIPH_RTT select MODULE_PERIPH_RTT
select HAS_PERIPH_RTC # provides RTC
help help
Basic RTC implementation based on a RTT. Basic RTC implementation based on a RTT.

View File

@ -16,10 +16,15 @@ ifneq (,$(filter periph_init, $(USEMODULE)))
periph_common \ periph_common \
periph_flexcomm \ periph_flexcomm \
periph_gpio_mux \ periph_gpio_mux \
periph_i2c_hw \
periph_i2c_sw \
periph_rtc_ms \ periph_rtc_ms \
periph_mcg \ periph_mcg \
periph_wdog \ periph_wdog \
periph_flash \
periph_rtc_rtt \ periph_rtc_rtt \
periph_rtt_hw_rtc \
periph_rtt_hw_sys \
periph_clic \ periph_clic \
periph_coretimer \ periph_coretimer \
periph_plic \ periph_plic \

View File

@ -17,6 +17,7 @@ rsource "driver_bme680/Kconfig"
rsource "driver_sx126x/Kconfig" rsource "driver_sx126x/Kconfig"
rsource "elk/Kconfig" rsource "elk/Kconfig"
rsource "emlearn/Kconfig" rsource "emlearn/Kconfig"
rsource "esp8266_sdk/Kconfig"
rsource "fff/Kconfig" rsource "fff/Kconfig"
rsource "gecko_sdk/Kconfig" rsource "gecko_sdk/Kconfig"
rsource "gemmlowp/Kconfig" rsource "gemmlowp/Kconfig"

11
pkg/esp8266_sdk/Kconfig Normal file
View File

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

View File

@ -5,28 +5,32 @@
# directory for more details. # directory for more details.
# #
choice
menuconfig MODULE_LOG
bool "Logging system override" bool "Logging system override"
optional
depends on TEST_KCONFIG depends on TEST_KCONFIG
help help
Say y to override the default logging functions. For more information see Say y to override the default logging functions. For more information see
core/include/log.h. core/include/log.h.
choice LOG_BACKEND
bool "Implementation"
depends on MODULE_LOG
config MODULE_LOG_COLOR config MODULE_LOG_COLOR
bool "Colored output" bool "Colored output"
select MODULE_LOG
help help
Implements a logging module with colored output. Implements a logging module with colored output.
config MODULE_LOG_PRINTFNOFORMAT config MODULE_LOG_PRINTFNOFORMAT
bool "puts-based log" bool "puts-based log"
select MODULE_LOG
help help
Logging is implemented using puts instead of printf. Use it where printf Logging is implemented using puts instead of printf. Use it where printf
might be too heavy. This also serves as an example for logging might be too heavy. This also serves as an example for logging
implementation. implementation.
endchoice endchoice
config MODULE_LOG
bool
help
Modules that override the default log implementation shoul select this.
For more information see core/include/log.h.

View File

@ -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))) ifneq (,$(filter log_printfnoformat,$(USEMODULE)))
USEMODULE_INCLUDES += $(RIOTBASE)/sys/log/log_printfnoformat USEMODULE_INCLUDES += $(RIOTBASE)/sys/log/log_printfnoformat
endif endif