Fault Exceptions

Q

How can I force a ARM Cortex-M4 fault exception like UsageFault or BusFault for Software Verification?

A
// usage fault nopc
asm volatile("MCR p12, 0, R0, c15, c0, 0;\n");


// busfault - alignment
uint32_t* pulForceFault = (uint32_t*) 1;
*pulForceFault=0;

UsageFaults, BusFaults, etc. may be escalated to a HardFault, if the respective fault handler is not enabled.

The HardFault Status Register HFSR or the Configurable Fault Status Register - CFSR (combined Usage-, Bus- and Memory Managment Fault Status Register) - may be evaluated to get further information.

Refer to respective documentation from ARM, like the "Cortex ™ -M4 Devices Generic User Guide" and the "ARM ® v7-M Architecture Reference Manual".



 http://infocenter.arm.com