mk450: x and y axis basic implementation
[cortex-from-scratch] / link.ld
1 /* (CC-BY-NC-SA) ROBIN KRENS - ROBIN @ ROBINKRENS.NL
2  * 
3  * $LOG$
4  * 2019/7/20 - ROBIN KRENS      
5  * Initial version 
6  * 
7  * $DESCRIPTION$
8  * Linker file for Cortex-M3 STM32 based boards
9  * Boards have similar FLASH and SRAM ORIGINs
10  * LENGTHs differs of course.
11  * 
12  * _start flag is the first procedure to be 
13  * executed (linked to beginning of FLASH at 
14  * 0x08000000). The procedure should do some
15  * basic things, such as set up the stack and
16  * reset and hard fault handler (see start.asm)
17  * *
18  * _endofbss flag is used to calculate the end 
19  * of .bss and the start of (a possible) kernel
20  * heap
21  *
22  * */
23
24 MEMORY
25 {
26         FLASH (xr) : ORIGIN = 0x08000000, LENGTH = 512K
27         SRAM (xrw) : ORIGIN = 0x20000000, LENGTH = 64K
28
29
30 ENTRY(_start) 
31
32 SECTIONS
33 {
34         . = 0x0;
35         .text : ALIGN(4)
36         {
37                 /* (.vector_table */
38                 *(.text)
39                 *(.rodata)
40         }
41         . = 0x20000000; 
42         .data :  
43         {
44                 *(.data)
45         } 
46         .bss : ALIGN(4) 
47         {
48                 *(.bss)
49         }
50         _endofbss = .;  
51 }