-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmemory.x
64 lines (58 loc) · 1.69 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/**
* Linker script for the Raspberry Pi Pico.
*
* Part of the Neotron Pico BIOS.
*
* This file licenced as CC0.
*/
MEMORY {
/*
* This is bootloader for the RP2040. It must live at the start of the
external flash chip.
*/
BOOT2 : ORIGIN = 0x10000000, LENGTH = 0x100
/*
* The Pico has 2048 KiB of external Flash Memory. We allow ourselves 128
* KiB for the BIOS, leaving the rest
* for the OS and any user applications.
*/
FLASH : ORIGIN = 0x10000100, LENGTH = 128K - 0x100
/*
* This is the remainder of the 2048 KiB flash chip.
*/
FLASH_OS : ORIGIN = 0x10020000, LENGTH = 2048K - 128K
/*
* This is the bottom of the four striped banks of SRAM in the RP2040.
*/
RAM_OS : ORIGIN = 0x20000000, LENGTH = 0x42000 - 0x9690
/*
* This is the top of the four striped banks of SRAM in the RP2040, plus
* SRAM_BANK4 and SRAM_BANK5.
*
* This is carefully calculated to give us 8 KiB of stack space and ensure
* the defmt buffer doesn't span across SRAM_BANK3 and SRAM_BANK4.
*
* 0x9690 should be the (size of .data + size of .bss + size of .uninit +
* 0x2000 for the stack).
*/
RAM : ORIGIN = 0x20042000 - 0x9690, LENGTH = 0x9690
}
/*
* Export some symbols to tell the BIOS where it might find the OS.
*/
_flash_os_start = ORIGIN(FLASH_OS);
_flash_os_len = LENGTH(FLASH_OS);
_ram_os_start = ORIGIN(RAM_OS);
_ram_os_len = LENGTH(RAM_OS);
SECTIONS {
/* ### RP2040 Boot loader */
.boot2 ORIGIN(BOOT2) :
{
KEEP(*(.boot2));
} > BOOT2
/* ### Neotron OS */
.flash_os ORIGIN(FLASH_OS) :
{
KEEP(*(.flash_os));
} > FLASH_OS
} INSERT BEFORE .text;