This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Stacktrace into memory

Keil MDK ARM has cool feature named "Call Stack + Locals". While debugging in this windows we can see order of functions call (stacktrace) and local variables.
Is it possible with MDK ARM save the stack trace in MCU's memory?

Parents
  • Is it possible with MDK ARM save the stack trace in MCU's memory?

    No. Nor would it do you much good in there.

    You need uVision connected to the target MCU and the application's ELF file loaded to get the call stack unwound and displayed textually. So you already have it on your PC and you can look at it there. There would be nothing to be gained by putting it into the MCU at that point.

    The MCU on its own has implied knowledge about the current data and layout of the stack, of course, because the running code has to work with it. But it has no idea what all that means in terms of function names, function arguments, local variables, etc.

    To make sense of a stack's state and display it in comprehensible form takes symbolic debug information (that's all the stuff that makes an ELF file so much bigger than the .hex file you make from it). The MCU, pretty much by definition, doesn't have that.

Reply
  • Is it possible with MDK ARM save the stack trace in MCU's memory?

    No. Nor would it do you much good in there.

    You need uVision connected to the target MCU and the application's ELF file loaded to get the call stack unwound and displayed textually. So you already have it on your PC and you can look at it there. There would be nothing to be gained by putting it into the MCU at that point.

    The MCU on its own has implied knowledge about the current data and layout of the stack, of course, because the running code has to work with it. But it has no idea what all that means in terms of function names, function arguments, local variables, etc.

    To make sense of a stack's state and display it in comprehensible form takes symbolic debug information (that's all the stuff that makes an ELF file so much bigger than the .hex file you make from it). The MCU, pretty much by definition, doesn't have that.

Children