LinkerFile.ld 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. ENTRY(Reset_Handler)
  2. _Min_Heap_Size = 0;
  3. _Min_Stack_Size = 0xFF;
  4. _estack = 0x20004000;
  5. MEMORY
  6. {
  7. FLASH (rx) : ORIGIN = 0x00200000, LENGTH = 0x0007FFD4
  8. FLASH_CCA (rx) : ORIGIN = 0x0027FFD4, LENGTH = 12
  9. SRAM_RETENTION (rwx) : ORIGIN = 0x20000000, LENGTH = 0x4000
  10. SRAM_NON_RETENTION (rwx) : ORIGIN = 0x20000000 + 0x4000, LENGTH = 0x4000
  11. }
  12. SECTIONS
  13. {
  14. .isr_vector :
  15. {
  16. . = ALIGN(4);
  17. KEEP (*(.isr_vector))
  18. . = ALIGN(4);
  19. } > FLASH
  20. .text :
  21. {
  22. . = ALIGN(4);
  23. *(.text)
  24. *(.text*)
  25. *(.glue_7)
  26. *(.glue_7t)
  27. *(.eh_frame)
  28. KEEP (*(.init))
  29. KEEP (*(.fini))
  30. . = ALIGN(4);
  31. _etext = .;
  32. } > FLASH
  33. .const :
  34. {
  35. . = ALIGN(4);
  36. *(.const)
  37. *(.const*)
  38. . = ALIGN(4);
  39. } > FLASH
  40. .rodata :
  41. {
  42. . = ALIGN(4);
  43. *(.rodata)
  44. *(.rodata*)
  45. . = ALIGN(4);
  46. } > FLASH
  47. .ARM.extab : {
  48. . = ALIGN(4);
  49. *(.ARM.extab* .gnu.linkonce.armextab.*)
  50. . = ALIGN(4);
  51. } > FLASH
  52. .ARM : {
  53. . = ALIGN(4);
  54. __exidx_start = .;
  55. *(.ARM.exidx*)
  56. __exidx_end = .;
  57. . = ALIGN(4);
  58. } >FLASH
  59. .preinit_array :
  60. {
  61. . = ALIGN(4);
  62. PROVIDE_HIDDEN (__preinit_array_start = .);
  63. KEEP (*(.preinit_array*))
  64. PROVIDE_HIDDEN (__preinit_array_end = .);
  65. . = ALIGN(4);
  66. } > FLASH
  67. .init_array :
  68. {
  69. . = ALIGN(4);
  70. PROVIDE_HIDDEN (__init_array_start = .);
  71. KEEP (*(SORT(.init_array.*)))
  72. KEEP (*(.init_array*))
  73. PROVIDE_HIDDEN (__init_array_end = .);
  74. . = ALIGN(4);
  75. } > FLASH
  76. .flashcca :
  77. {
  78. . = ALIGN(4);
  79. *(.flashcca)
  80. *(.flashcca*)
  81. . = ALIGN(4);
  82. } > FLASH_CCA
  83. .vtable :
  84. {
  85. . = ALIGN(4);
  86. *(.vtable)
  87. *(.vtable*)
  88. . = ALIGN(4);
  89. } > SRAM_RETENTION
  90. _sidata = LOADADDR(.data);
  91. .data :
  92. {
  93. . = ALIGN(4);
  94. _sdata = .;
  95. *(.data)
  96. *(.data*)
  97. . = ALIGN(4);
  98. _edata = .;
  99. } > SRAM_RETENTION
  100. . = ALIGN(4);
  101. .bss :
  102. {
  103. _sbss = .;
  104. __bss_start__ = _sbss;
  105. *(.bss)
  106. *(.bss*)
  107. *(COMMON)
  108. . = ALIGN(4);
  109. _ebss = .;
  110. __bss_end__ = _ebss;
  111. } > SRAM_RETENTION
  112. .stack :
  113. {
  114. . = ALIGN(8);
  115. PROVIDE ( end = . );
  116. PROVIDE ( _end = .);
  117. . = . + _Min_Heap_Size;
  118. . = . + _Min_Stack_Size;
  119. . = ALIGN(8);
  120. } > SRAM_RETENTION
  121. }