rp2040.ld 971 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. SPDX-License-Identifier: BSD-3-Clause
  3. Copyright (c) 2021, Alex Taradov <alex@taradov.com>. All rights reserved.
  4. */
  5. MEMORY
  6. {
  7. boot (rx) : ORIGIN = 0x10000000, LENGTH = 256
  8. flash (rx) : ORIGIN = 0x10000100, LENGTH = 2048K - 256
  9. ram (rwx) : ORIGIN = 0x20000000, LENGTH = 264K
  10. }
  11. ENTRY(boot_entry)
  12. SECTIONS
  13. {
  14. .boot : ALIGN(4)
  15. {
  16. KEEP(*(.boot.entry))
  17. *(.boot*)
  18. . = 256-4;
  19. LONG(0xcccccccc) /* CRC */
  20. } > boot
  21. .text : ALIGN(4)
  22. {
  23. _text = .;
  24. KEEP(*(.vectors))
  25. *(.text*)
  26. *(.rodata)
  27. *(.rodata.*)
  28. . = ALIGN(4);
  29. _etext = .;
  30. } > ram AT > flash
  31. .data : ALIGN(4)
  32. {
  33. _data = .;
  34. *(.ramfunc .ramfunc.*);
  35. *(vtable)
  36. *(.data*)
  37. . = ALIGN(4);
  38. _edata = .;
  39. } > ram AT > flash
  40. .bss : ALIGN(4)
  41. {
  42. _bss = .;
  43. *(.bss*)
  44. *(COMMON)
  45. . = ALIGN(4);
  46. _ebss = .;
  47. } > ram
  48. PROVIDE(_end = .);
  49. PROVIDE(_text_start = ORIGIN(flash));
  50. PROVIDE(_stack_top = ORIGIN(ram) + LENGTH(ram));
  51. }