This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

In the Keil, how to Set initial stack pointer (MSP) by changing linker script? Relevant example would help.

In the Keil, how to Set initial stack pointer (MSP) by changing linker script? Relevant example would help.

Parents
  • Linker script specifies how linker should position code and variables in the memory.
    So, if you specify a memory region for stack it will allocate the memory at specified position in RAM.

    For Cortex-M cores CPU loads initial stack pointer with value at address 0, it is usually defined in startup files (vectors).

    First address specifies initial stack pointer (loaded to MSP) and second address (at offset 4) specifies the reset vector, initial PC value.

Reply
  • Linker script specifies how linker should position code and variables in the memory.
    So, if you specify a memory region for stack it will allocate the memory at specified position in RAM.

    For Cortex-M cores CPU loads initial stack pointer with value at address 0, it is usually defined in startup files (vectors).

    First address specifies initial stack pointer (loaded to MSP) and second address (at offset 4) specifies the reset vector, initial PC value.

Children