Framework = arduino, espidf - can't build on versions < 5.2.0

I need help building specific espidf version (4.1.0) with Arduino component (using VSCode with Platformio plugin)

I can get both 5.2.0 and 5.3.0 working like this (including using menuconfig, everything working correctly):

platform = espressif32@5.2.0
board = esp32cam
board_build.partitions = partitions.csv
framework = arduino, espidf
monitor_speed = 115200

But if I try to specify an earlier version like this:

platform = espressif32@4.1.0
board = esp32cam
board_build.partitions = partitions.csv
framework = arduino, espidf
monitor_speed = 115200

I get fatal error: Arduino.h: No such file or directory:

Processing esp32_cam (platform: espressif32@4.1.0; board: esp32cam; framework: arduino, espidf)
Verbose mode can be enabled via `-v, --verbose` option
PLATFORM: Espressif 32 (4.1.0) > AI Thinker ESP32-CAM
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-arduinoespressif32 @ 3.20001.0 (2.0.1) 
 - framework-espidf @ 3.40001.200521 (4.0.1) 
 - tool-cmake @ 3.16.4 
 - tool-esptoolpy @ 1.30100.210531 (3.1.0) 
 - tool-ninja @ 1.9.0 
 - toolchain-esp32ulp @ 1.22851.191205 (2.28.51) 
 - toolchain-xtensa32 @ 2.80400.210211 (8.4.0)
Warning! Arduino framework as an ESP-IDF component doesn't handle the `variant` field! The default `esp32` variant will be used.
Reading CMake configuration...
LDF: Library Dependency Finder ->
LDF Modes: Finder ~ chain, Compatibility ~ soft
Scanning dependencies...
Building in release mode
Compiling .pio/build/esp32_cam/src/BTRRServer.o
Compiling .pio/build/esp32_cam/src/BTSerial.o
Compiling .pio/build/esp32_cam/src/BluetoothManager.o
Compiling .pio/build/esp32_cam/src/NVSConfig.o
In file included from include/BTRRServer.h:4,
                 from src/BTRRServer.cpp:1:
include/BTSerial.h:4:10: fatal error: Arduino.h: No such file or directory

It looks like with earlier versions platformio is not even trying to compile the platform framework?
Is there a different way to compile for earlier versions?

Platform version does not equal ESP-IDF version. platform = espressif32@4.1.0 will give you this release and with it

1 Like

Hi @maxgerhardt,
Thanks for the clarification! I misspoke earlier - I do want to build platform version 4.1.0 (not espidf version). The version I specified is the correct version I want to build, but my issue is that the build fails. I am trying to figure out why and how to fix it. Any tips on how I can get to the bottom of this?