-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tests/external-boards: add esp compile test boards #17525
tests/external-boards: add esp compile test boards #17525
Conversation
@gschorcht if this works for you we could add these BOARDs to all applications where it would make sense! |
@fjmolinas I'm absolutely fine with if it works in that way. Maybe we should use more the more generic boards |
BTW I also want to mention (@leandrolanzieri asked about this offline) that if build time is a concern we could also have gone with #12971 but with only a single BOARD on the whitelist to achieve the same. |
@fjmolinas The discussion about the virtual boards can be found in #17305 (comment) and following.
@benpicco's concern with PR #12971 was having full copies of test applications only for testing optional modules #12971 (review). |
Just to sum some things up:
Some possible solutions would be:
Some questions are:
We should try to get a solution some point soon at least. I see many out there... |
I personally like this virtual BOARD solution, I think it avoids cluttering the test directory and is something I was already suggesting in #12952. But this is only valid if we only want a compile test, if you would also |
Hmm, good question. Having a virtual board to cover optional modules in CI compilation would be a big step forward. Sure, optional modules that enable additional hardware like |
We should add some more tests for this board. |
I think we have on-target testing during nightlies for an esp32. If there were a test specifically for that then things like That being said, having a clean solution that we can point saying "here is how a virtual board is implemented" is probably a good thing, especially if we can mark it. I am sure that others will require something like that. For that reason I would say we go ahead with this idea. |
That being said, having a clean solution that we can point saying "here is how a virtual board is implemented" is probably a good thing, especially if we can mark it. I am sure that others will require something like that. For that reason I would say we go ahead with this idea. Ok, @MrKevinWeiss you had started modelling the Kconfig part in the PR that spawned this one, do you still have that somewhere? |
cough cough... I don't think so but also it wasn't done very well. I can provide a suggestion though, (before lunch) |
I guess that during the nightlies a |
I think to hit that one on hardware I would just add a test specifically for that board, we can do that with a seperate PR I suppose. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got something, it ain't pretty though...
diff --git a/.murdock b/.murdock
index c6f2b70f14..223370a237 100755
--- a/.murdock
+++ b/.murdock
@@ -31,7 +31,9 @@ cc1352-launchpad
cc2650-launchpad
derfmega128
dwm1001
+esp32-ci
esp32-heltec-lora32-v2
+esp8266-ci
esp8266-esp-12x
hamilton
hifive1
@@ -88,6 +90,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
diff --git a/boards/esp32-wrover-kit/Makefile.features b/boards/esp32-wrover-kit/Makefile.features
index 17054e8466..8724400f59 100644
--- a/boards/esp32-wrover-kit/Makefile.features
+++ b/boards/esp32-wrover-kit/Makefile.features
@@ -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_ADD_CONFIG += $(BOARDDIR)/esp32-wrover-kit.config
+ KCONFIG_ADD_CONFIG += $(BOARDDIR)/$(BOARD).config
endif
diff --git a/cpu/esp32/periph/Kconfig b/cpu/esp32/periph/Kconfig
index d9beb65cac..f3ecf0738b 100644
--- a/cpu/esp32/periph/Kconfig
+++ b/cpu/esp32/periph/Kconfig
@@ -27,4 +27,9 @@ 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
diff --git a/cpu/esp32/periph/Kconfig.i2c b/cpu/esp32/periph/Kconfig.i2c
index fbbce1598b..fb4daba14b 100644
--- a/cpu/esp32/periph/Kconfig.i2c
+++ b/cpu/esp32/periph/Kconfig.i2c
@@ -7,7 +7,7 @@
if TEST_KCONFIG
-choice
+choice ESP32_I2C_IMPLEMENTATION
bool "I2C implementation"
depends on MODULE_PERIPH_I2C
help
diff --git a/cpu/esp8266/Kconfig b/cpu/esp8266/Kconfig
index 076fb92561..175c85b9dc 100644
--- a/cpu/esp8266/Kconfig
+++ b/cpu/esp8266/Kconfig
@@ -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"
diff --git a/cpu/esp_common/Kconfig b/cpu/esp_common/Kconfig
index aef54697a0..cf5180cbd5 100644
--- a/cpu/esp_common/Kconfig
+++ b/cpu/esp_common/Kconfig
@@ -111,6 +111,13 @@ config MODULE_ESP_LOG_STARTUP
endmenu
+config MODULE_ESP_HW_COUNTER
+ bool "Use hardware counter"
+ depends on MODULE_PERIPH_TIMER
+
+config MODULE_ESP_QEMU
+ bool "Simulate ESP with QEMU"
+
endif # TEST_KCONFIG
rsource "freertos/Kconfig"
diff --git a/tests/external_board_dirs/esp-ci-boards/esp32-ci/Kconfig b/tests/external_board_dirs/esp-ci-boards/esp32-ci/Kconfig
new file mode 100644
index 0000000000..2a9b3553b5
--- /dev/null
+++ b/tests/external_board_dirs/esp-ci-boards/esp32-ci/Kconfig
@@ -0,0 +1,49 @@
+# 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 MODULE_ESP_IDF_HEAP if TEST_KCONFIG
+ select MODULE_ESP_LOG_STARTUP if TEST_KCONFIG
+ select MODULE_ESP_LOG_TAGGED if TEST_KCONFIG
+ select MODULE_ESP_QEMU if TEST_KCONFIG
+ select MODULE_ESP_SPI_RAM if TEST_KCONFIG
+ select MODULE_ESP_HW_COUNTER if MODULE_PERIPH_TIMER
+
+ select HAVE_ILI9341
+
+
+if TEST_KCONFIG
+
+choice ESP32_I2C_IMPLEMENTATION
+ bool "I2C implementation"
+ depends on MODULE_PERIPH_I2C
+ default MODULE_ESP_I2C_HW
+ help
+ Due to the poor and faulty hardware I2C implementation the software one
+ is used by default for the moment.
+
+endchoice
+
+
+endif # TEST_KCONFIG
+
+source "$(RIOTBOARD)/common/esp32/Kconfig"
diff --git a/tests/external_board_dirs/esp-ci-boards/esp32-ci/esp32-ci.config b/tests/external_board_dirs/esp-ci-boards/esp32-ci/esp32-ci.config
new file mode 100644
index 0000000000..2b24cf45d3
--- /dev/null
+++ b/tests/external_board_dirs/esp-ci-boards/esp32-ci/esp32-ci.config
@@ -0,0 +1,2 @@
+# Sets up configuration for openocd
+CONFIG_MODULE_ESP_JTAG=y
diff --git a/tests/external_board_dirs/esp-ci-boards/esp8266-ci/Kconfig b/tests/external_board_dirs/esp-ci-boards/esp8266-ci/Kconfig
new file mode 100644
index 0000000000..9e7c52e1c0
--- /dev/null
+++ b/tests/external_board_dirs/esp-ci-boards/esp8266-ci/Kconfig
@@ -0,0 +1,23 @@
+# 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
+
+ select MODULE_ESP_LOG_TAGGED if TEST_KCONFIG
+ select MODULE_ESP_LOG_STARTUP if TEST_KCONFIG
+ select MODULE_ESP_QEMU if TEST_KCONFIG
+ select MODULE_ESP_SW_TIMER if MODULE_PERIPH_TIMER
+
+
+
+source "$(RIOTBOARD)/common/esp8266/Kconfig"
Some things that are up for discussion are: Also the use of the I also don't know where we stand on the whole board selecting a module thing... For such simple modules maybe it make sense to keep it like that. The final thing would be a general comment about the esp sw/hw choices. It seems like some are selectable and some are not. For example, ESP32_I2C_IMPLEMENTATION can be hardware or software. Would it make sense to have something like that for |
OK, after talking with @leandrolanzieri I think this is better (and I was able to test it locally) diff --git a/.murdock b/.murdock
index c6f2b70f14..223370a237 100755
--- a/.murdock
+++ b/.murdock
@@ -31,7 +31,9 @@ cc1352-launchpad
cc2650-launchpad
derfmega128
dwm1001
+esp32-ci
esp32-heltec-lora32-v2
+esp8266-ci
esp8266-esp-12x
hamilton
hifive1
@@ -88,6 +90,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
diff --git a/boards/esp32-wrover-kit/Makefile.features b/boards/esp32-wrover-kit/Makefile.features
index 17054e8466..8724400f59 100644
--- a/boards/esp32-wrover-kit/Makefile.features
+++ b/boards/esp32-wrover-kit/Makefile.features
@@ -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_ADD_CONFIG += $(BOARDDIR)/esp32-wrover-kit.config
+ KCONFIG_ADD_CONFIG += $(BOARDDIR)/$(BOARD).config
endif
diff --git a/cpu/esp32/periph/Kconfig b/cpu/esp32/periph/Kconfig
index d9beb65cac..ec121a59e2 100644
--- a/cpu/esp32/periph/Kconfig
+++ b/cpu/esp32/periph/Kconfig
@@ -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
diff --git a/cpu/esp32/periph/Kconfig.i2c b/cpu/esp32/periph/Kconfig.i2c
index fbbce1598b..fb4daba14b 100644
--- a/cpu/esp32/periph/Kconfig.i2c
+++ b/cpu/esp32/periph/Kconfig.i2c
@@ -7,7 +7,7 @@
if TEST_KCONFIG
-choice
+choice ESP32_I2C_IMPLEMENTATION
bool "I2C implementation"
depends on MODULE_PERIPH_I2C
help
diff --git a/cpu/esp8266/Kconfig b/cpu/esp8266/Kconfig
index 076fb92561..175c85b9dc 100644
--- a/cpu/esp8266/Kconfig
+++ b/cpu/esp8266/Kconfig
@@ -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"
diff --git a/cpu/esp_common/Kconfig b/cpu/esp_common/Kconfig
index aef54697a0..c6668b1f6c 100644
--- a/cpu/esp_common/Kconfig
+++ b/cpu/esp_common/Kconfig
@@ -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"
diff --git a/tests/external_board_dirs/esp-ci-boards/esp32-ci/Kconfig b/tests/external_board_dirs/esp-ci-boards/esp32-ci/Kconfig
new file mode 100644
index 0000000000..5406aa99aa
--- /dev/null
+++ b/tests/external_board_dirs/esp-ci-boards/esp32-ci/Kconfig
@@ -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"
diff --git a/tests/external_board_dirs/esp-ci-boards/esp32-ci/esp32-ci.config b/tests/external_board_dirs/esp-ci-boards/esp32-ci/esp32-ci.config
new file mode 100644
index 0000000000..4586b7c158
--- /dev/null
+++ b/tests/external_board_dirs/esp-ci-boards/esp32-ci/esp32-ci.config
@@ -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
diff --git a/tests/external_board_dirs/esp-ci-boards/esp8266-ci/Kconfig b/tests/external_board_dirs/esp-ci-boards/esp8266-ci/Kconfig
new file mode 100644
index 0000000000..f791329e25
--- /dev/null
+++ b/tests/external_board_dirs/esp-ci-boards/esp8266-ci/Kconfig
@@ -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"
diff --git a/tests/external_board_dirs/esp-ci-boards/esp8266-ci/Makefile.features b/tests/external_board_dirs/esp-ci-boards/esp8266-ci/Makefile.features
index 5ebe212f55..2ad25ff5c4 100644
--- a/tests/external_board_dirs/esp-ci-boards/esp8266-ci/Makefile.features
+++ b/tests/external_board_dirs/esp-ci-boards/esp8266-ci/Makefile.features
@@ -1 +1,5 @@
include $(RIOTBOARD)/esp8266-olimex-mod/Makefile.features
+
+ifeq (1, $(TEST_KCONFIG))
+ KCONFIG_ADD_CONFIG += $(BOARDDIR)/$(BOARD).config
+endif
diff --git a/tests/external_board_dirs/esp-ci-boards/esp8266-ci/esp8266-ci.config b/tests/external_board_dirs/esp-ci-boards/esp8266-ci/esp8266-ci.config
new file mode 100644
index 0000000000..e846e7274f
--- /dev/null
+++ b/tests/external_board_dirs/esp-ci-boards/esp8266-ci/esp8266-ci.config
@@ -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 |
33be1a2
to
0036090
Compare
I applied your suggestion, and rebased to fix the conflict |
This is the last piece to the kconfig puzzle. It seems that there is only one issue:
This doesn't really even seem to be part of this board issue... The fact that there is no module difference is a bit odd. If nobody looks at this then I can give it a try tomorrow. |
Maybe it would also be good to see if anyone is against the concept? |
Hmm I cannot reproduce this locally... Maybe a rebase and remove the esp boards from the You may squash if you choose. |
Lets give it another run then, I've seen some spurious failures in murdock recently |
@gschorcht could you suggest an adequate list? |
@MrKevinWeiss failures are because of disk errors, should I just squash? |
Yes please |
This adds esp board clones for compile testing
0036090
to
a19fc10
Compare
I think we can expand on a follow up as well :) |
All green @MrKevinWeiss |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK
We can also remove the esps from the blocklist but we can save that for a later PR, the merge conflicts are real.... |
Contribution description
This PR wants to remove the dependencies against
RIOT_CI_BUILD
, it does so by addingesp
BOARD clones that have the same dependencies added in #17314.It currently only adds those BOARDs to
tests/periph_timer
, but it can be done for all tests where this would make sense @gschorcht should know which ones.TODO:
Testing procedure
The new BOARDs show up
make -C tests/periph_i2c/ info-boards | grep esp8266-ci
Murdock should build them
Check that the required modules are included.
Issues/PRs references
Came up in #17467
Related to #17314 and #12971