STM32H745XIHX_FLASH.ld 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. /*
  2. ******************************************************************************
  3. **
  4. ** File : LinkerScript.ld
  5. **
  6. ** Author : STM32CubeIDE
  7. **
  8. ** Abstract : Linker script for STM32H7 series
  9. ** 1024Kbytes FLASH
  10. ** 800Kbytes RAM
  11. **
  12. ** Set heap size, stack size and stack location according
  13. ** to application requirements.
  14. **
  15. ** Set memory bank area and size if external memory is used.
  16. **
  17. ** Target : STMicroelectronics STM32
  18. **
  19. ** Distribution: The file is distributed as is without any warranty
  20. ** of any kind.
  21. **
  22. *****************************************************************************
  23. ** @attention
  24. **
  25. ** Copyright (c) 2022 STMicroelectronics.
  26. ** All rights reserved.
  27. **
  28. ** This software is licensed under terms that can be found in the LICENSE file
  29. ** in the root directory of this software component.
  30. ** If no LICENSE file comes with this software, it is provided AS-IS.
  31. **
  32. *****************************************************************************
  33. */
  34. /* Entry Point */
  35. ENTRY(Reset_Handler)
  36. /* Highest address of the user mode stack */
  37. _estack = ORIGIN(RAM_D1) + LENGTH(RAM_D1); /* end of "RAM_D1" Ram type memory */
  38. _Min_Heap_Size = 0x200; /* required amount of heap */
  39. _Min_Stack_Size = 0x400; /* required amount of stack */
  40. /* Memories definition */
  41. MEMORY
  42. {
  43. RAM_D1 (xrw) : ORIGIN = 0x24000000, LENGTH = 512K
  44. FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K /* Memory is divided. Actual start is 0x08000000 and actual length is 2048K */
  45. DTCMRAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
  46. /* ETH_CODE: change offset & reduce size of RAM_D2 to not collide with M4 */
  47. RAM_D2 (xrw) : ORIGIN = 0x30020000, LENGTH = 160K
  48. RAM_D3 (xrw) : ORIGIN = 0x38000000, LENGTH = 64K
  49. ITCMRAM (xrw) : ORIGIN = 0x00000000, LENGTH = 64K
  50. }
  51. /* Sections */
  52. SECTIONS
  53. {
  54. /* The startup code into "FLASH" Rom type memory */
  55. .isr_vector :
  56. {
  57. . = ALIGN(4);
  58. KEEP(*(.isr_vector)) /* Startup code */
  59. . = ALIGN(4);
  60. } >FLASH
  61. /* The program code and other data into "FLASH" Rom type memory */
  62. .text :
  63. {
  64. . = ALIGN(4);
  65. *(.text) /* .text sections (code) */
  66. *(.text*) /* .text* sections (code) */
  67. *(.glue_7) /* glue arm to thumb code */
  68. *(.glue_7t) /* glue thumb to arm code */
  69. *(.eh_frame)
  70. KEEP (*(.init))
  71. KEEP (*(.fini))
  72. . = ALIGN(4);
  73. _etext = .; /* define a global symbols at end of code */
  74. } >FLASH
  75. /* Constant data into "FLASH" Rom type memory */
  76. .rodata :
  77. {
  78. . = ALIGN(4);
  79. *(.rodata) /* .rodata sections (constants, strings, etc.) */
  80. *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
  81. . = ALIGN(4);
  82. } >FLASH
  83. .ARM.extab(READONLY) : {
  84. . = ALIGN(4);
  85. *(.ARM.extab* .gnu.linkonce.armextab.*)
  86. . = ALIGN(4);
  87. } >FLASH
  88. .ARM : {
  89. . = ALIGN(4);
  90. __exidx_start = .;
  91. *(.ARM.exidx*)
  92. __exidx_end = .;
  93. . = ALIGN(4);
  94. } >FLASH
  95. .preinit_array(READONLY) :
  96. {
  97. . = ALIGN(4);
  98. PROVIDE_HIDDEN (__preinit_array_start = .);
  99. KEEP (*(.preinit_array*))
  100. PROVIDE_HIDDEN (__preinit_array_end = .);
  101. . = ALIGN(4);
  102. } >FLASH
  103. .init_array(READONLY) :
  104. {
  105. . = ALIGN(4);
  106. PROVIDE_HIDDEN (__init_array_start = .);
  107. KEEP (*(SORT(.init_array.*)))
  108. KEEP (*(.init_array*))
  109. PROVIDE_HIDDEN (__init_array_end = .);
  110. . = ALIGN(4);
  111. } >FLASH
  112. .fini_array(READONLY) :
  113. {
  114. . = ALIGN(4);
  115. PROVIDE_HIDDEN (__fini_array_start = .);
  116. KEEP (*(SORT(.fini_array.*)))
  117. KEEP (*(.fini_array*))
  118. PROVIDE_HIDDEN (__fini_array_end = .);
  119. . = ALIGN(4);
  120. } >FLASH
  121. /* Used by the startup to initialize data */
  122. _sidata = LOADADDR(.data);
  123. /* Initialized data sections into "RAM" Ram type memory */
  124. .data :
  125. {
  126. . = ALIGN(4);
  127. _sdata = .; /* create a global symbol at data start */
  128. *(.data) /* .data sections */
  129. *(.data*) /* .data* sections */
  130. *(.RamFunc) /* .RamFunc sections */
  131. *(.RamFunc*) /* .RamFunc* sections */
  132. . = ALIGN(4);
  133. _edata = .; /* define a global symbol at data end */
  134. } >RAM_D1 AT> FLASH
  135. /* Uninitialized data section into "RAM" Ram type memory */
  136. . = ALIGN(4);
  137. .bss :
  138. {
  139. /* This is used by the startup in order to initialize the .bss section */
  140. _sbss = .; /* define a global symbol at bss start */
  141. __bss_start__ = _sbss;
  142. *(.bss)
  143. *(.bss*)
  144. *(COMMON)
  145. . = ALIGN(4);
  146. _ebss = .; /* define a global symbol at bss end */
  147. __bss_end__ = _ebss;
  148. } >RAM_D1
  149. /* User_heap_stack section, used to check that there is enough "RAM" Ram type memory left */
  150. ._user_heap_stack :
  151. {
  152. . = ALIGN(8);
  153. PROVIDE ( end = . );
  154. PROVIDE ( _end = . );
  155. . = . + _Min_Heap_Size;
  156. . = . + _Min_Stack_Size;
  157. . = ALIGN(8);
  158. } >RAM_D1
  159. /* ETH_CODE: add placement of DMA descriptors and RX buffers */
  160. .lwip_sec (NOLOAD) :
  161. {
  162. . = ABSOLUTE(0x30040000);
  163. *(.RxDecripSection)
  164. . = ABSOLUTE(0x30040100);
  165. *(.TxDecripSection)
  166. . = ABSOLUTE(0x30040200);
  167. *(.Rx_PoolSection)
  168. } >RAM_D2
  169. /* Remove information from the compiler libraries */
  170. /DISCARD/ :
  171. {
  172. libc.a ( * )
  173. libm.a ( * )
  174. libgcc.a ( * )
  175. }
  176. .ARM.attributes 0 : { *(.ARM.attributes) }
  177. }