-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
memory.x
41 lines (38 loc) · 1.2 KB
/
memory.x
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
MEMORY {
BOOT2 : ORIGIN = 0x10000000, LENGTH = 0x100
FLASH : ORIGIN = 0x10000100, LENGTH = 2048K - 0x100
RAM : ORIGIN = 0x20000000, LENGTH = 256K
}
SECTIONS {
/* ### Picotool 'Binary Info' Header Block
*
* Picotool only searches the second 256 bytes of Flash for this block, but
* that's where our vector table is. We squeeze in this block after the
* vector table, but before .text.
*/
.bi_header : ALIGN(4)
{
KEEP(*(.bi_header));
/* Keep this block a nice round size */
. = ALIGN(4);
} > FLASH
} INSERT BEFORE .text;
/* Move _stext, to make room for our new section */
_stext = ADDR(.bi_header) + SIZEOF(.bi_header);
SECTIONS {
/* ### Picotool 'Binary Info' Entries
*
* Picotool looks through this block (as we have pointers to it in our header) to find interesting information.
*/
.bi_entries : ALIGN(4)
{
/* We put this in the header */
__bi_entries_start = .;
/* Here are the entries */
KEEP(*(.bi_entries));
/* Keep this block a nice round size */
. = ALIGN(4);
/* We put this in the header */
__bi_entries_end = .;
} > FLASH
} INSERT AFTER .text;