esp_vfs_fat_spiflash_mount fails <SOLVED>

User avatar
fly135
Posts: 606
Joined: Wed Jan 03, 2018 8:33 pm
Location: Orlando, FL

esp_vfs_fat_spiflash_mount fails <SOLVED>

Postby fly135 » Fri May 24, 2019 6:12 pm

I'm using IDF v3.1.3 and ran into a problem with esp_vfs_fat_spiflash_mount failing....
static const esp_vfs_fat_mount_config_t mount_config =
{
10, // max_files
true, //format_if_mount_failed
CONFIG_WL_SECTOR_SIZE, // allocation_unit_size
};

err = esp_vfs_fat_spiflash_mount(ffs_base_path, "storage", &mount_config, &s_wl_handle);
The issue is related to how the flash is partitioned. This works...
nvs, data, nvs, 0x9000, 0x4000
otadata, data, ota, 0xd000, 0x2000
phy_init, data, phy, 0xf000, 0x1000,
factory, app, factory, 0x10000, 2M,
storage, data, spiffs, 0x210000, 0xF0000,
ota_0, 0, ota_0, 0x400000, 2M,
ota_1, 0, ota_1, 0x600000, 2M,
This doesn't...
nvs, data, nvs, 0x9000, 0x4000
otadata, data, ota, 0xd000, 0x2000
phy_init, data, phy, 0xf000, 0x1000,
factory, app, factory, 0x10000, 2M,
storage, data, spiffs, 0x210000, 0x80000,
secstore, data, nvs, 0x290000, 0x70000,
ota_0, 0, ota_0, 0x400000, 2M,
ota_1, 0, ota_1, 0x600000, 2M,
This is the failing boot log...
I (28) boot: ESP-IDF v3.1.3-dirty 2nd stage bootloader
I (28) boot: compile time 16:04:36
I (42) boot: Enabling RNG early entropy source...
I (42) qio_mode: Enabling default flash chip QIO
I (42) boot: SPI Speed : 40MHz
I (45) boot: SPI Mode : QIO
I (49) boot: SPI Flash Size : 16MB
I (53) boot: Partition Table:
I (57) boot: ## Label Usage Type ST Offset Length
I (64) boot: 0 nvs WiFi data 01 02 00009000 00004000
I (72) boot: 1 otadata OTA data 01 00 0000d000 00002000
I (79) boot: 2 phy_init RF data 01 01 0000f000 00001000
I (87) boot: 3 factory factory app 00 00 00010000 00200000
I (94) boot: 4 storage Unknown data 01 82 00210000 00080000
I (102) boot: 5 secstore WiFi data 01 02 00290000 00070000
I (109) boot: 6 ota_0 OTA app 00 10 00400000 00200000
I (117) boot: 7 ota_1 OTA app 00 11 00600000 00200000
I (124) boot: End of partition table
I (129) boot: Defaulting to factory image
I (133) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f400020 size=0x4e7d4 (321492) map
I (237) esp_image: segment 1: paddr=0x0005e7fc vaddr=0x3ffc0000 size=0x01814 ( 6164) load
I (239) esp_image: segment 2: paddr=0x00060018 vaddr=0x400d0018 size=0x1170e4 (1143012) map
I (579) esp_image: segment 3: paddr=0x00177104 vaddr=0x3ffc1814 size=0x03370 ( 13168) load
I (583) esp_image: segment 4: paddr=0x0017a47c vaddr=0x40080000 size=0x00400 ( 1024) load
I (586) esp_image: segment 5: paddr=0x0017a884 vaddr=0x40080400 size=0x1d074 (118900) load
I (652) boot: Loaded app from partition at offset 0x10000
I (652) boot: Disabling RNG early entropy source...
Reset reason: 1
run mode = 0
Reboot reason = 0
E (293) vfs_fat_spiflash: f_mkfs failed (14)
Failed to mount FATFS (0xffffffff)
Serial #: SAG2154f-128
ver:evt3-0.5.t.r1 date:25MAY19
This is the successfull boot log....
I (28) boot: ESP-IDF v3.1.3-dirty 2nd stage bootloader
I (28) boot: compile time 13:42:50
I (42) boot: Enabling RNG early entropy source...
I (42) qio_mode: Enabling default flash chip QIO
I (42) boot: SPI Speed : 40MHz
I (45) boot: SPI Mode : QIO
I (49) boot: SPI Flash Size : 16MB
I (53) boot: Partition Table:
I (57) boot: ## Label Usage Type ST Offset Length
I (64) boot: 0 nvs WiFi data 01 02 00009000 00004000
I (72) boot: 1 otadata OTA data 01 00 0000d000 00002000
I (79) boot: 2 phy_init RF data 01 01 0000f000 00001000
I (87) boot: 3 factory factory app 00 00 00010000 00200000
I (94) boot: 4 storage Unknown data 01 82 00210000 000f0000
I (102) boot: 5 ota_0 OTA app 00 10 00400000 00200000
I (109) boot: 6 ota_1 OTA app 00 11 00600000 00200000
I (117) boot: End of partition table
I (121) boot: Defaulting to factory image
I (126) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f400020 size=0x4e7d4 (321492) map
I (229) esp_image: segment 1: paddr=0x0005e7fc vaddr=0x3ffc0000 size=0x01814 ( 6164) load
I (231) esp_image: segment 2: paddr=0x00060018 vaddr=0x400d0018 size=0x1170e4 (1143012) map
I (571) esp_image: segment 3: paddr=0x00177104 vaddr=0x3ffc1814 size=0x03370 ( 13168) load
I (576) esp_image: segment 4: paddr=0x0017a47c vaddr=0x40080000 size=0x00400 ( 1024) load
I (578) esp_image: segment 5: paddr=0x0017a884 vaddr=0x40080400 size=0x1d074 (118900) load
I (644) boot: Loaded app from partition at offset 0x10000
I (644) boot: Disabling RNG early entropy source...
Reset reason: 1
run mode = 0
Reboot reason = 0
Serial #: SAG2154f-128
ver:evt3-0.5.t.r1 date:25MAY19
Anyone got any ideas as to what could be the problem?

John A
Last edited by fly135 on Fri May 24, 2019 7:06 pm, edited 1 time in total.

WiFive
Posts: 2692
Joined: Tue Dec 01, 2015 7:35 am

Re: esp_vfs_fat_spiflash_mount fails

Postby WiFive » Fri May 24, 2019 6:43 pm


User avatar
fly135
Posts: 606
Joined: Wed Jan 03, 2018 8:33 pm
Location: Orlando, FL

Re: esp_vfs_fat_spiflash_mount fails

Postby fly135 » Fri May 24, 2019 7:05 pm

WiFive wrote:
Fri May 24, 2019 6:43 pm
https://www.esp32.com/viewtopic.php?t=3970
OMG! LOL, I already posted in that thread with my own answer. :oops:

Thanks!!!

John A

Who is online

Users browsing this forum: Baidu [Spider] and 17 guests