Search code examples
armstackkeil

What is the difference between STACK and TOP_STACK?


I am using µVision IDE - Keil, and there is a .map file, which includes an Image Symbol Table.

I am confused with "STACK" and "TOP_STACK". (Image below)

Why isn't the "TOP_STACK" pointing at the same address as "STACK"? Assuming the program has just been initialised. Are there any data stored in the stack initially that needs 512 bytes of space?

Snippet of .map file


Solution

  • To anyone finding out the answer to this,

    I forgot to mention that it's showing the information of an ARM Cortex-M1 processor.

    For ARM Cortex-M1 processors, the stack is a DESCENDING stack, and I've declared the stack having 512 bytes of space. Therefore, TOP_STACK is pointing to the first availble space. The stack does not store any data at this point of time.