Hi all,
TL;DR: why does not uvision sets the initial stack pointer to the top of the sram?
Verbose:
I'd like to understand how uVsion sets the top of the stack for STM cortex m0+ devices for a project that I have to inspect and debug (bare metal, no rtos in place).
Also pelase notice that I am familiar with ARMv6m and ARMv7m architecture and startup process.
The configuration I got for the project is the following
I'd expect to see the initial stack pointer in the hex file set to 0x20002000. BUT in the hex file the top of the stack is set to 0x20001918.
This is confirmed by also by inspecting the core registers before startup is called:
If I uncheck the "Use Micro LIB" checkbox in the "Target" tab, I see that the initial stack pointer address changes, so I presume that (at least some of) microlib stuff is allocated in the range [0x2000192A: 0x20002000].
Is this correct?
I also imagine that this is to prevent stack overflow corrupting the library sram before or something similar.
I wasn't able to find documentation on this specific topic (stack and NO RTOS) so any link would also be gladly appreciated.
K.R.
Luca.