Table of Contents

ESP32’s Flash memory is an external SPI-based storage that serves multiple purposes:

  • Stores the firmware (program code)
  • Stores data (files, logs, configuration settings, web assets, etc.)
  • Can be divided into partitions for different functions (e.g., LittleFS, FAT, NVS)

This external SPI-based storage IC is embedded within the ESP32 module and enclosed by a metal shield.

The standard ESP32 includes 4MB of Flash memory, but it supports up to 16MB. You can think of the ESP32’s Flash like a hard drive in a regular PC. Just as a PC’s hard drive stores the operating system while the remaining space is used for user data, ESP32’s Flash stores the firmware, with the rest available for data storage. The LittleFS file system allows reading and writing data to this Flash memory efficiently.

Partitions

Like PC’s hard disk, ESP32 Flash is divided into partitions, such as:

PartitionPurpose
BootloaderHandles ESP32 startup
Application (app)Stores firmware code
SPIFFS/LittleFSFile system storage
NVS (Non-Volatile Storage)Stores key-value data like Wi-Fi credentials

Ram

ESP32 has two types of RAM:

  1. Internal SRAM (320KB–520KB) – Used for variables, stack, and heap.
  2. PSRAM (Optional, External) – Some ESP32 models (e.g., ESP32-WROVER) have an extra 8MB PSRAM for large data handling.

Flash vs Memory (RAM)

Don’t confuse ESP32’s Flash with its RAM. Flash memory is like a PC’s hard drive, permanently storing data, while RAM functions like a PC’s memory, where data is lost when the power is turned off.

FeatureFlash MemoryRAM (SRAM)
TypeNon-volatile (retains data after power loss)Volatile (data lost after power off)
UsageStores firmware, files, settingsStores temporary variables and running programs
SizeUsually 4MB–16MB (external SPI Flash)Usually 320KB–520KB (internal SRAM)
SpeedSlower than RAMMuch faster
Writable?Yes, but has limited write cycles (~100,000)Yes, no write limit

Categorized in:

Storage,

Tagged in: