Hi, Isvan,
Frankly speaking, I have not seen which global variable is overwritten by local variable from the screenshot you gave, can you clarify which global variable is overwritten by which local variable?
Generally, the local variables are saved in stack, the global variables are saved in a specific location, if the global variables are overwritten by stack unexpectedly, it means that the stack size is too small, you can redefine the stack size in the linker file, for example _StackSize = 0x2000;
Hope it can help you.
BR
XiangJun Rong