Skip to content

Conversation

@netmindz
Copy link
Member

@netmindz netmindz commented Nov 8, 2025

C6 needs the newer ESP-IDF, so have one branch for those changes and keep this one just for the C6 specific things

Building on top of V5

Inspired by C6 Experiments


Edit (softhack007): espressif has "silently" changed a lot of APIs, and - in many cases - replacements are not behaving the same way as before. We are lucky that a few "legacy APIs" are still available, like the "V4" I2S driver. So even when "it compiles", there may be a lot more adaptations needed before "it really works".


Helpful information and migration guidance

coding guides

We should make sure that the "V5" branch will still compile for "V4" as a backup solution.
When adding code that only works in the new framework, it should be conditionally compiled, like in the examples below

  • "V5" code only for esp32-P4 or esp32-C6:
 #if defined(CONFIG_IDF_TARGET_ESP32C6)
    // https://docs.espressif.com/projects/esp-idf/en/latest/esp32c6/api-reference/peripherals/gpio.html
    // strapping pins: 4, 5, 8, 9
    if (gpio > 11 && gpio < 14) return false;     // 12-13 USB-JTAG
    if (gpio > 23 && gpio < 31) return false;     // 24-30 SPI FLASH
#elif defined(CONFIG_IDF_TARGET_ESP32P4)
    // strapping pins: 34,35,36,37,38
    if (             gpio <   2) return false;     // NC
    if (gpio > 13 && gpio <  20) return false;     // ESP-Hosted WiFi pins
    if (gpio > 23 && gpio <  26) return false;     // USB Pins
#elif defined(CONFIG_IDF_TARGET_ESP32S3)
  // .... existing code
#else
  // .... existing code
#endif
  • "V5" code that is not specific to new boards
      #if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0)
      ledcAttach(pwmPin, 25000, 8);  // New API: ledcAttach(pin, freq, resolution)
      #else
      ledcSetup(pwmChannel, 25000, 8);
      // attach the channel to the GPIO to be controlled
      ledcAttachPin(pwmPin, pwmChannel);
      #endif

related

netmindz and others added 3 commits November 8, 2025 13:33
due to Arduino 3.0.1, a few updated libraries are required:
* Tasmota Platform - official platfomio lacks arduino support for C6
* FastLED (latest + C6 build patches)
* AsyncTCP (latest + C6 build patches)
* AsyncWebServer (latest + C6 build patches)
* NeoPixelBus (lastest)
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 8, 2025

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch V5-C6

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Comment on lines +14 to +28
;nodemcuv2
;esp8266_2m
;esp01_1m_full
;nodemcuv2_160
;esp8266_2m_160
;esp01_1m_full_160
;nodemcuv2_compat
;esp8266_2m_compat
;esp01_1m_full_compat
;esp32dev
;esp32dev_debug
;esp32_eth
;esp32_wrover
; lolin_s2_mini ;; TODO: disabled NeoEsp32RmtMethodIsr
esp32c3dev
;esp32c3dev
Copy link
Member Author

Choose a reason for hiding this comment

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

TODO: revert before merge, here to save CI build time

@netmindz
Copy link
Member Author

netmindz commented Nov 8, 2025

@softhack007 I've started trying to cherry-pick your changes over, quite a few don't apply due to the changes with MM, but I'll try and resolve the merge conflicts for those that are simple

* more debug output
* added my own fork of FastLED ( looks like more bugs to solve ....)
-DARDUINO_ARCH_ESP32C6
-DCONFIG_IDF_TARGET_ESP32C6=1
-D CONFIG_ASYNC_TCP_USE_WDT=0
-DCO
Copy link
Member

@softhack007 softhack007 Nov 8, 2025

Choose a reason for hiding this comment

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

There is one important flag for -C6 and possibly other "V5" builds, too:

  -DESP32_ARDUINO_NO_RGB_BUILTIN ;; avoids RMT driver abort on startup "E (98) rmt(legacy): CONFLICT! driver_ng is not allowed to be used with the legacy driver"

This flag disables the builtin rbg led driver of arduino-esp32. Without it, some boards will crash on boot.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for the heads up

@softhack007
Copy link
Member

@softhack007 I've started trying to cherry-pick your changes over, quite a few don't apply due to the changes with MM, but I'll try and resolve the merge conflicts for those that are simple

@netmindz thanks, I'll try to help once I'm finished with some open ends in WLED-MM 😁 december

@netmindz
Copy link
Member Author

netmindz commented Nov 8, 2025

Possibly also worth looking at #4626 to see if there are any changes there that are helpful

@softhack007
Copy link
Member

softhack007 commented Nov 18, 2025

@netmindz and all,

please keep in mind that there is another "open end" for moving to ESP-IDF V5:
--> The ledc API has changed, and its not compatible with the previous "V4" API. This means we need to adapt the "analog LEDs" PWM driver, to make it work with V5.

Most likely we'll need some more #if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0) conditional code in the BusPWM driver. 🤔 Unless we completely drop PWM "analog" support in V5 builds, but I think this is not an option.


Edit: more information is here:

@softhack007 softhack007 added this to the 0.17.0 milestone Nov 18, 2025
@softhack007 softhack007 mentioned this pull request Nov 18, 2025
@netmindz
Copy link
Member Author

@netmindz and all,

please keep in mind that there is another "open end" for moving to ESP-IDF V5: --> The ledc API has changed, and its not compatible with the previous "V4" API. This means we need to adapt the "analog LEDs" PWM driver, to make it work with V5.

Most likely we'll need some more #if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0) conditional code in the BusPWM driver. 🤔 Unless we completely drop PWM "analog" support in V5 builds, but I think this is not an option.

That is generic to V5 rather than being specific to C6 isn't it, so would be part of the other PR

@softhack007
Copy link
Member

That is generic to V5 rather than being specific to C6 isn't it, so would be part of the other PR

I agree, this would be something to address in the generic V5 PR #4838

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.

3 participants