diff --git a/linker.ld b/linker.ld index e1bf2b8..183ee4f 100644 --- a/linker.ld +++ b/linker.ld @@ -1,6 +1,8 @@ /* * Filename: linker.ld * Micro-Controller: stm32f103c8t6 + * Cortex-M3 and Cortex-M4 only need to be 4byte aligned where as + * other's might need 8byte or something differnt. */ @@ -66,29 +68,30 @@ SECTIONS } > RAM AT > FLASH /* BSS: Placed in SRAM memory types. */ + /* Holds all uninitialized globals and static variables.*/ .bss : { - _sbss = .; /* */ - *(.bss) /**/ - *(COMMON) /**/ - _ebss = .; /**/ + _sbss = .; /* Start of BSS */ + *(.bss) /* Uninitialized data */ + *(COMMON) /* Common symbols (zero-init) */ + _ebss = .; /* End of BSS */ } > RAM - /* Stack Section: */ + /* Stack Section: Sizes known at compile time. */ ._stack : { - . = ALIGN(8); /**/ - _estack = .; /**/ - . = . + 2048; /**/ - _sstack = .; /**/ + . = ALIGN(8); /* Align to 8-byte boundry */ + _estack = .; /* End of stack (top of the stack) */ + . = . + 2048; /* Reserve 2KB for stack */ + _sstack = .; /*Start of stack */ } > RAM - /* Heap Section: */ + /* Heap Section: Used for dynamic memory allocation. */ .heap : { - _sheap = .; /**/ - . = . + 2048; /**/ - _eheap = .; /**/ + _sheap = .; /* Start of heap */ + . = . + 2048; /* Reserve 2 KB for heap */ + _eheap = .; /* End of heap */ } > RAM }