Skip to content

Commit

Permalink
Merge pull request #17525 from fjmolinas/pr_esp_compile_test_boards
Browse files Browse the repository at this point in the history
[POC] tests/external-boards: add esp compile test boards
  • Loading branch information
MrKevinWeiss authored Feb 10, 2022
2 parents 3897be6 + a19fc10 commit d97eed5
Show file tree
Hide file tree
Showing 22 changed files with 165 additions and 53 deletions.
3 changes: 3 additions & 0 deletions .murdock
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ cc1352-launchpad
cc2650-launchpad
derfmega128
dwm1001
esp32-ci
esp32-heltec-lora32-v2
esp8266-ci
esp8266-esp-12x
hamilton
hifive1
Expand Down Expand Up @@ -89,6 +91,7 @@ tests/driver_s*
tests/driver_t*
tests/driver_u*
tests/driver_v*
tests/external_board_dirs
tests/periph_*
tests/pkg_elk
tests/pkg_uzlib
Expand Down
30 changes: 0 additions & 30 deletions boards/esp32-wrover-kit/Makefile.dep
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,4 @@ endif
# Sets up configuration for openocd
USEMODULE += esp_jtag

# if compiled in CI, optional modules are selected for compile tests
ifneq (,$(RIOT_CI_BUILD))
USEMODULE += esp_idf_heap
USEMODULE += esp_log_startup
USEMODULE += esp_log_tagged
USEMODULE += esp_qemu
USEMODULE += esp_spi_ram

ifneq (,$(filter periph_i2c,$(USEMODULE)))
USEMODULE += esp_i2c_hw
endif

ifneq (,$(filter periph_timer,$(USEMODULE)))
USEMODULE += esp_hw_counter
endif

ifneq (,$(filter netdev_default,$(USEMODULE)))
# if netdev_default is used, we use gnrc modules that are enabled
# in different examples to use different esp_wifi modules
ifneq (,$(filter gnrc_netif_single,$(USEMODULE)))
# if gnrc_netif_single module is enabled, esp_wifi_enterprise is used
USEMODULE += esp_wifi_enterprise
else
# in all other case esp_wifi_ap is enabled
USEMODULE += esp_wifi_ap
endif
endif

endif

include $(RIOTBOARD)/common/esp32/Makefile.dep
2 changes: 1 addition & 1 deletion boards/esp32-wrover-kit/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ FEATURES_PROVIDED += arduino
# This configuration enables modules that are only available when using Kconfig
# module modelling
ifeq (1, $(TEST_KCONFIG))
KCONFIG_BOARD_CONFIG += $(BOARDDIR)/esp32-wrover-kit.config
KCONFIG_BOARD_CONFIG += $(BOARDDIR)/$(BOARD).config
endif
21 changes: 0 additions & 21 deletions boards/esp8266-olimex-mod/Makefile.dep
Original file line number Diff line number Diff line change
@@ -1,22 +1 @@
# if compiled in CI, optional modules are selected for compile tests
ifneq (,$(RIOT_CI_BUILD))
USEMODULE += esp_log_tagged
USEMODULE += esp_log_startup
USEMODULE += esp_qemu

ifneq (,$(filter periph_timer,$(USEMODULE)))
USEMODULE += esp_sw_timer
endif

ifneq (,$(filter netdev_default,$(USEMODULE)))
# if netdev_default is used, we use gnrc modules that are enabled
# in different examples to use different esp_wifi modules
ifeq (,$(filter gnrc_netif_single,$(USEMODULE)))
# if gnrc_netif_single module is not enabled, esp_wifi_ap is used
USEMODULE += esp_wifi_ap
endif
endif

endif

include $(RIOTBOARD)/common/esp8266/Makefile.dep
4 changes: 4 additions & 0 deletions cpu/esp32/periph/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,8 @@ config MODULE_PERIPH_RTT_HW_RTC
bool
default y if MODULE_PERIPH_RTT

