user
With STM32, what is FMC?
alphonsio

In STM32 microcontrollers, FMC stands for Flexible Memory Controller.

It’s a hardware peripheral that allows the MCU to interface efficiently with external memories and devices—especially those that use parallel buses.


Main Purpose

The FMC provides a high-speed, flexible interface between the STM32 and external memory such as:

  • SRAM (Static RAM)
  • NOR Flash
  • NAND Flash
  • PSRAM
  • FRAM
  • LCD parallel interfaces
  • External SDRAM / DDR (on some STM32 families)

Key Features

Depending on the STM32 series, the FMC supports:

  • Multiple memory banks (for different external devices)
  • 8-, 16-, or 32-bit data bus widths
  • Separate or multiplexed address/data buses
  • Programmable timing parameters (setup, hold, wait states)
  • Burst access mode for SDRAM
  • ECC (Error Correction Code) support for NAND
  • Write protection per memory bank

Memory Mapping

Once configured, external memories connected via FMC are mapped into the MCU’s address space.
That means you can access external memory just like internal memory, e.g.:

uint16_t *ext_sram = (uint16_t *)0x60000000;  // Example FMC Bank1 base
ext_sram[0] = 0x1234;  // Writes directly to external SRAM

Common Use Cases

  • Expanding RAM for complex applications (e.g. GUI buffers)
  • Interfacing with external Flash for large data storage
  • Connecting parallel LCDs or display controllers
  • Booting from external memory (on some devices)

Where It’s Found

  • Present on high-performance STM32 families:

    • STM32F4, F7, H7, L4+, etc.
  • On smaller or simpler STM32s, it may be replaced by a FSMC (Flexible Static Memory Controller), which is a predecessor of FMC with fewer features.