Reference sheet
Memory & storage
EEPROM, flash, FRAM, SD: endurance, speed, retention

Memory & storage
Where to put data that has to outlive a reset. Endurance is the figure most often misread: it counts writes to one cell, not to the chip, so a counter hammering address 0 wears out a million-cycle part while the other 32 KB stay factory-fresh — rotate the address, or buy FRAM. The other trap is granularity: EEPROM and FRAM take a byte at a time, while flash can only clear a whole page or 4 KB sector, so changing one value means reading, erasing and rewriting the block around it.
| Type | Typical size | Interface | Endurance | Write speed | Retention | Cost & notes |
|---|---|---|---|---|---|---|
| MCU internal flash | 32 KB – 2 MB | Internal, self-programming | ~10 000 erase cycles | A page at a time, ms each | 20 years at 85 °C | Free, but it also holds your code |
| MCU EEPROM (AVR) | 512 B – 4 KB | Internal, byte addressable | 100 000 writes per byte | ~3.3 ms per byte | 20 yr at 85 °C, 100 yr at 25 °C | Free. Use update(), not write(). STM32 and ESP32 emulate it in flash |
| I2C EEPROM (24LC256 / 24LC512) | 32–64 KB | I2C, 400 kHz–1 MHz | 1 000 000 writes | 5 ms per page, then wait or ACK-poll | Over 200 years | Cents. A write crossing the 64-byte page wraps back to that page start |
| SPI NOR flash (W25Q128) | 2–16 MB | SPI, 104–133 MHz | 100 000 erase cycles per sector | 256 B page under 1 ms, 4 KB erase 45–400 ms | 20 years | Cheapest bulk store, but a whole 4 KB sector must be erased to change a byte |
| FRAM (FM24CL64, MB85RC256V) | 8–32 KB | I2C or SPI | 10¹²–10¹⁴ writes | Full bus speed, no write delay | 10–150 years, part dependent | 10–50× the price of EEPROM. The only one safe to interrupt mid-write |
| SD / microSD card | Gigabytes | SPI up to 25 MHz, or 4-bit SDIO | Wear-levelled, but small writes kill cheap cards | MB/s, with unpredictable stalls | Years, with no guarantee | Cheap per GB, costly in RAM. Power loss mid-write can take the filesystem |
| RTC / backup RAM | 80 B – 8 KB | Internal (STM32 backup, ESP32 RTC) | Unlimited — it is RAM | Instant | Only while VBAT or sleep power holds | Free. Ideal for a deep-sleep counter, useless across a battery change |







