Skip to content

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

Closed as not planned
@Murugesh-Hobbyist

Description

@Murugesh-Hobbyist

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.

Metadata

Metadata

Assignees

Labels

Component: CoreRelated to the code for the standard Arduino APIType: BugType: InvalidOff topic for this repository, or a bug report determined to not actually represent a bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions