Skip to main content
Graduate II
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
  • 3 replies
  • 10447 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.

    3 replies

    Super User
    November 11, 2021

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

    olezhandrAuthor
    Graduate II
    November 12, 2021

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

    Super User
    November 12, 2021

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

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

    olezhandrAuthor
    Graduate II
    November 12, 2021

    what is it supposed to give?

    KnarfBAnswer
    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.

    olezhandrAuthor
    Graduate II
    November 12, 2021

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

    Super User
    November 12, 2021

    Yes, you're right.