Question
What is stm32fxx_xx.s startup file for?
Posted on March 03, 2016 at 09:22
I have spent time reading this code. It is like, I can understand every part of the code itself from grammar, but know nothing on big picture.For example, I know it is the first code would be run after power on,it setup the stack, heap, interrupt entry address,and then load main() function.However, is there anything that I can play with it? Such as the stack and heap setup code below:------------------------------------------------------------------------------------------------; Amount of memory (in bytes) allocated for Stack; Tailor this value to your application needs; <h> Stack Configuration; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>; </h>Stack_Size EQU 0x00000400 AREA STACK, NOINIT, READWRITE, ALIGN=3Stack_Mem SPACE Stack_Size__initial_sp ; <h> Heap Configuration; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>; </h>Heap_Size EQU 0x00000200 AREA HEAP, NOINIT, READWRITE, ALIGN=3__heap_baseHeap_Mem SPACE Heap_Size__heap_limit--------------------------------------------------------------------------------------------------The code above set stack size to 0x00000400, heap size to 0x00000200, but why? Can I change it? Based on what criteria?Is this .s code specified to MCU core or board level? Do I need to modify the code if I design a different board with different peripherals but with same MCU?In other words, When, and how, must I make modifications to this .s startup file?
Hi all,
Thanks in advance for your time spent on this topic.I have spent several months on STM32 project, fine with software coding, but keep confusion on the startup file, which would appear inalmost every project as below. I think everyone of you also should be very familiar with it.
I have spent time reading this code. It is like, I can understand every part of the code itself from grammar, but know nothing on big picture.For example, I know it is the first code would be run after power on,it setup the stack, heap, interrupt entry address,and then load main() function.However, is there anything that I can play with it? Such as the stack and heap setup code below:------------------------------------------------------------------------------------------------; Amount of memory (in bytes) allocated for Stack; Tailor this value to your application needs; <h> Stack Configuration; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>; </h>Stack_Size EQU 0x00000400 AREA STACK, NOINIT, READWRITE, ALIGN=3Stack_Mem SPACE Stack_Size__initial_sp ; <h> Heap Configuration; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>; </h>Heap_Size EQU 0x00000200 AREA HEAP, NOINIT, READWRITE, ALIGN=3__heap_baseHeap_Mem SPACE Heap_Size__heap_limit--------------------------------------------------------------------------------------------------The code above set stack size to 0x00000400, heap size to 0x00000200, but why? Can I change it? Based on what criteria?Is this .s code specified to MCU core or board level? Do I need to modify the code if I design a different board with different peripherals but with same MCU?In other words, When, and how, must I make modifications to this .s startup file? Thanks~~ #startup-file