-
Notifications
You must be signed in to change notification settings - Fork 1
/
link.ld
60 lines (56 loc) · 1.07 KB
/
link.ld
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/* (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
*
* */
KHEAP_SIZE = 0x100;
MEMORY
{
FLASH (xr) : ORIGIN = 0x08000000, LENGTH = 512K
SRAM (xrw) : ORIGIN = 0x20000000, LENGTH = 64K
}
ENTRY(_start)
SECTIONS
{
. = 0x0;
.text : ALIGN(4)
{
/* (.vector_table */
*(.text)
*(.rodata)
data_lma = .;
}
. = 0x20000000;
data_vma = .;
.data : AT (data_lma)
{
*(.data)
}
data_end = .;
.bss : ALIGN(4)
{
*(.bss)
}
_endofbss = .;
_beginofheap = .;
. = . + KHEAP_SIZE;
. = ALIGN(8);
_endofheap = .;
}