PlatformIO Community

Using latest esp-idf (4.3.1) in platformio.ini

I am trying to use the latest esp-idf 4.3.1 by tweaking my platformio.ini file which currently picks up esp-idf 4.3.0 by default. I am not familiar with the necessary steps and runes to do so.

My failing platformio.ini file:

src_dir = main

;platform = espressif32
platform =                                                                                                                                                                                                                                                           
platform_packages = framework-espidf @                                                                                                                                                                                                                                          
board = esp32dev
board_build.partitions = partitions.csv
framework = espidf
monitor_speed = 115200

I was hoping that this would pull esp-idf 4.3.1 and compile it. But I end up with an early build error since the framework-espidf directory is not fully populated:

$ pio run 
Processing esp32dev (platform:; board: esp32dev; framework: espidf)
Verbose mode can be enabled via `-v, --verbose` option
PLATFORM: Espressif 32 (3.3.2+sha.1e0f147) > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (esp-prog) External (esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
 - framework-espidf 1.1.0+sha.2e74914 
 - tool-cmake 3.16.4 
 - tool-esptoolpy 1.30100.210531 (3.1.0) 
 - tool-ninja 1.7.1 
 - toolchain-esp32ulp 1.22851.191205 (2.28.51) 
 - toolchain-xtensa32 2.80400.210211 (8.4.0)
Reading CMake configuration...
-- Configuring incomplete, errors occurred!
See also "/home/ov/work/CO2Ampel/sensor-devices/esp32/espidf_co2/bleprph_wifi_coex/.pio/build/esp32dev/CMakeFiles/CMakeOutput.log".

CMake Error at CMakeLists.txt:5 (include):
  include could not find load file:


Do I need to override anything else? Or is it not that trivial to achieve this?

It is missing an ESP-IDF file here. This is most likely due to the fact that you can’t just specify the source of framework-espidf to be from their github repo. In order for something to be usable as a package (in platform_packages), it needs to have a package.json metainfo file at the top level. See here for a more in-depth explanation.

Try forking the ESP-IDF repo, going to the v4.3.1 branch and adding a package.json to it, akin to the one found in but with corrected version info. All that can be comfortably done via the Github GUI (switch branch, “Add file → Upload file”)