jkent / frogfs

Fast Read-Only General-purpose File System (ESP-IDF and ESP8266_RTOS_SDK compatible)
https://frogfs.readthedocs.io
Mozilla Public License 2.0
25 stars 32 forks source link

How to upload binary to Spiffs once (keep separate from factory_app partition) #25

Closed nathanRamaNoodles closed 2 years ago

nathanRamaNoodles commented 3 years ago

For quick development, I'd like to have the HTML compressed to a spiffs partition once instead of uploading both inside of the factory app partition (it costs time to upload every new change to the main factory app). Is there a way to make use of the spiffsgen.py tool to do this?

jkent commented 3 years ago

This repository is for the ROM filesystem espfs, not the read/write filesystem SPIFFS.

This is what you would do: I've documented this here: https://libespfs.readthedocs.io/en/stable/readme/readme.html#building-an-espfs-image

In your toplevel CMakeLists.txt you could do something like this to get a espfs-flash target:

    define_target_espfs(espfs_bin html ${CMAKE_CURRENT_BINARY_DIR}/espfs.bin)

    idf_component_get_property(main_args esptool_py FLASH_ARGS)
    idf_component_get_property(sub_args esptool_py FLASH_SUB_ARGS)
    esptool_py_flash_target(espfs-flash "${main_args}" "${sub_args}" ALWAYS_PLAINTEXT)
    esptool_py_flash_to_partition(espfs-flash espfs ${CMAKE_CURRENT_BINARY_DIR}/espfs.bin)
    add_dependencies(espfs-flash espfs_bin)