CMSIS-View  
Record program events, display status information, and analyze execution faults
 
Loading...
Searching...
No Matches
Theory of operation

This section describes how the Fault component operates and how the fault information can be analyzed.

The Fault component is implemented in the target application using the software component CMSIS-View:Fault:Storage which adds the source file ARM_FaultStorage.c to the application.

This source file provides an ARM_FaultSave function which is used to save the fault information into an uninitialized part of the RAM which can then be analyzed on-chip, or on a host computer using a debugger. When using semihosting, cloud storage, or another remote location for storing the log file, you can do post-processing using eventlist Utility.

Fault information storage

Fault information is stored in an ARM_FaultInfo structure, residing in uninitialized RAM memory, when the ARM_FaultSave function is executed from an exception handler.

Fault information analysis

To see and analyze the details of a fault, there are the following options:

  • Fault information can be decoded and written to the Event Recorder by calling the function ARM_FaultRecord (Event Recorder has to be operational). This is an exemplary output in µVision:
  • Fault information can be decoded and written to the standard output by calling the function ARM_FaultPrint (this function is implemented in a user template and can be changed by the user):
  • Fault information can be inspected in a debug session by viewing it in the Component Viewer (screenshot showing µVision):

Resource requirements

This section contains the the technical data of the Fault component firmware.

RAM:

The Fault component uses the ARM_FaultInfo structure to save information when the fault occurs. The size depends on the Arm Cortex-M core for which the code was compiled:

  • If the Arm Cortex-M core contains Fault Registers (e.g. Cortex-M33), the ARM_FaultInfo structure requires 140 bytes of uninitialized RAM memory.
  • If the Arm Cortex-M core does not contain Fault Registers (e.g. Cortex-M0), the ARM_FaultInfo structure requires 104 bytes of uninitialized RAM memory.

ROM:

The functions of the Fault component require the following amounts of ROM memory:

  • TheARM_FaultSave function requires up to 0.5 KB of ROM memory.
  • The ARM_FaultRecord function requires approximately up to 1.5 KB of ROM memory.
  • The ARM_FaultPrint function requires approximately up to 2.5 KB of ROM memory.