Creating a custom target "buildfs" based on uploadfs

Do any of you folks know where I can find the source code for how PlatformIO handles the uploadfs target?

As a learning exercise I wanted to create a new target “buildfs” that omits the upload part of building a SPIFFS file system.

Please open an issue here and we will implement it Issues · platformio/platform-espressif8266 · GitHub

1 Like

Is the code for -t uploadfs available online to be studied ? I was hoping to learn from this in order to create my own custom target in extra_script.


1 Like

its not as simple as I thought!! i thought I could get away with drag and dropping that code into my

I’ll make do with a fake upload to build my SPIFFS.bin for now :stuck_out_tongue:

Too hopeful …

from os.path import join
from SCons.Script import AlwaysBuild

def buildFS(source, target, env):
    target_firm = env.DataToBin(
        join("$BUILD_DIR", "spiffs"), "$PROJECTDATA_DIR")

env.AddPreAction("upload", buildFS)

Resolved in the latest release :slight_smile:

1 Like

Documentation doesn’t reflect that this is now available. Neither Redirecting... nor anywhere else I could find helps you find this “buildfs” option

New docs has not been released yet. See the latest version of docs:

If I do “pip install platformio” and I get the version that supports buildfs, I kinda consider that to be “released”

This is a specific issue. PIO Docs is linked with PIO Core repository. As result, it updates when a new release is out. Nevertheless, we have moved docs to separate repository

PIO Docs will live with own life after PIO Core 3.2 release.