Hello there @maxgerhardt ,
It seems you’re really going the extra mile for that one, thank you for that!
I managed to compiled Arduino as ESP-IDF component, but I’m not sure if it is the correct way of doing it, anyways, I think it would be a good thing to share on this topic.
So after googling around I found this Github issue: Successfully built arduino-esp32 as component on esp-idf v4.2 release · Issue #4702 · espressif/arduino-esp32 · GitHub and decided to give it a try, so I started follwing these steps arduino-esp32/docs/esp-idf_component.md at mod-idf-v4.2 · summivox/arduino-esp32 · GitHub.
Since I’m using Windows, make menuconfig does not work, I had to use these instead
cd %userprofile%\esp\hello_world
idf.py set-target esp32
idf.py menuconfig
So with the Arduino component inside the hello-world ESP-IDF sample project I managed to build it inside ESP-IDF, I still had to move it to platformio. What I did then was placing a platformio.ini file inside the project root folder and then running ‘pio run -t menuconfig’ to set the AUTOSTART ARDUINO parameter.
I also had to change the main folder from ‘main’ to ‘src’ and change the base CMakeLists.txt to register the source code file (changed from hello_world_main.c to main.cpp).
Then after a quite long build process I managed to compile Arduino as a ESP-IDF component inside platformio, and I’m quite happy about that!
I already built a simple serial loop code, but I’ll try adding some other code to see if I can progress any further.
Thanks.