How to add the hardfault handler on nRF SDK

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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.