Incorrect static data initialization when debugging external elf in STM32CubeIDE for Visual Studio Code
I have an axf file generated by vscode keil studio, then I followed follwoing tutorial to debug in vscode stm32cube ide.
How to debug an external .elf file in VS Code | Community
Then it triggers hard fault, and debugger shows `SystemCoreClock` is not correctly initialized, when it enters into `main`, the value is initialized to `(uint32_t) -1`.
If I terminate gdb and soft reset it in cube programmer, it works fine, it also works fine when I debug it in vscode keil studio.
The project is a simple cubemx STM32F407 generated project, and enables serial wire debug, the code in main infinite loop is just two ITM_SendChar.
Update:
It only occurs in first time launch, if it enter hard fault then click reset target, it works fine, but data values of SystemCoreClock and uwTickFreq are still -1.
