What are the types of processor faults in Arm® Cortex®-M? How do you generate and identify the processor faults?
There are four types of processor faults in Arm Cortex-M. These are:
Processor faults can be identified by reading the Fault Status registers and by checking the bit names for the specified fault. The attached zipped folder (KBA_faults_handler.zip) contains the application file that generates the faults and the fault handler file. The fault handler file identifies the fault and displays the relevant information on the terminal.
- The handlers for the BusFault, MemManage Fault, and UsageFault must be enabled in the System Handler Control and State Register (SHCSR), otherwise HardFault handler will take care of the generated faults.
- This bit enabling is handled in configure_fault_register function in the application code.
- The handler file (platform_unhandled_isr.c) in the zipped folder is to be integrated in Cortex-M based MCU folders (STM32F4xx, STM32F2xx) to handle the faults.