How to choose a memory IC for an STM32 microcontroller?

ampheoampheo
3 min read

here's how to choose a memory IC for an STM32 microcontroller, depending on your use case. STM32 MCUs often benefit from external memory when on-chip flash/RAM isn't enough or persistent storage is needed.


Choosing a Memory IC for STM32

Common STM32 Use Cases

Use CaseExternal Memory Needed?
Running large firmware(QSPI NOR Flash, Execute-in-Place)
Logging sensor data(SPI NAND/EEPROM/SD card)
Storing configuration(EEPROM or FRAM)
Image/audio/video buffer(SRAM or SDRAM)
AI / ML / FFT processing(PSRAM, SDRAM)
Bootloader or firmware update(SPI NOR Flash)

External Flash Memory for Firmware / Code

TypeRecommended ForExample ICs
SPI NOR FlashFirmware storage, XIP (Execute-In-Place)Winbond W25Q128JV (16 MB), Macronix MX25L128
QSPI NOR FlashHigh-speed XIP or code executionMicron N25Q128A, Winbond W25Q64JVSSIM
Parallel NOR FlashLegacy or very fast access systemsNot typical in modern STM32 designs

STM32F7, H7, and L4 series support QSPI with memory-mapped mode, enabling code execution from external flash.


External RAM for Data Buffering / Processing

TypeRecommended ForExample ICs
SRAM (Static RAM)Small, fast memory (<1MB)Alliance AS6C62256, Cypress CY62167
SDRAM (Synchronous DRAM)High-speed frame/data buffersIS42S16400J, MT48LC16M16
PSRAM (Pseudo-SRAM)Large memory + ease of useAPS6404L (4MB), ESP PSRAM64H

STM32F7, H7, and some L4 series support FMC (Flexible Memory Controller) or OctoSPI for interfacing with SRAM/SDRAM.


EEPROM / FRAM for Config/Data Storage

STM32s don't have internal EEPROM (except STM32L series), so external non-volatile memory is often used.

TypeUseExample ICs
EEPROMSmall, infrequent writesMicrochip 24LC256 (I2C), AT25C256 (SPI)
FRAMFrequent updates, low latencyFujitsu MB85RS256 (SPI), Cypress FM25L04

Use I2C or SPI depending on available STM32 pins and speed requirements.


Large Data Storage (e.g. logs, SD card)

TypeUse CaseExample ICs or Options
NAND FlashRaw storage, FAT FSMicron MT29F1G08AB (1Gb), requires wear leveling
SD CardFAT32 file systemsStandard microSD cards (SPI or SDIO mode)
eMMCEmbedded, soldered SDKingston EMMC08G-M627

STM32 HAL + FatFS can be used with SPI, SDIO, or USB Mass Storage.


Interface Support by STM32

Memory TypeInterface OptionsNotes
NOR FlashSPI, QSPI, OctoSPIUse memory-mapped mode for XIP
EEPROMI2C, SPIEasy to interface
FRAMSPI, I2CHigh endurance
SDRAMFMC interfaceNeeds pin-rich STM32 (F7, H7, etc.)
SD CardSPI or SDIOBuilt-in STM32 SDIO peripheral

Real-World Memory Pairing Examples

STM32 ModelMemory Extension Use CaseMemory IC Suggestion
STM32F103Add config storage24LC256 (EEPROM, I2C)
STM32F407Add buffer / frame memoryIS42S16400J (SDRAM, FMC)
STM32F767Boot from external QSPI flashW25Q128JV (QSPI NOR Flash)
STM32H743Log data + AI image bufferAPS6404L (PSRAM), W25Q256JV (Flash)
STM32L432Low-power config storageMB85RC256V (FRAM, I2C)

Final Checklist

  • What do you want to store? (Code, config, logs, images?)

  • Volatile or non-volatile?

  • How much memory is needed?

  • Speed requirements?

  • Available pins/interfaces on your STM32?

  • Endurance and power constraints?

0
Subscribe to my newsletter

Read articles from ampheo directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

ampheo
ampheo