AnsweredAssumed Answered

Why Initial SP value do we need?

Question asked by Carter Lee on Oct 19, 2017
Latest reply on May 7, 2018 by William Chang

Hi,

 

I have some question about the relationship which is purpose of Initial SP 0x0000 and Reset 0x004 vector and Flash memory address.

For example, let's assume that  I made one simple firmware and its size is 0x1000.

and I uploaded to Flash memory, the address will be supposed to be 0x08001000.

 

Q1. Why does Stack pointer should be in SRAM area not Flash memory?

Q2. Why Initial SP value do we need and need to know?

 

this is another example,

the following is startup.dis

From here you can see the 20004fff, I think it will be initial stack pointer,

But I can't understand the purpose of set the initial SP value to 0x800000.

There is no any action about 20004fff.

 

Q3, What does 20004fff mean? how and why 20004fff value is in 8000000?

Outcomes