SPIFFS: spiffs partition could not be found

sheikhumar93
Posts: 13
Joined: Fri Aug 10, 2018 7:47 am

SPIFFS: spiffs partition could not be found

Postby sheikhumar93 » Wed Aug 15, 2018 5:47 pm

My spiffs code taken from the example was running absolutely fine until I ran

Code: Select all

make erase_flash partition_table flash monitor
and now when I run my code again it says :
E (16826) SPIFFS: spiffs partition could not be found
E (16831) Example: Failed to find SPIFFS partition
format_if_mount_failed=true is supposed to fix this issue but it is not working.

Code: Select all

ESP_LOGI(TAG, "Initializing SPIFFS");

esp_vfs_spiffs_conf_t conf = {
        .base_path = "/spiffs",
        .partition_label = NULL,
        .max_files = 5,
        .format_if_mount_failed = true
};

// Use settings defined above to initialize and mount SPIFFS filesystem.
// Note: esp_vfs_spiffs_register is an all-in-one convenience function.
esp_err_t ret = esp_vfs_spiffs_register(&conf);

if (ret != ESP_OK) {
    if (ret == ESP_FAIL) {
        ESP_LOGE(TAG, "Failed to mount or format filesystem");
    } else if (ret == ESP_ERR_NOT_FOUND) {
        ESP_LOGE(TAG, "Failed to find SPIFFS partition");
    } else {
        ESP_LOGE(TAG, "Failed to initialize SPIFFS (%s)", esp_err_to_name(ret));
    }
    return;
}
The log is:
I (4) cpu_start: Starting scheduler on APP CPU.
D (199) heap_init: New heap initialised at 0x3ffe0440
D (205) heap_init: New heap initialised at 0x3ffe4350
D (210) intr_alloc: Connected src 16 to int 12 (cpu 0)
I (215) Example: Initializing SPIFFS
E (220) SPIFFS: spiffs partition could not be found
E (225) Example: Failed to find SPIFFS partition
What should I do to solve this?

sheikhumar93
Posts: 13
Joined: Fri Aug 10, 2018 7:47 am

Re: SPIFFS: spiffs partition could not be found

Postby sheikhumar93 » Thu Aug 16, 2018 5:33 am


yalmog
Posts: 1
Joined: Sat Jun 04, 2022 6:33 pm

Re: SPIFFS: spiffs partition could not be found

Postby yalmog » Sat Jun 04, 2022 6:40 pm

I solved it this way:

used "idf.py menuconfig" to change partition table to csv.

created "partitions.csv" with 256KB of spiffs as "/storage":
nvs, data, nvs, 0x9000, 0x6000
phy_init, data, phy, 0xf000, 0x1000
factory, app, factory, 0x10000, 0x100000
storage, data, spiffs, 0x110000, 0x40000

python ..\..\components\partition_table\gen_esp32part.py .\partitions.csv .\partitions.bin

idf.py partition-table-flash

created a folder with my file ./my_spiffs/*.html
python ..\..\components\spiffs\spiffsgen.py 0x40000 .\my_spiffs my_spiffs_img

python ..\..\components\partition_table\parttool.py -p COM3 write_partition --partition-name storage --input .\my_spiffs_img

in code: base_path = "/storage"

Who is online

Users browsing this forum: No registered users and 107 guests