MCU memory size selection guide

MCU Memory Size Selection Guide

Microcontroller performance is often evaluated through clock frequency, core architecture, or peripheral integration, yet memory sizing remains one of the most underestimated factors in embedded system design. An MCU with insufficient memory may force costly hardware redesigns, while an oversized device can unnecessarily increase BOM costs and power consumption.

In modern embedded applications—from industrial automation and IoT sensors to automotive electronics and medical equipment—memory requirements are expanding rapidly as communication stacks, security features, diagnostics, and firmware update capabilities become standard design elements. Selecting the appropriate Flash and SRAM capacity therefore requires a careful assessment of both current functionality and future software growth.

Understanding the Two Critical Memory Types

When evaluating MCU memory resources, engineers primarily focus on Flash memory and SRAM.

Flash Memory

Flash stores:

  • Application firmware

  • Bootloaders

  • Communication stacks

  • Security libraries

  • Configuration data

Flash contents remain intact when power is removed.

SRAM

SRAM serves as temporary working memory during runtime.

It stores:

  • Variables

  • Communication buffers

  • Stack memory

  • RTOS tasks

  • Sensor data

  • Temporary calculations

A project can fail due to SRAM shortages even when substantial Flash memory remains available.

The balance between these two memory types is often more important than the total memory size itself.

Firmware Complexity Drives Flash Requirements

A decade ago, many embedded products operated comfortably within 32 KB of Flash. Today's connected devices frequently require ten times that amount before application code is even added.

Typical Flash consumption:

Software ComponentTypical Flash Usage
Basic Application Logic20–80 KB
USB Stack20–60 KB
CANopen Stack30–100 KB
Modbus TCP Stack20–80 KB
BLE Protocol Stack100–300 KB
TLS Security Library100–500 KB
OTA Update Framework50–200 KB

A simple industrial sensor may require only 128 KB of Flash.

An Industrial IoT gateway supporting:

  • Ethernet

  • MQTT

  • TLS encryption

  • Remote diagnostics

  • OTA updates

can easily exceed 1 MB.

This trend has significantly increased the adoption of Cortex-M4, Cortex-M7, and Cortex-M33 devices equipped with larger Flash capacities.

SRAM Is Often the Hidden Bottleneck

Flash shortages are relatively easy to identify during development. SRAM limitations, however, frequently emerge later during system integration.

Memory consumption increases rapidly when applications require:

  • Multiple communication channels

  • Large packet buffers

  • RTOS task management

  • Sensor fusion algorithms

  • Digital signal processing

Typical SRAM requirements:

Application TypeRecommended SRAM
Basic Sensor Node8–16 KB
Industrial Controller64–128 KB
BLE Device64–128 KB
Smart Meter64–256 KB
Industrial Gateway256 KB–1 MB

An Ethernet packet buffer alone may consume several kilobytes. Multiple network interfaces operating simultaneously can significantly increase memory requirements.

Many embedded developers discover SRAM limitations only after adding diagnostics, logging, or cybersecurity features late in the project lifecycle.

The Impact of RTOS Deployment

The adoption of Real-Time Operating Systems has fundamentally changed memory planning.

A typical RTOS-based application may include:

  • Communication task

  • Sensor task

  • Diagnostic task

  • User interface task

  • Logging task

Each task requires:

  • Stack allocation

  • Context switching resources

  • Kernel management structures

Typical memory allocation:

RTOS ElementSRAM Requirement
Kernel5–20 KB
Individual Task1–8 KB
Communication Buffers10–100 KB
Network Stack20–200 KB

An application requiring only 16 KB of SRAM in a bare-metal design may require 64 KB or more after RTOS integration.

Memory Planning for IoT Devices

IoT applications introduce additional memory considerations.

Modern connected devices frequently support:

  • Secure boot

  • Firmware authentication

  • Encrypted communication

  • Cloud connectivity

  • OTA updates

