How does a user check the state before entering hard fault when a hard fault occurs on a M0/M4 microcontroller (MCU)?

Post Reply
a_ziliu
Posts: 208
Joined: 20 Mar 2017, 10:52

27 Mar 2017, 14:05

Since the hard fault is an exception interrupt, user can search code address from the memory address recorded by a stack pointer before entering a hardfault handler, and find the hard fault according to the address.
The steps are as follows:
Get a starting address of the stack pointer in Debug mode;
Enter the starting address to query stack of information in the memory;
The stacked 7th address is the code address before entering an interrupt;
View the content of the code address in the program window, which is the state before entering the hard fault.

Keil RVMDK:


IAR EWARM:

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests