Hi,
I want to store some files inside the esp32 in order to play some sounds, I'm using platformio with esp-idf.
I tried with both filesystems, spiffs and littlefs and I receive an error when trying to open for example a .txt built into the image.
my partition table is the following:
Name, Type, SubType, Offset, Size, Flags
# Note: if you have increased the bootloader size, make sure to update the offsets to avoid overlap
nvs, data, nvs, , 0x6000,
phy_init, data, phy, , 0x1000,
factory, app, factory, , 1M,
storage, data, spiffs, , 1M,
and inside my cmakelists.txt i have this:
spiffs_create_partition_image(storage ./data FLASH_IN_PROJECT)
I have no errors on building the filesystem and uploading it:
yet after uploading the code, which mounts the image with the esp_vfs_spiffs_register function and asking esp_spiffs_info i get 0 used space which seems odd.
And calling fopen of "/test.txt" or "/data/test.txt" or other combinations gives always null.
So I don't know how to proceed. I find lots of information about spiffs but the majority are based on Arduino. So a little help would be great.
Thanks
SPIFFS or LittleFS fail at open file
-
- Posts: 46
- Joined: Fri Aug 02, 2019 11:59 pm
Re: SPIFFS or LittleFS fail at open file
Did you make sure to set the base path for LittleFS correctly when initializing it and calling esp_vfs_littlefs_register() to mount the partition?
After mounting the VFS, you can also call esp_littlefs_info(); to see what info you get back and if the VFS has been mounted correctly.
Code: Select all
static esp_vfs_littlefs_conf_t conf =
{
.base_path = "/data",
.partition_label = "data",
.format_if_mount_failed = true,
.dont_mount = false,
};
Who is online
Users browsing this forum: Google [Bot] and 115 guests