2024-07-04 02:50 AM
Hi
I would like to store the call stack when the STM32H7 crashes. I implemented unwind.h
The code works on a bare metal simple est code but not with FreeRTOS is running
Any idea as to why?
The code
static uint16_t CallStackAddr;
CALLSTACK_DATA uint32_t Address[MaxCallDepth];
_Unwind_Reason_Code trace_func(struct _Unwind_Context *context, void *arg)
{
void *ip = (void *)_Unwind_GetIP(context);
Address[CallStackAddr] = (uint32_t) ip;
if(CallStackAddr < MaxCallDepth)
{
CallStackAddr++;
}
return _URC_NO_REASON;
}
void GetTrace(void)
{
__disable_irq();
_Unwind_Reason_Code ret = _Unwind_Backtrace((_Unwind_Trace_Fn)&trace_func, NULL);
Address[CallStackAddr] = 0xF0F0F0F0;
}
2024-07-04 04:18 AM
Dear @DCorn ,
Please review these recommendations on how to post a thread in this community mainly on how to share the code.
Thank you for your understanding.