How to embed binary files into esp32 firmware


#1

Hello

I am trying to compile the esp32 ssl example with Platformio:

The problem seems to be that platformIO is not recognising the needed component.mk with its option:
COMPONENT_EMBED_TXTFILES := server_root_cert.pem
Documented here: https://esp-idf.readthedocs.io/en/latest/api-guides/build-system.html#embedding-binary-data

there is no obvious way to me to configure or bypass these configuration to the underlaying sdk.

Can anybody help me with this problem?


Trouble embedding binary files in ESP-IDF (component.mk) using PlatformIO
#2

Anyone found an answer to this ?


#3

http://docs.platformio.org/en/latest/platforms/espressif32.html#embedding-binary-data


#4

Quick question about that link. Its says ’ You can set a macro (define) COMPONENT_EMBED_FILES using build_flags"

Yet the example given is: Notice here they are using “COMPONENT_EMBED_TXTFILES”

[env:myenv]
platform = espressif32
board = …
build_flags =
-DCOMPONENT_EMBED_TXTFILES=src/private.pem.key:src/certificate.pem.crt:src/aws-root-ca.pem

Later on that page they say again " The names are generated from the full name of the file, as given in COMPONENT_EMBED_FILES ." So where did they get “COMPONENT_EMBED_TXTFILES” at ?


#6

You are right! Thanks! I’ve just fixed typos