Skip to content

Arduino IDE 2.x and new ESP32 core: ledcSetup() not compiling — Simple PWM sketch fails, blocking real hardware usage #12048

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

Closed
Murugesh-Hobbyist opened this issue Apr 26, 2025 · 1 comment
Assignees
Labels
Component: Core Related to the code for the standard Arduino API Type: Bug Type: Invalid Off topic for this repository, or a bug report determined to not actually represent a bug

Comments

@Murugesh-Hobbyist
Copy link

Murugesh-Hobbyist commented Apr 26, 2025

Type: Bug
Component: Build
Hardware: ESP32
Platform: Windows

Problem:
Basic ESP32 PWM code using ledcSetup(), which worked perfectly in older Arduino IDE versions and older ESP32 cores, fails to compile in new Arduino IDE (2.x) versions and recent ESP32 core releases.

Image

#include <Arduino.h>

const int pwmPin = 5;

void setup() {
  Serial.begin(115200);
  ledcSetup(0, 25000, 10);
  ledcAttachPin(pwmPin, 0);
  ledcWrite(0, 512);
}

void loop() {
}

Observations:
✅ Board selected correctly (e.g., ESP32 Dev Module, ESP32S3 Dev Module)

✅ Latest ESP32 cores installed cleanly via Boards Manager.

✅ Sketch saved properly inside Documents/Arduino/ folder (not temp).

❌ Still getting missing function errors for standard ESP32 functions.

Expected Behavior:
Simple ESP32 sketches using standard functions like ledcSetup(), ledcAttachPin(), ledcWrite() should compile successfully under Arduino IDE 2.x and latest ESP32 cores.

Actual Behavior:
Compilation fails with missing function declaration errors.

Request:
Please investigate ESP32 core path resolutions or header visibility issues when compiling under new Arduino IDE 2.x versions.

Possible cause could be related to missing platform includes or wrong build_flags being passed to compiler.

@per1234 per1234 self-assigned this Apr 26, 2025
@per1234 per1234 added Component: Core Related to the code for the standard Arduino API Type: Bug labels Apr 26, 2025
@per1234
Copy link
Collaborator

per1234 commented Apr 26, 2025

Hi @Murugesh-Hobbyist. This was an intentional change made by the developers of the 3rd party "esp32" boards platform in the platform's 3.0.0 release.

It is documented in the migration guide they provide:

https://docs.espressif.com/projects/arduino-esp32/en/latest/migration_guides/2.x_to_3.0.html#ledc

You can learn how to port your code to be compatible with versions of the platform >=3.0.0 from that guide.

If you would like to discuss the subject or request assistance with that work, or any other Arduino-related subjects you are always welcome to post over on Arduino Forum:

https://forum.arduino.cc/

@per1234 per1234 closed this as not planned Won't fix, can't repro, duplicate, stale Apr 26, 2025
@per1234 per1234 added the Type: Invalid Off topic for this repository, or a bug report determined to not actually represent a bug label Apr 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Core Related to the code for the standard Arduino API Type: Bug Type: Invalid Off topic for this repository, or a bug report determined to not actually represent a bug
Projects
None yet
Development

No branches or pull requests

2 participants