AnsweredAssumed Answered

Stack memory location (STM32F205)

Question asked by valeev.kamil on Dec 23, 2015
Latest reply on Dec 23, 2015 by Clive One
Greetings forum,

I'm having a hard time understanding where is the stack located in the memory. In linker configuration file there's only one option you could change regarding stack -- it's stack size and it's default value is 0x2000. And there's also option to change the RAM starting address which is 0x20000000 by default. Hence one can assume that the stack is located in the region from 0x20000000 to 0x20002000, but in reality when I run the debugger, it shows that the current StackPointer (R13) value is 0x200035C0. So I assume that stack lies in region from 0x200015C0 to 0x200035C0. So I have the following questons in my mind:
1) What is located in the begining of the RAM? User Data?
2) What should I do in order to force stack to start from the beginning of the RAM?

Why do I even care about it? When using internal bootloader, you have to load Stack Pointer with the default value located in the first word of the SystemMemory (0x1fff0000). In STM32F205 the 0x20001000 value is located there, which does not belong to my stack interval (15C0-35C0). And when I'm using the debugger it warns me about it:
 "The stack pointer for stack 'CSTACK' (currently 0x20000FD0) is outside the stack range (0x200015C0 to 0x200035C0)".
However, bootloader is seems to work fine and I wonder what should I do in this situation: load stack pointer with the value 0x200035C0 or maybe something else.

I'm using STM32F205, IAR Embedded Workbench.

Thank you for your attention.