-
Notifications
You must be signed in to change notification settings - Fork 60
/
low_stack_flash.ld
89 lines (69 loc) · 2.25 KB
/
low_stack_flash.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
/*
buck50: Test and measurement firmware for “Blue Pill” STM32F103 development board
Copyright (C) 2019,2020 Mark R. Rubin aka "thanks4opensource"
This file is part of buck50.
The buck50 program is free software: you can redistribute it
and/or modify it under the terms of the GNU General Public License
as published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later version.
The buck50 program is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
(LICENSE.txt) along with the buck50 program. If not, see
<https://www.gnu.org/licenses/gpl.html>
*/
/* Linker script for STM32F103 ("BluePill") */
ENTRY(init)
MEMORY
{
/*
/usr/local/doc/hardware/st/STM32F103x8,B_datasheet.pdf
p.10 2.1
Table 2. STM32F103xx medium-density device features and peripheral
counts
STM32F103Tx
Flash - Kybytes 64 or 128
SRAM - Kybytes 20
p.34 4 Memory mapping
Figure 11. Memory map
(SRAM and Flash base addresses, except Flash, SRAM, or System Memory
can alias to 0x00000000 depending on BOOT configuration)
*/
FLASH (rx) : org = 0x08000000, LENGTH = 64k
RAM (rwx) : org = 0x20000000, LENGTH = 20K
}
/* PROVIDE(STACK_SIZE = 64); */
SECTIONS
{
. = ORIGIN(FLASH);
.text : {
*(.vectors); /* The interrupt vectors */
*(.text);
*(.rodata);
} > FLASH
. = ALIGN(4);
INITIALIZED_DATA_ADDR_IN_FLASH = .;
.data : AT (INITIALIZED_DATA_ADDR_IN_FLASH) {
. = ALIGN(4);
INITIALIZED_DATA_ADDR_IN_RAM_START = .;
*(.data);
. = ALIGN(4);
INITIALIZED_DATA_ADDR_IN_RAM_END = .;
} > RAM
BSS_START = .;
.bss : {
. = ALIGN(4);
*(.bss);
} > RAM
BSS_END = .;
.stack : {
. = ALIGN(8);
*(.stack);
} > RAM
TOP_OF_STACK = .;
STORAGE = .;
end = ORIGIN(RAM) + LENGTH(RAM); /* for gnu-arm libc.a */
STORAGE_END = end;
}