-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSTM32L476RGT6.ld
88 lines (78 loc) · 2 KB
/
STM32L476RGT6.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
/* Startup code taken from guide at https://vivonomicon.com/2018/04/20/bare-metal-stm32-programming-part-2-making-it-to-main/ */
/* Program entry point */
ENTRY(Reset_Handler)
/* Define the end of RAM and limit of stack memory */
/* 96Kbytes SRAM1 mapped starting from address 0x2000 0000 */
_estack = 0x20018000;
/* Sets a minimum size for the stack and dynamic memory */
_Min_Leftover_RAM = 0x400;
MEMORY
{
FLASH ( rx ) : ORIGIN = 0x08000000, LENGTH = 512k
RAM ( rxw ) : ORIGIN = 0x20000000, LENGTH = 96k
}
SECTIONS {
/* The vector table goes at the start of flash. */
.vector_table :
{
. = ALIGN(4);
KEEP (*(.vector_table))
. = ALIGN(4);
} >FLASH
/* The 'text' section contains the main program code. */
.text :
{
. = ALIGN(4);
*(.text)
*(.text*)
. = ALIGN(4);
} >FLASH
/* The 'rodata' section contains read-only data,
* constants, strings, information that won't change. */
.rodata :
{
. = ALIGN(4);
*(.rodata)
*(.rodata*)
. = ALIGN(4);
} >FLASH
/* The 'data' section is space set aside in RAM for
* things like variables, which can change. */
_sidata = .;
.data : AT(_sidata)
{
. = ALIGN(4);
/* Mark start/end locations for the 'data' section. */
_sdata = .;
*(.data)
*(.data*)
_edata = .;
. = ALIGN(4);
} >RAM
/* The 'bss' section is similar to the 'data' section,
* but its space is initialized to all 0s at the
* start of the program. */
.bss :
{
. = ALIGN(4);
/* Also mark the start/end of the BSS section. */
_sbss = .;
*(.bss)
*(.bss*)
*(COMMON)
. = ALIGN(4);
_ebss = .;
} >RAM
/* Space set aside for the application's heap/stack. */
/* Used to help avoid errors by adding a buffer region to throw ... */
/* ...linker errors for "out of memory" rather than undefined... */
/* ...behavior during runtime */
.dynamic_allocations :
{
. = ALIGN(4);
_ssystem_ram = .;
. = . + _Min_Leftover_RAM;
. = ALIGN(4);
_esystem_ram = .;
} >RAM
}