diff options
| author | Caleb Jamison <[email protected]> | 2024-08-07 23:20:26 -0400 |
|---|---|---|
| committer | Caleb Jamison <[email protected]> | 2024-08-08 21:35:21 -0400 |
| commit | b185e02a42ad751ec6c31ffa6a1b87503f15489d (patch) | |
| tree | 0f0c66747267d24d95b5957b22db7e5c525cb00e /examples/rp23/memory.x | |
| parent | 891c5ee10584cd990dad529e3506fe1328e4e69d (diff) | |
Initial rp235x support
Examples have been run, but there is not yet a test suite.
Diffstat (limited to 'examples/rp23/memory.x')
| -rw-r--r-- | examples/rp23/memory.x | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/examples/rp23/memory.x b/examples/rp23/memory.x new file mode 100644 index 000000000..777492062 --- /dev/null +++ b/examples/rp23/memory.x | |||
| @@ -0,0 +1,74 @@ | |||
| 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 | } > FLASH | ||
| 35 | |||
| 36 | } INSERT AFTER .vector_table; | ||
| 37 | |||
| 38 | /* move .text to start /after/ the boot info */ | ||
| 39 | _stext = ADDR(.start_block) + SIZEOF(.start_block); | ||
| 40 | |||
| 41 | SECTIONS { | ||
| 42 | /* ### Picotool 'Binary Info' Entries | ||
| 43 | * | ||
| 44 | * Picotool looks through this block (as we have pointers to it in our | ||
| 45 | * header) to find interesting information. | ||
| 46 | */ | ||
| 47 | .bi_entries : ALIGN(4) | ||
| 48 | { | ||
| 49 | /* We put this in the header */ | ||
| 50 | __bi_entries_start = .; | ||
| 51 | /* Here are the entries */ | ||
| 52 | KEEP(*(.bi_entries)); | ||
| 53 | /* Keep this block a nice round size */ | ||
| 54 | . = ALIGN(4); | ||
| 55 | /* We put this in the header */ | ||
| 56 | __bi_entries_end = .; | ||
| 57 | } > FLASH | ||
| 58 | } INSERT AFTER .text; | ||
| 59 | |||
| 60 | SECTIONS { | ||
| 61 | /* ### Boot ROM extra info | ||
| 62 | * | ||
| 63 | * Goes after everything in our program, so it can contain a signature. | ||
| 64 | */ | ||
| 65 | .end_block : ALIGN(4) | ||
| 66 | { | ||
| 67 | __end_block_addr = .; | ||
| 68 | KEEP(*(.end_block)); | ||
| 69 | } > FLASH | ||
| 70 | |||
| 71 | } INSERT AFTER .uninit; | ||
| 72 | |||
| 73 | PROVIDE(start_to_end = __end_block_addr - __start_block_addr); | ||
| 74 | PROVIDE(end_to_start = __start_block_addr - __end_block_addr); | ||
