Introduction to Fault Trace module
1. Fault Trace module introduction
The Fault Trace module is a module provided by the GR5xx SDK to assist in locating system anomalies during the development and debugging phase. The module supports the following utility functions:
Store the exception information into NVDS, which is convenient for exception recording and subsequent analysis.
Supports multiple ways to read the saved exception information: using GRToolbox App to read via Bluetooth LE, or GProgrammer tool to read via J-Link/Serial port.
The optional cortex-backtrace component, which records the contents of the exception cause indicated by adding call stacks and HFSR registers when the exception occurs.
Please refer to “GR5xx Fault Trace Module Application Note” for details on how to use the Fault Trace module.
2. Precautions for using Fault Trace Module
Fault Trace module depends on APP LOG module, Assert module and Error module, when using it, you need to make sure the following files are added to the project, and add the directory where they are located to the Include Path:
components\libraries\app_assert\app_assert.ccomponents\libraries\app_error\app_error.ccomponents\libraries\app_log\app_log.c
The Fault Trace module not only supports logging HardFault exceptions, but also supports logging errors generated by the macros
APP_ERROR_CHECK,APP_BOOL_CHECKandAPP_ASSERT_CHECK.The Fault Trace module supports 16 error messages by default, and this limit can be adjusted by the macro
FAULT_INFO_RECORDS_MAXincomponents\libraries\fault_trace\fault_trace.h. Error messages that exceed the upper limit number of entries are looped through to overwrite the oldest error messages.To use the extended functionality of Cortex Backtrace, you need to set the value of the macro
ENABLE_BACKTRACE_FEAto1in custom_config.h.