cancel
Showing results for 
Search instead for 
Did you mean: 

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.

olezhandr
Associate III

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

1 ACCEPTED SOLUTION

Accepted Solutions

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.

View solution in original post

9 REPLIES 9
KnarfB
Principal III

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

Pavel A.
Evangelist III

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

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

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

what is it supposed to give?

olezhandr
Associate III

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

Yes, you're right.

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.

Smart solution, will try)​

Thank you ! This is what I was looking for and searching for call stack window , I am surprised why the stm32cube calls this debug window !