Using a memory management unit

Colin Walls, Mentor Graphics embedded.com (February 09, 2014)

Memory management units (MMUs) are incorporated in, or available for, a wide range of embedded CPUs. Under some circumstances their use is mandatory; in other situations they might represent an unwanted overhead. This article looks at what MMUs do and how they might be applied. Process and thread models for multi-tasking are compared and contrasted, and an intermediate option is considered that might provide a compromise between security and performance requirements.

Physical and logical addresses

When you first start learning how to program, the concept of an address is unimportant, as high level languages insulate the programmer from such nastiness. It is only when a developer wants to understand or write assembly language or really appreciate what is happening with pointers that addresses become a concern.

Every byte of memory has a unique address. Actually that is not quite true, as some processor architectures utilize multiple address spaces, but ultimately every byte may be specified uniquely in some way. Commonly, a system has a single area of memory with a starting address of zero. This is not a firm rule, as the memory architecture could be set up such that the address space starts at some other value. Other systems have multiple areas of memory that may not be contiguous – maybe the program and data memory are separate, for example.