-
Notifications
You must be signed in to change notification settings - Fork 0
/
stm32l152.ld
93 lines (76 loc) · 1.96 KB
/
stm32l152.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/* Program Entry, set to mark it as "used" and avoid gcc warnings */
ENTRY(ResetHandler)
/* Memory Spaces Definitions */
MEMORY
{
RAM (RWX) : ORIGIN = 0x20000000, LENGTH = 16K
FLASH (RX) : ORIGIN = 0x08000000, LENGTH = 128K
EEPROM (RW) : ORIGIN = 0x08080000, LENGTH = 4K
}
/* code/data sections */
SECTIONS
{
/* code */
.text :
{
/* flash located vectors */
. = 0x0000;
KEEP(*(.vectors_flash))
/* internal storage start */
. = 0x0100;
__is_flash_start = .;
. += 0x0100;
__is_flash_end = .;
/* Program code */
*(.text)
*(.text.*)
*(.stub .gnu.linkonce.t.*)
*(.rodata .rodata.*)
. = ALIGN(4);
} > FLASH
/* needed for 64 bit division */
.ARM.exidx :
{
*(.ARM.exidx*)
. = ALIGN(4);
} > FLASH
/* all initialized data will go here */
__datai_start = .;
.data : AT ( __datai_start )
{
. = ALIGN(4);
/* ram vectors */
__data_start = .;
*(.vectors_ram)
/* data memory */
*(.data)
*(.data.*)
. = ALIGN(4);
__data_end = .;
} > RAM
.eeprom (NOLOAD) :
{
/* internal storage start */
__is_ee_start = .;
. += 0x0200;
__is_ee_end = .;
*(.eeprom)
} > EEPROM AT > FLASH
.bss :
{
/* Zero-filled run time allocate data memory */
. = ALIGN(4);
__bss_start = .;
*(.bss)
*(.bss.*)
*(COMMON)
. = ALIGN(4);
__bss_end = .;
} > RAM
.heap :
{
__heap_start = .;
} > RAM
__heap_end = ORIGIN(RAM) + LENGTH(RAM);
__stack = ORIGIN(RAM) + LENGTH(RAM) - 4;
}