Chapter 4. Software framework
Note: The address to be ashed in step 2 must be the corresponding partition address in the partition table where
FatFs is mounted, and the image created must be the same size as the one set in the partition table. Please remember to
go to menucong and set Component config -> Wear Levelling -> Wear Levelling library
sector size to 512, or the mounting would fail.
What are the dierences between the two le systems, FatFs and SPIFFS, and how do we choose?
Please refer to File System <https://github.com/espressif/esp-iot-
solution/blob/master/docs/en/storage/le_system.rst>.
What is the maximum size supported by FatFs?
Due to the limitations of the Windows system, FatFs is currently generally only available on storage
devices up to 32 GB. Storage devices larger than 32 GB use other le systems, such as exFAT.
I cannot open the les with long names when I use the FAT le system. How can I x this issue?
You can change the conguration in menuconfig > Component config > FAT Filesystem
support > Long filename support by selecting the option Long filename buffer in
heap or Long filename buffer on stack. Then you can update the maximum lengh in
Component config > FAT Filesystem support > Max long filename length.
When I used the ext_ash_fatfs example to test, I encountered an error vfs_fat_spiflash :f_mks
failed(14),config:Failed to mount FATFS(ESP_FAIL) if I set the fats partition to less than
512 KB. How can I solve it?
• A FAT partition has 128 sectors at the minimum, so the minimum size of the le system should be
128*4+4*4=528 KB. The extra four sectors are used for wear leveling information. As a result, the size
of the fats partition must not be less than 528 KB.
4.8.2 Non-Volatile Storage (NVS)
If data needs to be stored or updated to ash every minute, can ESP32 NVS meet this requirement?
According to NVS Specications, NVS uses two main entities in its operation: pages and entries. Log-
ical page corresponds to one physical sector of ash memory. For now, we assume that ash sector
is 4096 bytes and each page can contain 126 entries (32 bytes for one entry), with the left spaces for
page header (32 bytes) and entry state bitmap (32 bytes). Typical ash lifetime is 100 k erase cycles.
Assuming that the device is expected to run for 10 years, and the data size written to ash is 4 bytes
per minute with ash encryption disabled, then the number of ash write operation can be calculated as:
60×24×365×10=5256000. In this way, no more than 42 k of erase cycles (5256000/126) will be caused
Espressif Systems 110
Submit Document Feedback
Release master