ESP32 Compilation platform.txt

Hi guys,

I don’t quite understand where the compilation instructions are generated. My goal is to program the ESP32 coprocessor in assembly using the Arduino Framework in PIO.
For that I changed the platform.txt file located in
After I deleted the whole content of the file, my program was still compiling. I know that you can set some compilation flags in the .ini file, but can someone explain the purpose of the platform.txt file then?
This is the tutorial I followed on github:

All the best,

Just remove framework = arduino field from platformio.ini. See example for AVR platform-atmelavr/examples/native-blink at develop · platformio/platform-atmelavr · GitHub


I have exactly the same question as op - I’m trying to setup ulptool from duff2013 to work with PIO. The reason why I want to use his code is because of ULP C compiler implementation (much more convenient then writing assembly instructions). I noticed that adding platform.local.txt doesn’t do anything. Even removing platform.txt doesn’t do anything.

As suggested, I removed framework = arduino from platformio.ini (and #include <Arduino.h> from main.cpp) but that just generated this error while compiling:

A fatal error occurred: No segment header found at offset 0000 in ELF file.
*** [.pio/build/esp32dev/firmware.bin] Error 2

What am I doing wrong?

PlatformIO does not read the platform.txt (or any variants thereof) to understand how the core is supposed to be recompiled, it re-implements it in a Python script using the SCons build system. Meaning the logic described by platform.local.txt has to be implemented in the Arduino-ESP32 builder script (example) (or just a extra script) – this is not trivial. An issue about this is open at Problem when compiling ESP32 ULP sources (framework Arduino) · Issue #315 · platformio/platform-espressif32 · GitHub. For ESP-IDF, regular ULP programming with the native toolchain is available.

Thanks for the explanation! Such a pitty this isn’t supported yet, I use ULP in almost all of my projects with ESP32.