Skip to content

feat: ESP-IDF v6.0 support#2

Merged
GOB52 merged 4 commits into
m5stack:feature/esp-idf-native-supportfrom
Sped0n:idf-v6
Jun 2, 2026
Merged

feat: ESP-IDF v6.0 support#2
GOB52 merged 4 commits into
m5stack:feature/esp-idf-native-supportfrom
Sped0n:idf-v6

Conversation

@Sped0n
Copy link
Copy Markdown

@Sped0n Sped0n commented May 29, 2026

Change Overview

  • Add ESP-IDF version-aware component dependencies in CMakeLists.txt.
  • Keep ESP-IDF v5.x using the legacy driver dependency.
  • Use split ESP-IDF v6 driver components such as esp_driver_gpio, esp_driver_i2c, esp_driver_spi, esp_driver_uart, esp_driver_rmt, and related dependencies.
  • Build the component as C++17 for native ESP-IDF builds. (m5_utility/murmurhash3.hpp:140:30: error: space between quotes and suffix is deprecated in C++23 [-Werror=deprecated-literal-operator])
  • Fix ESP-IDF v6 GPIO compatibility by including the needed GPIO register header.
  • Guard use of the removed io_loop_back GPIO configuration field so it is only used before ESP-IDF v6.
  • Include FreeRTOS explicitly where portMAX_DELAY is used by the SPI adapter.

Testing

Tested with a temporary native ESP-IDF project targeting esp32c6.

Passed:

  • idf.py set-target esp32c6 build with ESP-IDF v5.5.3
  • idf.py set-target esp32c6 build with ESP-IDF v6.0

@Sped0n Sped0n force-pushed the idf-v6 branch 2 times, most recently from 7bc0acc to 6012495 Compare May 29, 2026 13:05
Sped0n added 4 commits May 29, 2026 21:10
Signed-off-by: Zhibin (Ryan) Wen <wenzhibin@espressif.com>
Signed-off-by: Zhibin (Ryan) Wen <wenzhibin@espressif.com>
Signed-off-by: Zhibin (Ryan) Wen <wenzhibin@espressif.com>
Signed-off-by: Zhibin (Ryan) Wen <wenzhibin@espressif.com>
@GOB52
Copy link
Copy Markdown
Collaborator

GOB52 commented Jun 2, 2026

Thanks @Sped0n for the IDF v6 support — much appreciated!

I'd like to merge this as-is so the v6 build path lands, but I plan to follow up with two adjustments on develop:

  1. Remove the project-wide -std=gnu++17 override in CMakeLists.txt. The original motivation (C++23 deprecated-literal-operator warning
    from M5Utility) has been fixed upstream, so M5UnitUnified can return to the IDF default and stop forcing a global flag for all
    components.
  2. Add a code comment in adapter_gpio_v2.cpp noting the v6 behavior change of rmt_tx_channel_config_t::flags.io_loop_back. On IDF<6 the
    hardware loopback bit is set; on v6 the field is gone and the software loop_count path still works, but the silent feature loss is worth
    documenting at the call site.

@GOB52 GOB52 merged commit d998a40 into m5stack:feature/esp-idf-native-support Jun 2, 2026
20 checks passed
GOB52 pushed a commit that referenced this pull request Jun 2, 2026
* fix: support IDF v6 GPIO register changes

Signed-off-by: Zhibin (Ryan) Wen <wenzhibin@espressif.com>

* fix: make IDF component dependencies version-aware

Signed-off-by: Zhibin (Ryan) Wen <wenzhibin@espressif.com>

* fix: build native IDF component as C++17

Signed-off-by: Zhibin (Ryan) Wen <wenzhibin@espressif.com>

* fix: include FreeRTOS header in SPI adapter

Signed-off-by: Zhibin (Ryan) Wen <wenzhibin@espressif.com>

---------

Signed-off-by: Zhibin (Ryan) Wen <wenzhibin@espressif.com>
GOB52 pushed a commit that referenced this pull request Jun 2, 2026
* fix: support IDF v6 GPIO register changes

Signed-off-by: Zhibin (Ryan) Wen <wenzhibin@espressif.com>

* fix: make IDF component dependencies version-aware

Signed-off-by: Zhibin (Ryan) Wen <wenzhibin@espressif.com>

* fix: build native IDF component as C++17

Signed-off-by: Zhibin (Ryan) Wen <wenzhibin@espressif.com>

* fix: include FreeRTOS header in SPI adapter

Signed-off-by: Zhibin (Ryan) Wen <wenzhibin@espressif.com>

---------

Signed-off-by: Zhibin (Ryan) Wen <wenzhibin@espressif.com>
GOB52 pushed a commit that referenced this pull request Jun 2, 2026
* fix: support IDF v6 GPIO register changes

Signed-off-by: Zhibin (Ryan) Wen <wenzhibin@espressif.com>

* fix: make IDF component dependencies version-aware

Signed-off-by: Zhibin (Ryan) Wen <wenzhibin@espressif.com>

* fix: build native IDF component as C++17

Signed-off-by: Zhibin (Ryan) Wen <wenzhibin@espressif.com>

* fix: include FreeRTOS header in SPI adapter

Signed-off-by: Zhibin (Ryan) Wen <wenzhibin@espressif.com>

---------

Signed-off-by: Zhibin (Ryan) Wen <wenzhibin@espressif.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants