Using latest ESP32 Arduino, but with own IDF configuration

I try to use the latest ESP32-Arduino framework, but need to change some configuration of the underlying IDF.

How to do this?

My current platformio.ini:

[env:esp32-v2-upstream]
platform = https://github.com/platformio/platform-espressif32.git#feature/arduino-upstream
board = esp32doit-devkit-v1
framework = arduino
platform_packages = framework-arduinoespressif32@https://github.com/espressif/arduino-esp32.git
build_flags = -DESP32 -DCORE_DEBUG_LEVEL=5

What I want now is the ability to change IDF sdkconfig.esp32dev - like it is possible when I directly use the IDF.

It seems that the IDF for Arduino-ESP32 comes as pre-compiled library (in ~/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32), so I need to be able to compile such an own SDK variant on my own? Is there some “Howto” do this?

PlatformIO is currently very much lagging behind the current versions. There is no official support for even the latest Arduino-ESP32 2.0 version (Support for the latest Arduino v2.0 · Issue #619 · platformio/platform-espressif32 · GitHub), and the latest support ESP-IDF version per releases is v4.3.2, whereas Arduino-ESP32 uses a v4.4 version.

The clostest someone seems to have gotten with native PlatformIO (framework = espidf, arduino as in espidf-arduino-blink) is using a custom-updated platform that has Arduino-ESP32 2.0 support, ~~but is apparently lacking the ESP-IDF v4.4 support, leading to errors shown in examples/espidf-arduino-blink build fails: unknown type name '_lock_t' · Issue #685 · platformio/platform-espressif32 · GitHub These errors were already resolved by the poster, and there seems to be an official ESP-IDF+Arduino example in the tasmato platform-espressif32 repo.

A way in the middle would be to use that custom-updated platform to get Arduino-ESP32 2.0.2, and then use the regular esp32-arduino-lib-builder tool to generate the precompiled .a libraries under a new sdkconfig and put those in the framework-arduinoespressif32 folder.

1 Like

Thanks again for your quick response.

So, I was able to use the espidf-arduino-blink example configuration to build an own IDF.

This platformio.ini works for me and build fine!

[env:esp32-v2-upstream]
platform = https://github.com/Jason2866/platform-espressif32/releases/download/v2.0.2/platform-espressif32-2.0.2.zip
board = esp32doit-devkit-v1
framework = arduino, espidf
platform_packages = framework-arduinoespressif32@https://github.com/espressif/arduino-esp32.git
build_flags = -DESP32 -DCORE_DEBUG_LEVEL=6

I changed the IDF sdkconfig to what I need (especially enabling arduino CONFIG_AUTOSTART_ARDUINO=y and disabling Bluetooth SSP (unset CONFIG_BT_SSP_ENABLED), patched the Arduino-ESP32 framework to get rid of SSP symbols (in BluetoothSerial.cpp) and thus am able to work around No Bluetooth SPP connection possible with IDF 4.3.2 (IDFGH-6766) · Issue #8394 · espressif/esp-idf · GitHub / https://github.com/espressif/arduino-esp32/issues/6061) :slight_smile:

Next step: Add a connection to BLE device in parallel…

1 Like