Embedded Systems: which one is better ,a CPU with or without MMU (Memory Management Unit)

Wassim Dhokar
2 min readJan 26, 2024

--

MMU Address Mapping

When it comes to MMU , a CPU having MMU will be able to run full operating system with multi-tasking scheduling and program running in parallel (or seems to the user running in parallel), and to achieve such purpose we need to create the illusion for each running program that it has all addressing space that exist totally available for it in contiguous manner, however in reality there is limited size of available physical memory , so based on that we need some hardware block to allow to create a mapping between what is called virtual addressing space and physical addressing space and create the isolation between different process running within a program , this mapping and isolation is managed by the MMU :

  • Each Program will see only virtual address not the physical address space
  • MMU will translate at hardware level the Virtual Address to Physical one on each time the processor perform memory access
  • MMU will use Translation table (lockup table) to be able to break down the virtual address in multiple equal sized blocks and each block will be handled by single translation table entry
  • Such division of Virtual space to equal sized blocks allow flexibility when it comes to memory allocation for each running process , also we can easily swap the blockers related process out and in from physical memory depends if the process will execute or not, and the reference to that block is tagged in separate Translation Table entry and this is what is called paging (lazy-swapping) for partial process blocks swapping or swapping for full process based blocks.

So without MMU is practically impossible to run full featured operating systems as we know in our days, on normal microcontroller platforms deploying a CPU without an MMU we may have a running some basic Operating System on pure physical address without the need to have virtual address space (like Micro-Linux), but still not fully featured OS like normal Linux or Windows OS.

The main purpose of such systems not having MMU and virtual address space is to run real time based application, where deterministic results is the most critical criteria in such use case, and were having MMU may cause uncertainty and no deterministic behavior of the result , specially that a system deploying an MMU will come with the cost to have cache memory to compensate the translation overhead between virtual and physical address, and using cache will lead to indeterministic behavior in most of the cases.

Such MCU based systems , are depoying real time based operating systems like freeRTOS or RTOS2or threadx ones.

So the answer is which one is better a system with MMU or without , is more related to the use case.

--

--

Wassim Dhokar

Embedded System Expert, Specialist on ARM-based System On Chip, trying to Help People to learn embedded systems in easy way