Migrating from platformio to idf.py

I have a maturing project for esp32 that was born under platformio. The powers that be want the project to have signed firmware… you know where this is going.

Espressif documentation points towards secure boot v2.

Platformio doesn’t support it directly. When I run menuconfig and enable CONFIGURE_SECURE_BOOT_BUILD_SIGNED_BINARIES my build fails:

Compiling .pio/build/myenv/bootloader_support/src/secure_boot_v1/secure_boot_signatures_app.o
*** [.pio/build/myenv/.pio/build/myenv/signature_verification_key.bin.o] Source `.pio/build/myenv/signature_verification_key.bin.S' not found, needed by target `.pio/build/myenv/.pio/build/myenv/signature_verification_key.bin.o'.

Two problems there – one is the secure_boot_v1 which I’m told is no good, want v2 and the other problem is the baffed path construction (.pio/build/env/.pio/build/env/...)

At some point this becomes tedious and I think I’ll follow the instructions on Espressif’s website. They counsel using idf.py. So I do all that dance only to have the build fail in some other way (after building the esp-idf components it fails to find my code – much hacking on CMakeLists.txt later, I fix that but I’m still having include path problems).

So finally to my question… is there some document that describes how one extricates a project from platformio? Or describes how the wrapper tech works?

Really bummed out because there’s a lot to like about platformio.

1 Like

Replying to myself (for the next person)…

Point one… when you clone the esp-idf repo from github, make sure you switch to one of the release branches – not master.

Point two… platformio seems to do a much better job figuring out your component needs. Using bare idf.py I found that I had to:

  • explicitly set(EXTRA_COMPONENT_DIRS "${CMAKE_SOURCE_DIR}/my_app"} in the top level cmake file
  • change my own app’s idf_component_register line… PRIV_REQUIRES needed a bunch of things explicitly spelled out – platformio was able to figure out what I needed without me even knowing

I can now build my project with idf.py but I’ve lost the ability to build with platformio… I get this:

KeyError: 'compileGroups':
... python trace ...
  File "/Users/georgn/.platformio/platforms/espressif32/builder/frameworks/espidf.py", line 389:
for cg in config["compileGroups"]:

Bummer.

Secure boot and flash encryption is already tracked in Support secure boot and flash encryption · Issue #305 · platformio/platform-espressif32 · GitHub. Hopefully it will be implemented soon.

1 Like