Skip to content
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

cpu/esp: integrate ESP specific netdev configuration in Kconfig #17426

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

gschorcht
Copy link
Contributor

Contribution description

As the title says, this PR integrates the configuration of the following ESP specific netdevs into Kconfig:

As prerequisites for these changes, the following changes were also included in this PR:

  • shared Kconfig base board definition for all version of esp32-ethernet-kit boards (fe011ac)
  • default configuration definition for esp_wifi in WPA2 Enterprise mode (2550f38)

Additionally, the PR includes some fixes and improvements found during Kconfig migration:

  • updates, improvements and fixes in documentation of esp_wifi and esp_now (2de5eb7)
  • small dependencies cleanup for ESP32 (ead9e33)
  • fix for the optional camera interface for the esp32-wrover-kit board (fe011ac)
  • HAS_* feature definitions in alphabetical order (fc495d2)

The PR depends on PR #17419 and PR #17420. Therefore, the changes of these PRs are included in this PR for the moment (87a72e4 a0f2357 6a136e6 b163768). Once these PRs are merged and this PR is rebased, they are dropped.

Testing procedure

Since GNRC and netdev modelling has not yet been finished, CI can't be used to check for correctness.

  1. Create file examples/gnrc_networking/app.config.test

    CONFIG_MODULE_NETDEV_DEFAULT=y
    
  2. Create file examples/gnrc_networking/Kconfig

    config MODULE_NETOPT
         bool
    
  3. Execute

    TEST_KCONFIG=1 make BOARD=esp32-olimex-evb -C examples/gnrc_networking menuconfig
    TEST_KCONFIG=1 make BOARD=esp8266-esp-12x -C examples/gnrc_networking menuconfig
    

    and check in ESP configurations ---> Network Devices ---> that

    • ESP Ethernet interface used is selected on ESP32 and
    • ESP NOW interface used is selected on ESP8266.
  4. Check in menuconfig for ESP32

    • the submenu for esp_now configuration when ESP-NOW interface used is set
    • the submenu for esp_wifi configuration when ESP Wifi interface used is set
      • when WPA2 Personal Mode is selected
      • when WPA2 Enterprise Mode is selected
      • when SoftAP Mode is selected
  5. Check that the same esp_*, ztimer and netopt modules for

    make BOARD=esp32-olimex-evb -C examples/gnrc_networking info-modules
    USEMODULE=esp_now make BOARD=esp32-olimex-evb -C examples/gnrc_networking info-modules
    USEMODULE=esp_wifi make BOARD=esp32-olimex-evb -C examples/gnrc_networking info-modules
    USEMODULE=esp_wifi_ap make BOARD=esp32-olimex-evb -C examples/gnrc_networking info-modules
    USEMODULE=esp_wifi_enterprise make BOARD=esp32-olimex-evb -C examples/gnrc_networking info-modules
    

    and

    TEST_KCONFIG=1 make BOARD=esp32-olimex-evb -C examples/gnrc_networking info-modules
    

    are used after selecting the according interfaces.

Issues/PRs references

Depends on PR #17419 and PR #17420

The 128-bit key for encrypted ESP-NOW communication is defined by a 16-byte array of type `uint8_t [16]` specified by the `ESP_NOW_KEY' configuration parameter in RIOT. By default, this configuration parameter is specified as NULL (no encryption). While in C it is possible to simply define this configuration parameter by something like `#define ESP_NOW_KEY { 0x0f, 0x1e, ... }`, it is not possible in Kconfig to define such a static initializer. Therefore, in regard to the migration to Kconfig, the key is now defined as a string with hex values separated by spaces `#define ESP_NOW_KEY "0f 1e ..."`, which is easy to implement in Kconfig.
`esp_freertos` is enabled by default by `esp_common`, no need to enable it here. `esp_wifi` and `esp_now` enable `esp_wifi_any`, no need to filter for both here.
All versions of `esp32-ethernet-kit` boards have same features. Therefore, a base board definition is used for Kconfig for all versions.
For the migration to Kconfig, default configuration parameters are defined for `esp_wifi_enterprise`.
@github-actions github-actions bot added Area: boards Area: Board ports Area: cpu Area: CPU/MCU ports Area: doc Area: Documentation Area: Kconfig Area: Kconfig integration Platform: ESP Platform: This PR/issue effects ESP-based platforms labels Dec 19, 2021
@gschorcht gschorcht added State: waiting for other PR State: The PR requires another PR to be merged first TF: Config Marks issues and PRs related to the work of the Configuration Task Force labels Dec 19, 2021
@gschorcht gschorcht force-pushed the cpu/esp/kconfig_netdevs branch from c89cc08 to e1bdcc7 Compare December 28, 2021 04:42
@stale
Copy link

stale bot commented Jul 10, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions.

@stale stale bot added the State: stale State: The issue / PR has no activity for >185 days label Jul 10, 2022
@gschorcht gschorcht added State: don't stale State: Tell state-bot to ignore this issue and removed State: stale State: The issue / PR has no activity for >185 days labels Jul 10, 2022
@benpicco benpicco requested a review from MrKevinWeiss January 19, 2023 16:24
@Teufelchen1
Copy link
Contributor

This will need rework once #20438 is in.

@MrKevinWeiss
Copy link
Contributor

It is in...

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: cpu Area: CPU/MCU ports Area: doc Area: Documentation Area: Kconfig Area: Kconfig integration Platform: ESP Platform: This PR/issue effects ESP-based platforms State: don't stale State: Tell state-bot to ignore this issue State: waiting for other PR State: The PR requires another PR to be merged first TF: Config Marks issues and PRs related to the work of the Configuration Task Force
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants