In this blog, I would like to share how to add the hardfault handler on the Nordic NRF5 SDK.

You can add the hardfault handler to trigger the problem when it occurs.

Because the priority of hardfault is higher than that of softdevice API.


Step 1

Add the hardfault files inside the project

step1


Step 2

Enable the hardfault in the sdk_config.h

step2.png


Step 3

Compile the debug mode project with additional switch

step3.png


Step 4

Add the example to generate the error 0x80000 is illegal address

step4


Step 5

Open the breakpoint windows and enable the hardfault

step5


Step 6

When the problem occurs, it stops at the hardfault

step6