Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add LittleFS and FFat filesystem support #570

Closed
maxgerhardt opened this issue Jun 24, 2021 · 6 comments
Closed

Add LittleFS and FFat filesystem support #570

maxgerhardt opened this issue Jun 24, 2021 · 6 comments
Labels

Comments

@maxgerhardt
Copy link
Contributor

maxgerhardt commented Jun 24, 2021

Right now the only support filesystem builder tool is SPIFFS via mkspiffs

MKSPIFFSTOOL="mkspiffs_${PIOPLATFORM}_" + ("espidf" if "espidf" in env.subst(
"$PIOFRAMEWORK") else "${PIOFRAMEWORK}"),

DataToBin=Builder(
action=env.VerboseAction(" ".join([
'"$MKSPIFFSTOOL"',
"-c", "$SOURCES",
"-p", "$SPIFFS_PAGE",
"-b", "$SPIFFS_BLOCK",
"-s", "$SPIFFS_SIZE",
"$TARGET"
]), "Building SPIFFS image from '$SOURCES' directory to $TARGET"),
emitter=__fetch_spiffs_size,
source_factory=env.Dir,
suffix=".bin"
)

this should be expanded so that, as for the ESP8266 other filesystems are supported. Per https://github.com/lorol/arduino-esp32fs-plugin and Arduino-ESP32, SPIFFS, LittleFS and FFat filesystems are supported.

For generation of the image, analogue to mkspiffs and mklittlefs, the tool mkfatfs may be usable. The version used in the Arduino IDE is at https://github.com/lorol/arduino-esp32fatfs-plugin/tree/master/extra (refer package for mkfatfs)

@maxgerhardt
Copy link
Contributor Author

For reference, I've created a project at https://github.com/maxgerhardt/pio-esp32-fatfs-example with a modified https://github.com/maxgerhardt/platform-espressif32 that allows using FatFs. The only thing that's missing is that tool-mkfatfs gets uploaded and referenced as a package, I've just thrown it into the project folder there.

@PierreRambaud
Copy link

The tool works like a charm! Thanks for sharing!

@Algonsi
Copy link

Algonsi commented May 10, 2022

I work with PlatformIO in VSCode, updated to the latest versions to date, to develop applications with ESP32.
Espressif 32 platform version 4.0.0 says "Added support for LittleFS and FFat filesystems (#546, #570, #643)"
I have version 4.2.0 installed and set 'platform = espressif32' in platformio.ini, but when I try to 'Build Filesystem Image' (or Upload) from the menu provided by the PlatformIO icon, I get the error '""mkffat"" not recognized as an internal or external command' and the image is not builded.
Is this issue fixed?
How could I Build or Upload Filesystem Image with espressif32 platform?
Should I keep using the platform 'https://github.com/maxgerhardt/platform-espressif32' as I have been doing so far?

@maxgerhardt
Copy link
Contributor Author

maxgerhardt commented May 10, 2022

With official support, my platform doesn't need to be used anymore. Try and go into <home folder>/.platformio/platforms and remove all espressif32* folders, then build your project again with the standard platform = espressif32 directive. It should download & use the latest 4.2.0 platform. Make sure to follow https://docs.platformio.org/en/latest/platforms/espressif32.html#uploading-files-to-file-system to select the correct filesystem, that is

board_build.filesystem = fatfs

If that still does not work, please show your project folder structure + full platformio.ini.

@maxgerhardt
Copy link
Contributor Author

I think the documentation can be improved on that, see PR linked above ^.

@Algonsi
Copy link

Algonsi commented May 10, 2022

Thank you very much for your fast and accurate help.
You made me realize that I had set
board_build.filesystem = ffat
When I have corrected it to 'fatfs', the problem disappeared.
Thanks again, you do a great job.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants