mk450: x and y axis basic implementation
[cortex-from-scratch] / link.ld
diff --git a/link.ld b/link.ld
index 903f1f5..d8361dc 100644 (file)
--- a/link.ld
+++ b/link.ld
@@ -1,21 +1,51 @@
+/* (CC-BY-NC-SA) ROBIN KRENS - ROBIN @ ROBINKRENS.NL
+ * 
+ * $LOG$
+ * 2019/7/20 - ROBIN KRENS     
+ * Initial version 
+ * 
+ * $DESCRIPTION$
+ * Linker file for Cortex-M3 STM32 based boards
+ * Boards have similar FLASH and SRAM ORIGINs
+ * LENGTHs differs of course.
+ * 
+ * _start flag is the first procedure to be 
+ * executed (linked to beginning of FLASH at 
+ * 0x08000000). The procedure should do some
+ * basic things, such as set up the stack and
+ * reset and hard fault handler (see start.asm)
+ * *
+ * _endofbss flag is used to calculate the end 
+ * of .bss and the start of (a possible) kernel
+ * heap
+ *
+ * */
+
 MEMORY
 {
-       FLASH (xr) : ORIGIN = 0x00000000, LENGTH = 512K
+       FLASH (xr) : ORIGIN = 0x08000000, LENGTH = 512K
        SRAM (xrw) : ORIGIN = 0x20000000, LENGTH = 64K
-}
+} 
 
-ENTRY(_start)
+ENTRY(_start) 
 
 SECTIONS
 {
+       . = 0x0;
        .text : ALIGN(4)
        {
-               /* (.vector_table */ 
+               /* (.vector_table */
                *(.text)
-
-       } > FLASH
-       .data : 
+               *(.rodata)
+       }
+        . = 0x20000000;        
+       .data :  
        {
                *(.data)
-       } > SRAM
+       } 
+       .bss : ALIGN(4) 
+       {
+               *(.bss)
+       }
+               _endofbss = .;  
 }