Embedded Design Handbook

ID 683689
Date 8/28/2023
Public
Document Table of Contents

4.3. Nios® II MPU Usage

The Nios® II MPU Usage section covers the basic features of the Nios® II processor’s optional memory protection unit (MPU), describing how to use it without the support of an operating system (OS). When the Nios® II MPU is enabled and properly configured, it monitors all processor data and instruction accesses and triggers exceptions when illegal accesses are attempted.

Also included are two design examples, with notes about how they work. These examples walk you through making use of the Nios® II processor's MPU in an environment based on the Intel hardware abstraction layer (HAL), without an OS. One of the examples uses the MPU to detect the following three issues commonly seen when debugging embedded systems:

  • Stack overflow
  • Null pointer
  • Wild pointer
Note: Do not confuse the MPU with the Nios® II memory management unit (MMU). The MPU does not provide memory mapping or management.

After you have studied the code and understand the design examples described in this section, you have the skills to use the Nios® II MPU successfully in your HAL-based design. These examples illustrate the basics of how to use mpubase and mpuacc to configure your MPU prior to enabling it.