Embedding binary files


#1

A while ago I added a script to a project that embeds text/binary data (by means of converting them to an include file) in the source. I now need to move this to another project so I was wondering if there was any scope for adding this as a generic feature of the Platform IO Core? If there is how would it be best to add?

Alternatively is there a good way to share ‘extra_scripts’?

Note: I have seen a similar feature for the ESP32, but my understanding is that this is part of the ESP32 SDK rather than part of Platform IO.


#2

Correct. The code that handles this is here: https://github.com/platformio/platform-espressif32/blob/develop/builder/frameworks/_embedtxt_files.py

You can open a feature request at https://github.com/platformio/platformio-core/issues.

Except for copying it over and over and again in all projects, not that I know of it. You can of course also only put the file at one specific place and always refer to it with the same path in each project’s platformio.ini file individually.

Why not use the ESP8266’s SPIFFS for it? https://docs.platformio.org/en/latest/platforms/espressif8266.html#uploading-files-to-file-system-spiffs