This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF52832 SDK S132 UsageFault exception

Hi,

I want to implement handler for undefined instruction fault. According to Cortex M4 documentation (ARM DUI 0553A subchapter 2.3.2 "Exception types") this fault leads to UsageFault exception. There is a HardFault_process weak function in SDK (S132 version 3.0.0 according to nrf_sdm.h) but I cannot found something like UsageFault_process.

Should I handle undefined instruction fault in HardFault_process? Or maybe I overlooked handler in SDK for UsageFault?

Best Regards,

  • At least for the GCC toolchain, see components/toolchain/gcc/gcc_startup_nrf52.S which is assembler code that defines the interrupt vectors and defines a weak UsageFault_Handler function which loops forever. Define your own implementation (and link objects/libraries in an order where your definition overrides the weak one?)

    If you mean the library that Nordic provides, cd to the nrf sdk directory and "grep -R HardFault_process *" will show you an implementation exists in components/libraries/hardfault/hardfault.h etc. And in Infocenter there is documentation about that library.

Related