These features consume substantial Flash and SRAM resources.

Recommended memory ranges:

IoT Device TypeFlashSRAM
BLE Beacon64–128 KB16 KB
Wireless Sensor256 KB64 KB
Asset Tracker512 KB128 KB
Smart Meter512 KB–1 MB128–256 KB
Industrial IoT Gateway1–2 MB512 KB–1 MB

Designing solely around the initial firmware version often results in future limitations when additional functionality is introduced.

Security Features Require Additional Memory

Cybersecurity requirements continue to increase across industrial, automotive, healthcare, and IoT sectors.

Common security features include:

  • Secure boot

  • Certificate management

  • AES encryption

  • TLS communication

  • Secure storage

Approximate Flash usage:

Security FunctionFlash Requirement
AES Library10–30 KB
Secure Boot20–80 KB
TLS Stack100–500 KB
Certificate Storage10–100 KB

A project originally designed around 256 KB Flash may quickly require 512 KB or more once modern security measures are implemented.

OTA Updates Change Memory Requirements

Firmware-over-the-air updates have become standard in many embedded systems.

Two common update architectures exist:

Single Image Update

Advantages:

  • Lower Flash requirement

Disadvantages:

  • Higher update risk

Dual Bank Update

Advantages:

  • Improved reliability

  • Rollback capability

Disadvantages:

  • Requires significantly more Flash

Memory comparison:

Update MethodFlash Requirement
Single Image1× Firmware Size
Dual Bank2× Firmware Size

A firmware image occupying 500 KB may require 1 MB of Flash when dual-bank update capability is implemented.

Practical Memory Sizing Examples

Smart Temperature Sensor

Requirements:

  • Sensor acquisition

  • BLE communication

  • Battery monitoring

Recommended:

  • 256 KB Flash

  • 64 KB SRAM

PLC I/O Module

Requirements:

  • CAN communication

  • Diagnostics

  • RTOS

Recommended:

  • 512 KB Flash

  • 128 KB SRAM

Industrial Gateway

Requirements:

  • Ethernet

  • MQTT

  • TLS

  • Data logging

  • OTA updates

Recommended:

  • 2 MB Flash

  • 512 KB–1 MB SRAM

EV Battery Management Controller

Requirements:

  • Functional safety

  • CAN FD

  • Diagnostics

  • Security

Recommended:

  • 1–2 MB Flash

  • 256–512 KB SRAM

Planning for Future Expansion

One of the most effective engineering practices involves reserving memory margins during initial design.

Industry experience suggests:

Flash Margin

Reserve:

30–50%

SRAM Margin

Reserve:

20–40%

A project consuming 70% of available Flash at release often exceeds memory limits within several years as features evolve.

Long-lifecycle products—particularly in industrial automation, automotive electronics, and medical equipment—benefit substantially from conservative memory planning.

Supply Chain Support and Quality Assurance

Selecting the correct MCU memory configuration is only part of a successful embedded design strategy. Long-term component availability, traceability, and lifecycle support are equally important, especially for industrial and automotive applications expected to remain in production for many years.

Our company specializes in supplying internationally recognized semiconductor brands, including STM32, NXP, Renesas, Infineon, Texas Instruments, Microchip, ADI, Onsemi, and other leading MCU manufacturers. We provide:

  • MCU selection support

  • Memory configuration recommendations

  • Alternative component analysis

  • BOM matching services

  • Long-term supply programs

  • Obsolete component sourcing

  • Date code and lot code verification

  • Full traceability management

Strict incoming inspection procedures, supplier qualification systems, packaging verification processes, and counterfeit avoidance programs help ensure component authenticity and quality consistency. Semi also supports customers with lifecycle sourcing strategies designed to reduce procurement risks and maintain stable production throughout extended product lifecycles.

#MCUMemory #EmbeddedSystems #FlashMemory #SRAM #MCUSelection #IndustrialAutomation #IoTDevices #SemiconductorSourcing