5.3.2. Usage models

This section describes some methods for handling errors in a system. Exactly how you program the processor to handle faults depends on the configuration of your processor and system, and what you are trying to achieve.

If a fault exception is taken, the fault handler reads the information in the link register, Program Status Register (PSR) in the stack, and fault status registers to determine the type of fault. Some types of fault are fatal to the system, and others can be fixed, and program execution resumed. For example, an MPU background MemManage might indicate a stack overflow, and be rectified by allocating more stack and reprogramming the MPU to reflect this. Alternatively, an asynchronous external fault might indicate that a software error meant that a store instruction occurred to an unmapped memory address. Such a fault is fatal to the system or process because no information is recorded about the address the error occurred on, or the instruction that caused the fault.

Table 5.1 shows the types of fault that are typically fatal because either the location of the error is not recorded or the error is unrecoverable. Some faults that are marked as not fatal might turn out to be fatal in some systems when the cause of the error has been determined. For example, an MPU background MemManage fault might indicate a stack overflow, that can be rectified, or it might indicate that, because of a bug, the software has accessed a nonexistent memory location, that can be fatal. These cases can be distinguished by determining the location where the error occurred.

Table 5.1. Types of faults

Type of faultConditionsSourceSynchronousFatal
MPUAccess not permitted by MPU[a]MPUYesNo
Synchronous external Load using external memory interfaceAXIM, AHBPYesNo
Asynchronous externalStore to Normal or Device memory using external memory interfaceAXIM, AHBPNoYes

[a] See the Arm®v7-M Architecture Reference Manual for more information.

Copyright © 2014-2016, 2018 Arm. All rights reserved.ARM DDI 0489F