Cannot build ESP-IDF project which use Arduino as component

Hi everyone, currently I try to use Arduino framework as component in PlatformIO under ESP-IDF framework. I don’t include 2 frameworks together in the platform.ini file because my project requires ESP-IDF version 5.4.0 and above. So I use espressif32 version 6.12.0 to use ESP-IDF 5.5.0. I download the compatible arduino-esp32 component from official Espressif, and put it under global component folder. I currently get this error build?

.o
Compiling .pio\build\esp32s3usbotg\bootloader\managed_components\espressif__dl_fft\base\isa\esp32s3\dl_fft2r_fc32_aes3.S.o
Compiling .pio\build\esp32s3usbotg\bootloader\managed_components\espressif__dl_fft\base\isa\esp32s3\dl_fft4r_fc32_aes3.S.o
Compiling .pio\build\esp32s3usbotg\bootloader\managed_components\espressif__esp-dsp\modules\common\misc\dsps_pwroftwo.cpp.o
Compiling .pio\build\esp32s3usbotg\bootloader\managed_components\espressif__esp-dsp\modules\common\misc\aes3_tie_log.c.o
In file included from C:\Users\Minh\.platformio\packages\framework-espidf\components\bootloader\subproject\managed_components\espressif__dl_fft\dl_fft.h:2,
                 from C:\Users\Minh\.platformio\packages\framework-espidf\components\bootloader\subproject\managed_components\espressif__dl_fft\dl_fft_s16.c:1:
C:\Users\Minh\.platformio\packages\framework-espidf\components\bootloader\subproject\managed_components\espressif__dl_fft\base/dl_fft_base.h:6:10: fatal error: esp_heap_caps.h: No such file or directory
*****************************************************************************
* Looking for esp_heap_caps.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:esp_heap_caps.h"
* Web  > https://registry.platformio.org/search?q=header:%1B%5Bm%1B%5BKesp_heap_caps.h
*
*****************************************************************************

    6 | #include "esp_heap_caps.h"
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.
In file included from C:\Users\Minh\.platformio\packages\framework-espidf\components\bootloader\subproject\managed_components\espressif__dl_fft\dl_fft.h:2,
                 from C:\Users\Minh\.platformio\packages\framework-espidf\components\bootloader\subproject\managed_components\espressif__dl_fft\dl_fft_f32.c:1:
C:\Users\Minh\.platformio\packages\framework-espidf\components\bootloader\subproject\managed_components\espressif__dl_fft\base/dl_fft_base.h:6:10: fatal error: esp_heap_caps.h: No such file or directory
*****************************************************************************
* Looking for esp_heap_caps.h dependency? Check our library registry!

This is a very strange error, and I don’t even know why my esp arduino project need it though. I test it also on a simple Serial print hello world, and the error is still the same. Is there anyway to fix this?

I also tested this under official esp-idf platform and I don’t get the error like this.

This is the guide I use to include Arduino as a component in ESP-IDF framework: Converting to Arduino as an ESP-IDF Component
Kind regards

At this point, just use PIOArduino (https://github.com/pioarduino/platform-espressif32) and do a framework = arduino, espidf project. That fork has the up-to-date Arduino core, v3.3.2 based on on ESP-IDF v5.5.1, per releases.

I would not bother fixing up the errors when using espressif32 6.12.0 with ESP-IDF 5.4.0 and a compatible Arduino-ESP32 core (at least 3.x), the build system and configuration is complex.

Just set

platform = https://github.com/pioarduino/platform-espressif32/releases/download/55.03.32/platform-espressif32.zip

and get the rest from the official example