github.com/tinygo-org/tinygo@v0.31.3-0.20240404173401-90b0bf646c27/targets/rp2040.ld (about) 1 MEMORY 2 { 3 /* Reserve exactly 256 bytes at start of flash for second stage bootloader */ 4 BOOT2_TEXT (rx) : ORIGIN = 0x10000000, LENGTH = 256 5 FLASH_TEXT (rx) : ORIGIN = 0x10000000 + 256, LENGTH = __flash_size - 256 6 RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 256k 7 } 8 9 _stack_size = 2K; 10 11 SECTIONS 12 { 13 /* Second stage bootloader is prepended to the image. It must be 256 bytes 14 and checksummed. The gap to the checksum is zero-padded. 15 */ 16 .boot2 : { 17 __boot2_start__ = .; 18 KEEP (*(.boot2)); 19 20 /* Explicitly allocate space for CRC32 checksum at end of second stage 21 bootloader 22 */ 23 . = __boot2_start__ + 256 - 4; 24 LONG(0) 25 } > BOOT2_TEXT = 0x0 26 27 /* The second stage will always enter the image at the start of .text. 28 The debugger will use the ELF entry point, which is the _entry_point 29 symbol if present, otherwise defaults to start of .text. 30 This can be used to transfer control back to the bootrom on debugger 31 launches only, to perform proper flash setup. 32 */ 33 } 34 35 36 INCLUDE "targets/arm.ld"