Skip to main content
olezhandr
Associate III
November 11, 2021
Solved

Advice, please, how to view the function call tree and the contents of the MCU stack using STM32Cubeide. After the program crashes in debug the program loops in Hard_Fault_Handler () and it is not clear what cause such event.

  • November 11, 2021
  • 9 replies
  • 10555 views

What ability to view the contents of the call stack in CubeIDE is present?, i.e. what functions were called before the crash, preferably in the form of a tree

This topic has been closed for replies.
Best answer by KnarfB

If the debugger sits in the while loop, you can set the value of junk to 1 manually and continue stepping out of the handler and back to the code that caused it.

9 replies

KnarfB
Super User
November 11, 2021

You can open the Fault Analyzer View (Windows > Show View > Debug ...) that gives you a little insight.

olezhandr
olezhandrAuthor
Associate III
November 12, 2021

thanks, i know this method but there is no call tree or stack info

Pavel A.
November 12, 2021

Try to change the while(1) in the Hard_Fault_Handler as follows:

static volatile int junk = 0;
while (!junk) {}
 

olezhandr
olezhandrAuthor
Associate III
November 12, 2021

what is it supposed to give?

KnarfB
KnarfBBest answer
Super User
November 12, 2021

If the debugger sits in the while loop, you can set the value of junk to 1 manually and continue stepping out of the handler and back to the code that caused it.

olezhandr
olezhandrAuthor
Associate III
November 12, 2021

I think this is call stack tree))0693W00000GXLvXQAX.png

KnarfB
Super User
November 12, 2021

Yes, you're right.