Posts

Showing posts from February, 2025

How to use SPIFFS for ESP32 with Platform.IO

Image
One of my pet projects is a controllable power supply based on the ESP32 with a web interface (GitHub repository: https://github.com/vshcryabets/Esp32AdjPsu ). Previously, I created simple web pages directly in the code using C++. However, in this project, I realized that working this way is not usable — I should separate the firmware code from the web application code. Most often, the SPI Flash File System (SPIFFS) is used for this (official documentation here - https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-reference/storage/spiffs.html ). SPIFFS allows to store data as separate files that can be both read and written. What is the size of SPIFFS? Let’s take a look at the typical flash memory layout in the case of a 4 MB flash ( https://github.com/espressif/arduino-esp32/blob/master/tools/partitions/default.csv ): # Name, Type, SubType, Offset, Size, Flags nvs, data, nvs, 0x9000, 0x5000, otadata, data, ota, 0xe000, 0x2000, app0, app, ota_0, ...