forked from OneOfEleven/uv-k5-firmware-custom
-
Notifications
You must be signed in to change notification settings - Fork 26
/
firmware.ld
79 lines (64 loc) · 1.58 KB
/
firmware.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
ENTRY(HandlerReset)
_estack = 0x20004000; /* end of 16K RAM */
_Min_Heap_Size = 0; /* required amount of heap */
_Min_Stack_Size = 0x80; /* required amount of stack */
MEMORY
{
FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 60K
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 16K
}
SECTIONS
{
/* Program code */
.text :
{
. = ALIGN(4);
KEEP(*(.text.isr)) /* .text sections of code */
*(.text) /* .text sections of code */
*(.text*) /* .text* sections of code */
*(.rodata) /* .rodata sections */
*(.rodata*) /* .rodata* sections */
*(.glue_7) /* Glue arm to thumb code */
*(.glue_7t) /* Glue thumb to arm code */
*(.eh_frame)
KEEP(*(.fini))
. = ALIGN(4);
_etext = .; /* global symbols at end */
} >FLASH
/* Used by startup code */
. = ALIGN(4);
flash_data_start = .;
.data :
{
. = ALIGN(4);
sram_data_start = .;
*(.sramtext)
*(.srambss)
*(.data) /* .data sections */
*(.data*) /* .data* sections */
. = ALIGN(4);
_edata = .; /* Global symbol at data end */
} >RAM AT> FLASH
sram_data_end = .;
/* Uninitialized data */
. = ALIGN(4);
.bss :
{
_sbss = .; /* Global symbol at bss start */
__bss_start__ = _sbss;
*(.bss)
*(.bss*)
*(COMMON)
. = ALIGN(4);
_ebss = .; /* Global symbol at bss end */
__bss_end__ = _ebss;
} >RAM
/* Check that there is enough RAM */
._user_heap_stack :
{
. = ALIGN(4);
. = . + _Min_Heap_Size;
. = . + _Min_Stack_Size;
. = ALIGN(4);
} >RAM
}