/* * nRF52840 — no SoftDevice * Flash: 1 MB @ 0x00000000 * RAM: 256 KB @ 0x20000000 * * Before first flash, erase the entire chip to remove any SoftDevice: * pyocd erase --target nrf52840 --chip */ MEMORY { FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 1024K RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 256K } /* stack grows downward from the top of RAM */ _estack = ORIGIN(RAM) + LENGTH(RAM); ENTRY(Reset_Handler) SECTIONS { /* vector table must be at the start of Flash */ .isr_vector : { KEEP(*(.isr_vector)) . = ALIGN(4); } > FLASH /* code and read-only data */ .text : { *(.text .text.*) *(.rodata .rodata.*) . = ALIGN(4); _etext = .; } > FLASH /* load address of .data in Flash — Reset_Handler copies from here */ _sidata = LOADADDR(.data); /* initialized variables: stored in Flash, run from RAM */ .data : { _sdata = .; *(.data .data.*) . = ALIGN(4); _edata = .; } > RAM AT > FLASH /* zero-initialized variables: Reset_Handler clears this region */ .bss (NOLOAD) : { _sbss = .; *(.bss .bss.*) *(COMMON) . = ALIGN(4); _ebss = .; } > RAM /DISCARD/ : { *(.ARM.exidx*) *(.gnu.linkonce.armexidx.*) } }