MIMXRT1052xxxxx_sdram.ld 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. /*
  2. ** ###################################################################
  3. ** Processors: MIMXRT1052CVJ5B
  4. ** MIMXRT1052CVL5B
  5. ** MIMXRT1052DVJ6B
  6. ** MIMXRT1052DVL6B
  7. **
  8. ** Compiler: GNU C Compiler
  9. ** Reference manual: IMXRT1050RM Rev.1, 03/2018
  10. ** Version: rev. 1.0, 2018-09-21
  11. ** Build: b180921
  12. **
  13. ** Abstract:
  14. ** Linker file for the GNU C Compiler
  15. **
  16. ** Copyright 2016 Freescale Semiconductor, Inc.
  17. ** Copyright 2016-2018 NXP
  18. ** All rights reserved.
  19. **
  20. ** SPDX-License-Identifier: BSD-3-Clause
  21. **
  22. ** http: www.nxp.com
  23. ** mail: support@nxp.com
  24. **
  25. ** ###################################################################
  26. */
  27. /* Entry Point */
  28. ENTRY(Reset_Handler)
  29. HEAP_SIZE = DEFINED(__heap_size__) ? __heap_size__ : 0x0400;
  30. STACK_SIZE = DEFINED(__stack_size__) ? __stack_size__ : 0x0400;
  31. /* Specify the memory areas */
  32. MEMORY
  33. {
  34. m_interrupts (RX) : ORIGIN = 0x00000000, LENGTH = 0x00000400
  35. m_text (RX) : ORIGIN = 0x00000400, LENGTH = 0x0001FC00
  36. m_data (RW) : ORIGIN = 0x80000000, LENGTH = 0x01E00000
  37. m_ncache (RW) : ORIGIN = 0x81E00000, LENGTH = 0x00200000
  38. m_data2 (RW) : ORIGIN = 0x20000000, LENGTH = 0x00020000
  39. m_data3 (RW) : ORIGIN = 0x20200000, LENGTH = 0x00040000
  40. }
  41. /* Define output sections */
  42. SECTIONS
  43. {
  44. /* The startup code goes first into internal RAM */
  45. .interrupts :
  46. {
  47. __VECTOR_TABLE = .;
  48. . = ALIGN(4);
  49. KEEP(*(.isr_vector)) /* Startup code */
  50. . = ALIGN(4);
  51. } > m_interrupts
  52. __VECTOR_RAM = __VECTOR_TABLE;
  53. __RAM_VECTOR_TABLE_SIZE_BYTES = 0x0;
  54. /* The program code and other data goes into internal RAM */
  55. .text :
  56. {
  57. . = ALIGN(4);
  58. *(.text) /* .text sections (code) */
  59. *(.text*) /* .text* sections (code) */
  60. *(.rodata) /* .rodata sections (constants, strings, etc.) */
  61. *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
  62. *(.glue_7) /* glue arm to thumb code */
  63. *(.glue_7t) /* glue thumb to arm code */
  64. *(.eh_frame)
  65. KEEP (*(.init))
  66. KEEP (*(.fini))
  67. . = ALIGN(4);
  68. } > m_text
  69. .ARM.extab :
  70. {
  71. *(.ARM.extab* .gnu.linkonce.armextab.*)
  72. } > m_text
  73. .ARM :
  74. {
  75. __exidx_start = .;
  76. *(.ARM.exidx*)
  77. __exidx_end = .;
  78. } > m_text
  79. .ctors :
  80. {
  81. __CTOR_LIST__ = .;
  82. /* gcc uses crtbegin.o to find the start of
  83. the constructors, so we make sure it is
  84. first. Because this is a wildcard, it
  85. doesn't matter if the user does not
  86. actually link against crtbegin.o; the
  87. linker won't look for a file to match a
  88. wildcard. The wildcard also means that it
  89. doesn't matter which directory crtbegin.o
  90. is in. */
  91. KEEP (*crtbegin.o(.ctors))
  92. KEEP (*crtbegin?.o(.ctors))
  93. /* We don't want to include the .ctor section from
  94. from the crtend.o file until after the sorted ctors.
  95. The .ctor section from the crtend file contains the
  96. end of ctors marker and it must be last */
  97. KEEP (*(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors))
  98. KEEP (*(SORT(.ctors.*)))
  99. KEEP (*(.ctors))
  100. __CTOR_END__ = .;
  101. } > m_text
  102. .dtors :
  103. {
  104. __DTOR_LIST__ = .;
  105. KEEP (*crtbegin.o(.dtors))
  106. KEEP (*crtbegin?.o(.dtors))
  107. KEEP (*(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors))
  108. KEEP (*(SORT(.dtors.*)))
  109. KEEP (*(.dtors))
  110. __DTOR_END__ = .;
  111. } > m_text
  112. .preinit_array :
  113. {
  114. PROVIDE_HIDDEN (__preinit_array_start = .);
  115. KEEP (*(.preinit_array*))
  116. PROVIDE_HIDDEN (__preinit_array_end = .);
  117. } > m_text
  118. .init_array :
  119. {
  120. PROVIDE_HIDDEN (__init_array_start = .);
  121. KEEP (*(SORT(.init_array.*)))
  122. KEEP (*(.init_array*))
  123. PROVIDE_HIDDEN (__init_array_end = .);
  124. } > m_text
  125. .fini_array :
  126. {
  127. PROVIDE_HIDDEN (__fini_array_start = .);
  128. KEEP (*(SORT(.fini_array.*)))
  129. KEEP (*(.fini_array*))
  130. PROVIDE_HIDDEN (__fini_array_end = .);
  131. } > m_text
  132. __etext = .; /* define a global symbol at end of code */
  133. __DATA_ROM = .; /* Symbol is used by startup for data initialization */
  134. .data : AT(__DATA_ROM)
  135. {
  136. . = ALIGN(4);
  137. __DATA_RAM = .;
  138. __data_start__ = .; /* create a global symbol at data start */
  139. *(m_usb_dma_init_data)
  140. *(.data) /* .data sections */
  141. *(.data*) /* .data* sections */
  142. KEEP(*(.jcr*))
  143. . = ALIGN(4);
  144. __data_end__ = .; /* define a global symbol at data end */
  145. } > m_data
  146. __NDATA_ROM = __DATA_ROM + (__data_end__ - __data_start__);
  147. .ncache.init : AT(__NDATA_ROM)
  148. {
  149. __noncachedata_start__ = .; /* create a global symbol at ncache data start */
  150. *(NonCacheable.init)
  151. . = ALIGN(4);
  152. __noncachedata_init_end__ = .; /* create a global symbol at initialized ncache data end */
  153. } > m_ncache
  154. . = __noncachedata_init_end__;
  155. .ncache :
  156. {
  157. *(NonCacheable)
  158. . = ALIGN(4);
  159. __noncachedata_end__ = .; /* define a global symbol at ncache data end */
  160. } > m_ncache
  161. __DATA_END = __NDATA_ROM + (__noncachedata_init_end__ - __noncachedata_start__);
  162. text_end = ORIGIN(m_text) + LENGTH(m_text);
  163. ASSERT(__DATA_END <= text_end, "region m_text overflowed with text and data")
  164. /* Uninitialized data section */
  165. .bss :
  166. {
  167. /* This is used by the startup in order to initialize the .bss section */
  168. . = ALIGN(4);
  169. __START_BSS = .;
  170. __bss_start__ = .;
  171. *(m_usb_dma_noninit_data)
  172. *(.bss)
  173. *(.bss*)
  174. *(COMMON)
  175. . = ALIGN(4);
  176. __bss_end__ = .;
  177. __END_BSS = .;
  178. } > m_data
  179. .heap :
  180. {
  181. . = ALIGN(8);
  182. __end__ = .;
  183. PROVIDE(end = .);
  184. __HeapBase = .;
  185. . += HEAP_SIZE;
  186. __HeapLimit = .;
  187. __heap_limit = .; /* Add for _sbrk */
  188. } > m_data
  189. .stack :
  190. {
  191. . = ALIGN(8);
  192. . += STACK_SIZE;
  193. } > m_data
  194. /* Initializes stack on the end of block */
  195. __StackTop = ORIGIN(m_data) + LENGTH(m_data);
  196. __StackLimit = __StackTop - STACK_SIZE;
  197. PROVIDE(__stack = __StackTop);
  198. .ARM.attributes 0 : { *(.ARM.attributes) }
  199. ASSERT(__StackLimit >= __HeapLimit, "region m_data overflowed with stack and heap")
  200. }