STM32H745XIHX_RAM.ld 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. /*
  2. ******************************************************************************
  3. **
  4. ** File : LinkerScript.ld (debug in RAM dedicated)
  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 0x8000000 and actual length is 2048K */
  45. DTCMRAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
  46. RAM_D2 (xrw) : ORIGIN = 0x30000000, LENGTH = 288K
  47. RAM_D3 (xrw) : ORIGIN = 0x38000000, LENGTH = 64K
  48. ITCMRAM (xrw) : ORIGIN = 0x00000000, LENGTH = 64K
  49. }
  50. /* Sections */
  51. SECTIONS
  52. {
  53. /* The startup code into "RAM" Ram type memory */
  54. .isr_vector :
  55. {
  56. . = ALIGN(4);
  57. KEEP(*(.isr_vector)) /* Startup code */
  58. . = ALIGN(4);
  59. } >RAM_D1
  60. /* The program code and other data into "RAM" Ram type memory */
  61. .text :
  62. {
  63. . = ALIGN(4);
  64. *(.text) /* .text sections (code) */
  65. *(.text*) /* .text* sections (code) */
  66. *(.glue_7) /* glue arm to thumb code */
  67. *(.glue_7t) /* glue thumb to arm code */
  68. *(.eh_frame)
  69. *(.RamFunc) /* .RamFunc sections */
  70. *(.RamFunc*) /* .RamFunc* sections */
  71. KEEP (*(.init))
  72. KEEP (*(.fini))
  73. . = ALIGN(4);
  74. _etext = .; /* define a global symbols at end of code */
  75. } >RAM_D1
  76. /* Constant data into "RAM" Ram type memory */
  77. .rodata :
  78. {
  79. . = ALIGN(4);
  80. *(.rodata) /* .rodata sections (constants, strings, etc.) */
  81. *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
  82. . = ALIGN(4);
  83. } >RAM_D1
  84. .ARM.extab : {
  85. . = ALIGN(4);
  86. *(.ARM.extab* .gnu.linkonce.armextab.*)
  87. . = ALIGN(4);
  88. } >RAM_D1
  89. .ARM : {
  90. . = ALIGN(4);
  91. __exidx_start = .;
  92. *(.ARM.exidx*)
  93. __exidx_end = .;
  94. . = ALIGN(4);
  95. } >RAM_D1
  96. .preinit_array :
  97. {
  98. . = ALIGN(4);
  99. PROVIDE_HIDDEN (__preinit_array_start = .);
  100. KEEP (*(.preinit_array*))
  101. PROVIDE_HIDDEN (__preinit_array_end = .);
  102. . = ALIGN(4);
  103. } >RAM_D1
  104. .init_array :
  105. {
  106. . = ALIGN(4);
  107. PROVIDE_HIDDEN (__init_array_start = .);
  108. KEEP (*(SORT(.init_array.*)))
  109. KEEP (*(.init_array*))
  110. PROVIDE_HIDDEN (__init_array_end = .);
  111. . = ALIGN(4);
  112. } >RAM_D1
  113. .fini_array :
  114. {
  115. . = ALIGN(4);
  116. PROVIDE_HIDDEN (__fini_array_start = .);
  117. KEEP (*(SORT(.fini_array.*)))
  118. KEEP (*(.fini_array*))
  119. PROVIDE_HIDDEN (__fini_array_end = .);
  120. . = ALIGN(4);
  121. } >RAM_D1
  122. /* Used by the startup to initialize data */
  123. _sidata = LOADADDR(.data);
  124. /* Initialized data sections into "RAM" Ram type memory */
  125. .data :
  126. {
  127. . = ALIGN(4);
  128. _sdata = .; /* create a global symbol at data start */
  129. *(.data) /* .data sections */
  130. *(.data*) /* .data* sections */
  131. . = ALIGN(4);
  132. _edata = .; /* define a global symbol at data end */
  133. } >RAM_D1
  134. /* Uninitialized data section into "RAM" Ram type memory */
  135. . = ALIGN(4);
  136. .bss :
  137. {
  138. /* This is used by the startup in order to initialize the .bss section */
  139. _sbss = .; /* define a global symbol at bss start */
  140. __bss_start__ = _sbss;
  141. *(.bss)
  142. *(.bss*)
  143. *(COMMON)
  144. . = ALIGN(4);
  145. _ebss = .; /* define a global symbol at bss end */
  146. __bss_end__ = _ebss;
  147. } >RAM_D1
  148. /* User_heap_stack section, used to check that there is enough "RAM" Ram type memory left */
  149. ._user_heap_stack :
  150. {
  151. . = ALIGN(8);
  152. PROVIDE ( end = . );
  153. PROVIDE ( _end = . );
  154. . = . + _Min_Heap_Size;
  155. . = . + _Min_Stack_Size;
  156. . = ALIGN(8);
  157. } >RAM_D1
  158. /* Remove information from the compiler libraries */
  159. /DISCARD/ :
  160. {
  161. libc.a ( * )
  162. libm.a ( * )
  163. libgcc.a ( * )
  164. }
  165. .ARM.attributes 0 : { *(.ARM.attributes) }
  166. }