config MODULE_ESP_HW_COUNTER
bool "Use hardware counter"
depends on MODULE_PERIPH_TIMER

endif # TEST_KCONFIG
2 changes: 1 addition & 1 deletion cpu/esp32/periph/Kconfig.i2c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

if TEST_KCONFIG

choice
choice ESP32_I2C_IMPLEMENTATION
bool "I2C implementation"
depends on MODULE_PERIPH_I2C
help
Expand Down
4 changes: 4 additions & 0 deletions cpu/esp8266/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,9 @@ config MODULE_ESP_I2C_SW
default y if MODULE_PERIPH_I2C
select MODULE_PERIPH_I2C_SW

config MODULE_ESP_SW_TIMER
bool "Use software timer"
depends on MODULE_PERIPH_TIMER

rsource "sdk/Kconfig"
rsource "vendor/Kconfig"
3 changes: 3 additions & 0 deletions cpu/esp_common/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ config MODULE_ESP_LOG_STARTUP

endmenu

config MODULE_ESP_QEMU
bool "Simulate ESP with QEMU"

endif # TEST_KCONFIG

rsource "freertos/Kconfig"
Expand Down
1 change: 1 addition & 0 deletions tests/external_board_dirs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ FEATURES_REQUIRED += arch_native
# Set without '?=' to also verify the docker integration when set with =
EXTERNAL_BOARD_DIRS = $(CURDIR)/external_board_dir_1
EXTERNAL_BOARD_DIRS += $(CURDIR)/external_board_dir_2
EXTERNAL_BOARD_DIRS += $(CURDIR)/esp-ci-boards

include $(RIOTBASE)/Makefile.include
38 changes: 38 additions & 0 deletions tests/external_board_dirs/esp-ci-boards/esp32-ci/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Copyright (c) 2020 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 BOARD
default "esp32-ci" if BOARD_ESP32_CI

config BOARD_ESP32_CI
bool
default y
select BOARD_COMMON_ESP32
select CPU_MODEL_ESP32_WROVER
select HAS_ARDUINO
select HAS_ESP_RTC_TIMER_32K
select HAS_ESP_JTAG
select HAS_PERIPH_ADC
select HAS_PERIPH_I2C
select HAS_PERIPH_PWM
select HAS_PERIPH_SPI
select HAS_SDCARD_SPI

select HAVE_ILI9341

if TEST_KCONFIG

choice ESP32_I2C_IMPLEMENTATION
default MODULE_ESP_I2C_HW
endchoice

config MODULE_ESP_HW_COUNTER
default y
depends on MODULE_PERIPH_TIMER

endif # TEST_KCONFIG

source "$(RIOTBOARD)/common/esp32/Kconfig"
6 changes: 6 additions & 0 deletions tests/external_board_dirs/esp-ci-boards/esp32-ci/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# This must be a different name than 'board' as it is implemented by 'esp32-wrover-kit'
MODULE = board_esp32-ci

DIRS += $(RIOTBOARD)/esp32-wrover-kit

include $(RIOTBASE)/Makefile.base
30 changes: 30 additions & 0 deletions tests/external_board_dirs/esp-ci-boards/esp32-ci/Makefile.dep
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This must be a different name than 'board' as it is implemented by 'esp32-wrover-kit'
USEMODULE += board_esp32-ci

USEMODULE += esp_idf_heap
USEMODULE += esp_log_startup
USEMODULE += esp_log_tagged
USEMODULE += esp_qemu
USEMODULE += esp_spi_ram

ifneq (,$(filter periph_i2c,$(USEMODULE)))
USEMODULE += esp_i2c_hw
endif

ifneq (,$(filter periph_timer,$(USEMODULE)))
USEMODULE += esp_hw_counter
endif

ifneq (,$(filter netdev_default,$(USEMODULE)))
# if netdev_default is used, we use gnrc modules that are enabled
# in different examples to use different esp_wifi modules
ifneq (,$(filter gnrc_netif_single,$(USEMODULE)))
# if gnrc_netif_single module is enabled, esp_wifi_enterprise is used
USEMODULE += esp_wifi_enterprise
else
# in all other case esp_wifi_ap is enabled
USEMODULE += esp_wifi_ap
endif
endif

