Arduino core for ESP32 4.0.0: new BLE API, ESP32-S31 target and a PWM duty change
arduino-esp32 4.0.0 rewrites the BLE library, adds the ESP32-S31, hardens WebServer and changes what ledcWrite() treats as full on. It is built on ESP-IDF v6.1.1.
Espressif released version 4.0.0 of the Arduino core for ESP32 (arduino-esp32) on 19 November 2026. It is a major release. The BLE library is rewritten around a single BLE object that behaves the same on the NimBLE and Bluedroid host stacks, and its migration guide says 3.x sketches need changes (BLEDevice::init() becomes BLE.begin(), for example). The core adds the ESP32-S31 to its targets. The WebServer library gains request limits, such as a 2,048-byte URI cap, and the Server-Sent Events flag moves from the client object to the server. Version 3.3.13 shipped on 17 November for projects that stay on 3.x.
Field Guide note
We compared ledcWrite() in esp32-hal-ledc.c at both tags. In 3.3.13 a duty of (1 << resolution) - 1, such as 255 at 8 bits, was silently raised to full on. In 4.0.0 that remap is gone, so ledcWrite(pin, 255) gives 255/256 and full on is ledcWrite(pin, 256). analogWrite() keeps the old 0 to 255 range. Search old sketches for 255, 4095 or (1 << n) - 1 passed to ledcWrite() or ledcFade*().
The bundled libraries are built from an ESP-IDF commit identical to the v6.1.1 tag, so the v6.1.1 changes come with it. Used as an ESP-IDF component, 4.0.0 accepts ESP-IDF from 5.3 up to, but not including, 6.2. Boards Manager now offers 4.0.0 as the newest version. To keep an existing design on 3.x, pin it with arduino-cli core install esp32:esp32@3.3.13. ESPHome 2026.11.1 still recommends 3.3.12. Espressif’s ESP32-S31 page states no lifecycle status, so do not treat the chip as available to order. This affects /reference/sdk-rtos-matrix/ and /kits/#arduino-nano-esp32.