Multiple frameworks in platformio.ini possible?

I’m not sure if this can be done…

I have example code from the esp32-idf. The plafomio.ini has framework = espidf.

But, now I’d like to combine some example code that is from the Arduino framework.

Can I just add a line framework = arduino ?

In most of the cases, using one framework or the other is an exclusive choice and not combinable.

ESP-IDF and Arduino is however an exception. There is indeed “Arduino as a component in ESP-IDF”. The official example for this is listed, as always in the documentation.

The magic line is

framework = arduino, espidf

in the platformio.ini. It might also require the usage of the latest, bleeding edge upstream platform-espressif32 version. See here for how to do this.


@maxgerhardt Could you please expand on how this is being done!

I am working on a new framework that will include an Arduino userspace, and we’ve been trying to figure out how to best use Arduino libraries that are restricted to the Arduino framework under PIO. We’d very much like to be able to define our new framework in addition to Arduino to allow access to the Arduino libraries.


1 Like

I can just give you some relevant pointers as I’m not involved in the implementation. The python build script files are located around here (for the “Arduino as ESP-IDF component”). Espressif has additional documentation there. If you have specific questions, it’s best to use Issues · espressif/arduino-esp32 · GitHub and Issues · platformio/platform-espressif32 · GitHub.

Thank you very much for the info @maxgerhardt!

the key is a whitespace after a comma ))))
Thank you

1 Like