Zephyr's filesystem with PlatformIO

Hi there!

I’m using a STM32 board with the Zephyr/Littlefs example without any problems.
Now I want to know how I could add some extra data (txt, html, etc) into the flash memory?

I saw some examples, for the ESP32 using the the SPIFFS, but I don’t know how to extrapolate that to my situation.

Have anyone used the Zephyr’s filesystem with PlatformIO?

Thank you!

How would you add local files to the LittleEFS partition with Zephyr’s build system?

Hi maxgerhardt,

That is my question :slight_smile:
I don’t know if it is possible to create a specific folder (as include, src, etc) or in some way linking the files during the build time, so I could upload my program and the data at the same time.

Hi there

I have figured it out how to flash my data into uC’s flash (using external STM32 Cube Programmer tool).

I can save the data in the storage_partition defined in dts file but when I upload the program, the data saved in this area is replaced with LittleFS stuff.

How can I keep my data and tell to LittleFS to read it instead of overwrite it?

Doesn’t this piece of code do that?

Hi maxgerhardt,

Nop. My data is replaced right after I upload the program.

Hm then the firmware binary overlaps with with that memory region?

In any case I think the best course of action would be to open an issue at Zephyr (Issues · zephyrproject-rtos/zephyr · GitHub) and have them implement the functionality of including files in partition, building that partition binary and including it in the final output binary, then it’s pretty much automatically in PlatformIO with the next update, because PlatformIO just calls into Zephyr’s (cmake) build system. If it needs additional implementation on the PlatformIO side, a issue in GitHub - platformio/platform-ststm32: ST STM32: development platform for PlatformIO should be opened.