Is it possible to use the latest esp32-idf with platformio?

I found some very useful functions in ESP32-IDF 5.0.1 but PIO seems to have version 4.3 integrated?
Is there a way to use the most recent version?

framework-espidf framework ~3.40302.0 3.40302.0 (4.3.2)

If you only get ESP-IDF 4.x you haven’t updated your platform-espressif32 yet. You can do that via the PIO Home GUI or more directly via the CLI and

pio pkg update -g -p espressif32

Thank you!

pio pkg update -g -p espressif32
Platform Manager: espressif32@6.0.1 is already up-to-date
Tool Manager: framework-arduinoespressif32@3.20006.221224 is already up-to-date
Tool Manager: tool-cmake@3.16.4 is already up-to-date
Tool Manager: tool-esptoolpy@1.40400.0 is already up-to-date
Tool Manager: tool-idf@1.0.1 is already up-to-date
Tool Manager: tool-mconf@1.4060000.20190628 is already up-to-date
Tool Manager: tool-mkfatfs@2.0.1 is already up-to-date
Tool Manager: tool-mklittlefs@1.203.210628 is already up-to-date
Tool Manager: tool-mkspiffs@2.230.0 is already up-to-date
Tool Manager: tool-ninja@1.9.0 is already up-to-date
Tool Manager: toolchain-xtensa-esp32@8.4.0+2021r2-patch5 is already up-to-date

But I think it’s not done???

I discovered new functions for esp-now in in the espressif esp32-idf programming guide version 5.0.1
( struct esp_now_recv_info ).

How can I verify which version is used by pio?
Do I need to upgrade other parts too?

What’s the platformio.ini? If you are using the special framework = espidf, arduino combination it might be different, since Arduino is built for a specific ESP-IDF version, it might still be at 4.x.

This is the platformio.ini:

[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
lib_deps =
me-no-dev/ESP Async WebServer@^1.2.3
me-no-dev/AsyncTCP@^1.1.1
bblanchon/ArduinoJson@^6.20.0
bodmer/TFT_eSPI@^2.5.21
gmag11/ESPNtpClient@^0.2.7
paulstoffregen/Time@^1.6.1
monitor_speed = 115200

This is 100% correct. The Arduino-ESP32 core does not use ESP-IDF 5.0, it uses 4.4.3.

I should rather say: You can use ESP-IDF 5.x in PlatformIO, in a raw ESP-IDF project. (framework = espidf). When you chose framework = arduino, you get the ESP-IDF version that the Arduino-ESP32 version uses. For 2.0.6, this is ESP-IDF 4.4.3.

See ESP-IDF projects at

Do you know how long it usually takes until the arduino framework gets updated?
I’ve red about an “framework = arduino, espidf” in this Post (2019).
But I don’t have the option in platformio project configuration - is that outdated?
I also stumbled upon ESP32 Arduino Lib Builder.
Could this help?

Arduino-ESP32 + ESP-IDF projects still work. It will be using the ESP-IDF framework that Arduino wants, however, which is v4.4.3.

Upgrading Arduino-ESP32 to compile with ESP-IDF 5.x is still an open issue per

If you just need ESP-IDF 5.x without Arduino, start a normal ESP-IDF project.

Thanks a lot for your support!
I’ll give it a try …