include $(RIOTBOARD)/esp32-wrover-kit/Makefile.dep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include $(RIOTBOARD)/esp32-wrover-kit/Makefile.features
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# We must duplicate the include done by $(RIOTBASE)/Makefile.include
# to also include the main board header
INCLUDES += $(addprefix -I,$(wildcard $(RIOTBOARD)/esp32-wrover-kit/include))

include $(RIOTBOARD)/esp32-wrover-kit/Makefile.include
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Sets up configuration for openocd
CONFIG_MODULE_ESP_JTAG=y
CONFIG_MODULE_ESP_IDF_HEAP=y
CONFIG_MODULE_ESP_LOG_STARTUP=y
CONFIG_MODULE_ESP_LOG_TAGGED=y
CONFIG_MODULE_ESP_QEMU=y
CONFIG_MODULE_ESP_SPI_RAM=y
21 changes: 21 additions & 0 deletions tests/external_board_dirs/esp-ci-boards/esp8266-ci/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright (c) 2020 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 BOARD
default "esp8266-ci" if BOARD_ESP8266_CI

config BOARD_ESP8266_CI
bool
default y
select BOARD_COMMON_ESP8266
select CPU_MODEL_ESP8266_ESP_12X

config MODULE_ESP_SW_TIMER
default y
depends on TEST_KCONFIG
depends on MODULE_PERIPH_TIMER

source "$(RIOTBOARD)/common/esp8266/Kconfig"
6 changes: 6 additions & 0 deletions tests/external_board_dirs/esp-ci-boards/esp8266-ci/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# This must be a different name than 'board' as it is implemented by 'esp8266-olimex-mod'
MODULE = board_esp32-ci

DIRS += $(RIOTBOARD)/esp8266-olimex-mod

include $(RIOTBASE)/Makefile.base
18 changes: 18 additions & 0 deletions tests/external_board_dirs/esp-ci-boards/esp8266-ci/Makefile.dep
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
USEMODULE += esp_log_tagged
USEMODULE += esp_log_startup
USEMODULE += esp_qemu

ifneq (,$(filter periph_timer,$(USEMODULE)))
USEMODULE += esp_sw_timer
endif

ifneq (,$(filter netdev_default,$(USEMODULE)))
# if netdev_default is used, we use gnrc modules that are enabled
# in different examples to use different esp_wifi modules
ifeq (,$(filter gnrc_netif_single,$(USEMODULE)))
# if gnrc_netif_single module is not enabled, esp_wifi_ap is used
USEMODULE += esp_wifi_ap
endif
endif

include $(RIOTBOARD)/esp8266-olimex-mod/Makefile.dep
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
include $(RIOTBOARD)/esp8266-olimex-mod/Makefile.features

ifeq (1, $(TEST_KCONFIG))
KCONFIG_ADD_CONFIG += $(BOARDDIR)/$(BOARD).config
endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# We must duplicate the include done by $(RIOTBASE)/Makefile.include
# to also include the main board header
INCLUDES += $(addprefix -I,$(wildcard $(RIOTBOARD)/esp8266-olimex-mod/include))

include $(RIOTBOARD)/esp8266-olimex-mod/Makefile.include
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Sets up configuration for openocd
CONFIG_MODULE_ESP_LOG_STARTUP=y
CONFIG_MODULE_ESP_LOG_TAGGED=y
CONFIG_MODULE_ESP_QEMU=y
2 changes: 2 additions & 0 deletions tests/periph_i2c/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ USEMODULE += xtimer
# avoid running Kconfig by default
SHOULD_RUN_KCONFIG ?=

EXTERNAL_BOARD_DIRS += $(CURDIR)/../external_board_dirs/esp-ci-boards

include $(RIOTBASE)/Makefile.include

0 comments on commit d97eed5

Please sign in to comment.