I cannot setup ESP-IDF to 5.1.2 with Arduino

So I have this problem. If my platformio.ini file is like this:

[env:esp32-s3-devkitm-1]
platform = espressif32
board = esp32-s3-devkitm-1
framework = espidf

The ESP-IDF prints correct, it prints v5.1.2, this is my test main.c file

#include <esp_log.h>

void app_main()
{
  for (;;)
  {
    ESP_LOGI("MAIN", "[APP] IDF version: %s", esp_get_idf_version());
  }
}

If I add the framework arduino, the version of ESP-IDF prints v4.4.6 in the same main.c code

[env:esp32-s3-devkitm-1]
platform = espressif32
board = esp32-s3-devkitm-1
framework = espidf, arduino

I tried to explicit write the version of what I want, like this:

[env:esp32-s3-devkitm-1]
platform = espressif32
board = esp32-s3-devkitm-1
framework = espidf, arduino
platform_packages=
    platformio/framework-espidf@^3.50102.0
    toolchain-xtensa-esp32s3@12.2.0+20230208
    framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git

If I try to build, I get this error:

*** Two environments with different actions were specified for the same target: /Users/cesar/Documents/PlatformIO/Projects/Test/.pio/build/esp32-s3-devkitm-1/managed_components/espressif__esp-dsp/modules/support/cplx_gen/dsps_cplx_gen.o
(action 1: xtensa-esp32s3-elf-gcc -DPLATFORMIO=60113 -DARDUINO_ESP32S3_DEV -DARDUINO_USB_MODE=1 -DARDUINO_RUNNING_CORE=1 -DARDUINO_EVENT_RUNNING_CORE=1 -DESP_PLATFORM -DIDF_VER=\"5.1.2\" -DSOC_MMU_PAGE_SIZE=CONFIG_MMU_PAGE_SIZE -D_GNU_SOURCE -D_POSIX_READER_WRITER_LOCKS -DconfigENABLE_FREERTOS_DEBUG_OCDAWARE=1 -c -o dsps_cplx_gen.o dsps_cplx_gen.S)
(action 2: xtensa-esp32s3-elf-gcc -mlongcalls -ffunction-sections -fdata-sections -Wall -Werror=all -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=unused-but-set-variable -Wno-error=deprecated-declarations -Wextra -Wno-unused-parameter -Wno-sign-compare -Wno-enum-conversion -gdwarf-4 -ggdb -Og -fmacro-prefix-map=/Users/cesar/Documents/PlatformIO/Projects/Test=. -fmacro-prefix-map=/Users/cesar/.platformio/packages/framework-espidf=/IDF -fstrict-volatile-bitfields -fno-jump-tables -fno-tree-switch-conversion -DPLATFORMIO=60113 -DARDUINO_ESP32S3_DEV -DARDUINO_USB_MODE=1 -DARDUINO_RUNNING_CORE=1 -DARDUINO_EVENT_RUNNING_CORE=1 -DESP_PLATFORM -DIDF_VER=\"5.1.2\" -DSOC_MMU_PAGE_SIZE=CONFIG_MMU_PAGE_SIZE -D_GNU_SOURCE -D_POSIX_READER_WRITER_LOCKS -DconfigENABLE_FREERTOS_DEBUG_OCDAWARE=1 -c -o dsps_cplx_gen.o dsps_cplx_gen.S)
File "/Users/me/.platformio/platforms/espressif32/builder/frameworks/espidf.py", line 699, in compile_source_files

I tried adding this line board_build.esp-idf.preserve_source_file_extension= yes which gets rid of that error but then it cannot build because of a cert error

Compiling .pio/build/esp32-s3-devkitm-1/managed_components/espressif__esp_insights/src/esp_insights_cbor_encoder.c.o
*** [.pio/build/esp32-s3-devkitm-1/.pio/build/esp32-s3-devkitm-1/https_server.crt.S.o] Source `.pio/build/esp32-s3-devkitm-1/https_server.crt.S' not found, needed by target `.pio/build/esp32-s3-devkitm-1/.pio/build/esp32-s3-devkitm-1/https_server.crt.S.o'.

Just use a third party platform that integrates ESP-IDF 5.x and Arduino-ESP32 3.x already by itself. See issue.

[env:esp32-s3-devkitm-1]
platform = https://github.com/Jason2866/platform-espressif32.git#Arduino/IDF5
board = esp32-s3-devkitm-1
framework = espidf, arduino

with the other project files from here.

I have done a setup with the original espressif settings and repos.
To be used with

[env:development]
platform = https://github.com/jason2866/platform-espressif32.git#Arduino/IDF5_org

board = ...
...

The relevant part is to embed the cert files. See config from example platform-espressif32/examples/espidf-arduino-blink/platformio.ini at Arduino/IDF5_org · Jason2866/platform-espressif32 · GitHub

1 Like