cancel
Showing results for 
Search instead for 
Did you mean: 

what's the initial stack address of stm32?

BeMercy
Associate II
Posted on July 08, 2016 at 09:44

Hi guys:

I've alredy checked the .map file. I found the two

STACK 0x2000c170 Section 2304 startup_stm32f10x_cl.o(STACK)
__initial_sp 0x2000ca70 Data 0 startup_stm32f10x_cl.o(STACK)

And i have the questions below: Is the range of stack address from 0x200ca70-0x200c170? and if the initial stack address if 0x200caDoes that mean every time we used one byte of stack,the sp will - 1? and Does this also mean our total usage of SRAM is 0xca79 (51824/1024 ≈ 50K)
1 REPLY 1
Posted on July 08, 2016 at 12:35

Yes, it means your RAM and heap allocations take up 50K, or so

The stack descends downward 4 bytes (32-bit word) at a time. The SP decrements by 4, and then the register is written to the new location. ie if SP = 0x20001000 the first word would get written at 0x20000FFC

The .MAP shows the base of the stack section, its length, and a pointer to the end of the section/region

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..