diff options
Diffstat (limited to 'examples/rp235x/memory.x')
| -rw-r--r-- | examples/rp235x/memory.x | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/examples/rp235x/memory.x b/examples/rp235x/memory.x new file mode 100644 index 000000000..c803896f6 --- /dev/null +++ b/examples/rp235x/memory.x | |||
| @@ -0,0 +1,75 @@ | |||
| 1 | MEMORY { | ||
| 2 | /* | ||
| 3 | * The RP2350 has either external or internal flash. | ||
| 4 | * | ||
| 5 | * 2 MiB is a safe default here, although a Pico 2 has 4 MiB. | ||
| 6 | */ | ||
| 7 | FLASH : ORIGIN = 0x10000000, LENGTH = 2048K | ||
| 8 | /* | ||
| 9 | * RAM consists of 8 banks, SRAM0-SRAM7, with a striped mapping. | ||
| 10 | * This is usually good for performance, as it distributes load on | ||
| 11 | * those banks evenly. | ||
| 12 | */ | ||
| 13 | RAM : ORIGIN = 0x20000000, LENGTH = 512K | ||
| 14 | /* | ||
| 15 | * RAM banks 8 and 9 use a direct mapping. They can be used to have | ||
| 16 | * memory areas dedicated for some specific job, improving predictability | ||
| 17 | * of access times. | ||
| 18 | * Example: Separate stacks for core0 and core1. | ||
| 19 | */ | ||
| 20 | SRAM4 : ORIGIN = 0x20080000, LENGTH = 4K | ||
| 21 | SRAM5 : ORIGIN = 0x20081000, LENGTH = 4K | ||
| 22 | } | ||
| 23 | |||
| 24 | SECTIONS { | ||
| 25 | /* ### Boot ROM info | ||
| 26 | * | ||
| 27 | * Goes after .vector_table, to keep it in the first 4K of flash | ||
| 28 | * where the Boot ROM (and picotool) can find it | ||
| 29 | */ | ||
| 30 | .start_block : ALIGN(4) | ||
| 31 | { | ||
| 32 | __start_block_addr = .; | ||
| 33 | KEEP(*(.start_block)); | ||
| 34 | KEEP(*(.boot_info)); | ||
| 35 | } > FLASH | ||
| 36 | |||
| 37 | } INSERT AFTER .vector_table; | ||
| 38 | |||
| 39 | /* move .text to start /after/ the boot info */ | ||
| 40 | _stext = ADDR(.start_block) + SIZEOF(.start_block); | ||
| 41 | |||
| 42 | SECTIONS { | ||
| 43 | /* ### Picotool 'Binary Info' Entries | ||
| 44 | * | ||
| 45 | * Picotool looks through this block (as we have pointers to it in our | ||
| 46 | * header) to find interesting information. | ||
| 47 | */ | ||
| 48 | .bi_entries : ALIGN(4) | ||
| 49 | { | ||
| 50 | /* We put this in the header */ | ||
| 51 | __bi_entries_start = .; | ||
| 52 | /* Here are the entries */ | ||
| 53 | KEEP(*(.bi_entries)); | ||
| 54 | /* Keep this block a nice round size */ | ||
| 55 | . = ALIGN(4); | ||
| 56 | /* We put this in the header */ | ||
| 57 | __bi_entries_end = .; | ||
| 58 | } > FLASH | ||
| 59 | } INSERT AFTER .text; | ||
| 60 | |||
| 61 | SECTIONS { | ||
| 62 | /* ### Boot ROM extra info | ||
| 63 | * | ||
| 64 | * Goes after everything in our program, so it can contain a signature. | ||
| 65 | */ | ||
| 66 | .end_block : ALIGN(4) | ||
| 67 | { | ||
| 68 | __end_block_addr = .; | ||
| 69 | KEEP(*(.end_block)); | ||
| 70 | } > FLASH | ||
| 71 | |||
| 72 | } INSERT AFTER .uninit; | ||
| 73 | |||
| 74 | PROVIDE(start_to_end = __end_block_addr - __start_block_addr); | ||
| 75 | PROVIDE(end_to_start = __start_block_addr - __end_block_addr); | ||
