I’m using VisualGDB for an embedded project, with STM32F4 device and using the StdPeriph library (not HAL).
My project compiles successfully, and I’m able to debug the same without issues.
I then setup the instrumentation profiler to analyze the performance of various functions of my code.
Now, in my main(), I’ve few functions in the very beginning to setup the device pins, etc. After this I call the InitializeInstrumentingProfiler function to setup the profiler. Now when I debug through the “Analyze” option, I land up in the hardfault handler as soon as the first function to setup the device is called, i.e., even before InitializeInstrumentingProfiler is called. If I debug it normally, i.e., without Analyze, then I don’t face any issue.
I’ve even tried moving the InitializeInstrumentingProfiler as the first call inside main(), but the issue remains the same.
On further debugging, I find that crash happens inside the SYSPROGS_THUMB_HOOK_PROLOGUE sequence which is executed as part of the profiler-stub on entry of each function.
Any ideas to identify and resolve this problem?