-
Notifications
You must be signed in to change notification settings - Fork 112
/
stm32g4xx_flash_application_small.ld
102 lines (87 loc) · 1.78 KB
/
stm32g4xx_flash_application_small.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
94
95
96
97
98
99
100
101
102
/*
Default linker script for STM32G473xB (128k flash, 128k RAM)
*/
ENTRY(Reset_Handler)
_estack = 0x20008000;
_Min_Heap_Size = 0;
_Min_Stack_Size = 0x400;
MEMORY
{
SRAM1 (xrw) : ORIGIN = 0x20000000, LENGTH = 80K
SRAM2 (xrw) : ORIGIN = 0x20014000, LENGTH = 16K
CCMSRAM (xrw) : ORIGIN = 0x10000000, LENGTH = 32K
FLASH (rx) : ORIGIN = 0x08008000, LENGTH = 96K
}
SECTIONS
{
.isr_vector :
{
. = ALIGN(16);
KEEP(*(.isr_vector)) /* Startup code */
. = ALIGN(16);
} >FLASH
.flashtext :
{
. = ALIGN(16);
*(.flashtext) /* Startup code */
. = ALIGN(16);
} >FLASH
.text :
{
. = ALIGN(16);
*(.text) /* remaining code */
*(.text.*) /* remaining code */
*(.rodata) /* read-only data (constants) */
*(.rodata*)
*(.glue_7)
*(.glue_7t)
KEEP (*(.init))
KEEP (*(.fini))
. = ALIGN(4);
__init_array_start = .;
KEEP(*(.init_array)) /* C++ constructors */
KEEP(*(.ctors)) /* and vtable init */
__init_array_end = .;
. = ALIGN(16);
_etext = .;
_sidata = _etext;
} >FLASH
.data : AT ( _sidata )
{
. = ALIGN(16);
_sdata = . ;
*(.ramtext*)
. = ALIGN(16);
*(.data*)
*(.data.*)
. = ALIGN(16);
_edata = . ;
} >SRAM1
.bss :
{
. = ALIGN(16);
_sbss = .;
*(.bss)
*(.bss*)
*(COMMON)
. = ALIGN(16);
_ebss = . ;
} >SRAM1
PROVIDE ( end = _ebss );
PROVIDE ( _end = _ebss );
._user_heap_stack :
{
. = ALIGN(16);
PROVIDE ( end = . );
PROVIDE ( _end = . );
. = . + _Min_Heap_Size;
. = . + _Min_Stack_Size;
. = ALIGN(16);
} >CCMSRAM
DISCARD :
{
libc.a ( * )
libm.a ( * )
libgcc.a ( * )
}
}