Skip to content

boards/esp32-wt32-sc01-plus: fix I2C driver selection in Kconfig #19945

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

Merged
merged 1 commit into from
Sep 26, 2023

Conversation

gschorcht
Copy link
Contributor

@gschorcht gschorcht commented Sep 25, 2023

Contribution description

This PR fixes the Kconfig mismatch for the I2C peripheral driver selection for the esp32s3-wt32-sc01-plus board.

Testing procedure

python3 dist/tools/compile_test/compile_like_murdock.py -a tests/periph/i2c -b esp32s3-wt32-sc01-plus

fails w/o this PR

tests/periph/i2c               esp32s3-wt32-sc01-plus         FAIL: Kconfig module or pkg mismatch

and should succeed with this PR

tests/periph/i2c               esp32s3-wt32-sc01-plus         PASS

Issues/PRs references

@github-actions github-actions bot added Platform: ESP Platform: This PR/issue effects ESP-based platforms Area: cpu Area: CPU/MCU ports labels Sep 25, 2023
@gschorcht gschorcht added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Sep 25, 2023
@riot-ci
Copy link

riot-ci commented Sep 25, 2023

Murdock results

✔️ PASSED

7a94c74 boards/esp32s3-wt32-sc01-plus: fix I2C driver selection in Kconfig

Success Failures Total Runtime
521 0 521 03m:48s

Artifacts

@@ -10,6 +10,7 @@ if TEST_KCONFIG
choice ESP32_I2C_IMPLEMENTATION
bool "I2C implementation"
depends on MODULE_PERIPH_I2C
default MODULE_ESP_I2C_HW if BOARD_ESP32S3_WT32_SC01_PLUS
Copy link
Contributor

@aabadie aabadie Sep 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks strange to have a board related dependency resolution at cpu level. I would rather add the following in boards/esp32s3_wt32_sc01_plus/Kconfig:

     select MODULE_ESP_I2C_HW if MODULE_PERIPH_I2C

@MrKevinWeiss, any opinion?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks strange to have a board related dependency resolution at cpu level.

Agreed and I tried it exactly in that way but it threw an error:

=== [ATTENTION] Testing Kconfig dependency modelling ===
[genconfig.py]:ERROR-Treating Kconfig warnings as errors:
[genconfig.py]:ERROR-=> warning: the choice symbol MODULE_ESP_I2C_HW (defined at cpu/esp32/periph/Kconfig.i2c:21) is selected by the following symbols, but select/imply has no effect on choice symbols
 - BOARD_ESP32S3_WT32_SC01_PLUS (defined at boards/esp32s3-wt32-sc01-plus/Kconfig:11)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be a possible approach to define a symbol BOARD_REQUIRES_ESP_I2C_HW which selects MODULE_ESP_I2C_HW as default for the ESP32_I2C_IMPLEMENTATION and to set it by that board?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case you should actually use a default choice override in the board.

You cannot select choice options directly in kconfig

in boards/esp32s3_wt32_sc01_plus/Kconfig:

choice ESP32_I2C_IMPLEMENTATION
     default MODULE_ESP_I2C_HW

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

boards/common/esp32x/Kconfig:

+ config BOARD_REQUIRES_ESP_I2C_HW
+     bool
+     help
+       Indicates that the board requires the I2C hardware implementation.

cpu/esp32/periph/Kconfig:

  choice ESP32_I2C_IMPLEMENTATION
      bool "I2C implementation"
      depends on MODULE_PERIPH_I2C
+     default MODULE_ESP_I2C_HW if BOARD_REQUIRES_ESP_I2C_HW

boards/esp32s3-wt32-sc01-plus/Kconfig:

  config BOARD_ESP32S3_WT32_SC01_PLUS
      bool
      default y
+     select BOARD_REQUIRES_ESP_I2C_HW

@gschorcht
Copy link
Contributor Author

Maybe it is time to change the default I2C driver for the ESP32-S3 to the hardware driver, which had some problems on the ESP32 but seems to work fine on the ESP32-S3. It would have to be tested a bit more.

Copy link
Contributor

@MrKevinWeiss MrKevinWeiss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't tested it though...

@@ -10,6 +10,7 @@ if TEST_KCONFIG
choice ESP32_I2C_IMPLEMENTATION
bool "I2C implementation"
depends on MODULE_PERIPH_I2C
default MODULE_ESP_I2C_HW if BOARD_ESP32S3_WT32_SC01_PLUS
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case you should actually use a default choice override in the board.

You cannot select choice options directly in kconfig

in boards/esp32s3_wt32_sc01_plus/Kconfig:

choice ESP32_I2C_IMPLEMENTATION
     default MODULE_ESP_I2C_HW

@gschorcht gschorcht force-pushed the boards/esp32s3-wt2-sc01-plus branch from 7b50f2d to 282873c Compare September 25, 2023 11:46
@gschorcht gschorcht requested a review from jia200x as a code owner September 25, 2023 11:46
@github-actions github-actions bot added Area: boards Area: Board ports Area: Kconfig Area: Kconfig integration and removed Platform: ESP Platform: This PR/issue effects ESP-based platforms Area: cpu Area: CPU/MCU ports labels Sep 25, 2023
@gschorcht
Copy link
Contributor Author

In this case you should actually use a default choice override in the board.

You cannot select choice options directly in kconfig

in boards/esp32s3_wt32_sc01_plus/Kconfig:

choice ESP32_I2C_IMPLEMENTATION
     default MODULE_ESP_I2C_HW

Ok, I did it in that way. I squashed it directly.

@gschorcht gschorcht changed the title cpu/esp32/periph: fix I2C driver selection in Kconfig for the esp32s3-wt32-sc01-plus board boards/esp32-wt32-sc01-plus: fix I2C driver selection in Kconfig Sep 26, 2023
@gschorcht gschorcht force-pushed the boards/esp32s3-wt2-sc01-plus branch from 282873c to 7a94c74 Compare September 26, 2023 02:15
Copy link
Contributor

@MrKevinWeiss MrKevinWeiss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK

@MrKevinWeiss
Copy link
Contributor

bors merge

@bors
Copy link
Contributor

bors bot commented Sep 26, 2023

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@bors bors bot merged commit 4669ee6 into RIOT-OS:master Sep 26, 2023
@gschorcht
Copy link
Contributor Author

Thanks for pointing out how it has to be realized and merging it.

@gschorcht gschorcht deleted the boards/esp32s3-wt2-sc01-plus branch September 26, 2023 10:56
@MrKevinWeiss MrKevinWeiss added this to the Release 2023.10 milestone Nov 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: boards Area: Board ports Area: Kconfig Area: Kconfig integration CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants