Embedded Design Handbook

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

4.3.2.2.1. MPU Programming Guidelines

Software is responsible for enabling and configuring the MPU as well as maintaining MPU region information. In a single-threaded operating environment (such as the Intel FPGA HAL), use a global data structure to store the MPU region information.

The Nios® II MPU must be disabled before software attempts to configure it.

Software normally initializes the MPU after reset. If it is necessary to change MPU regions or region permissions after reset, software also reinitializes the MPU.

Every region supported by the MPU must be either configured or disabled before allowing application code to execute. Leaving a region enabled and unconfigured results in undefined behavior. For details about how to disable an MPU region, refer to “Defining Regions with mpubase and mpuacc” section.

Depending on the complexity of your software, you might need to define several MPU configurations, each with a different set of regions or region permissions. This technique is typically used by an operating system. For details, refer to “Operating Systems and the MPU” section.