When using the ESP-IDF tools to build a project for ESP32, it is possible to make the idf.py flash command write both the application image and a SPIFFS partition content image in one shot by adding the following to project root directory’s CMakeLists.txt file:
Is there an equivalent in PlatformIO that would allow me to flash the SPIFFS data directory at the same as the application? I am using a custom partitions.csv file that includes a SPIFFS partition.
As far as I know the firmware upload and SPIFFS / file system upload are two seperate targets that are not merged (also see code).
You can still execute them in sequence by giving multiple target switches: pio run -t upload -t uploadfs (docs) will compile the firmware if changed, upload the FW and build and upload the filesystem. If you are working in VSCode, see adding custom tasks.