STM32H723ZGTX_RAM.ld 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. /*
  2. ******************************************************************************
  3. **
  4. ** File : LinkerScript.ld (debug in RAM dedicated)
  5. **
  6. ** Author : STM32CubeIDE
  7. **
  8. ** Abstract : Linker script for STM32H7 series
  9. ** 320Kbytes RAM_EXEC and 240Kbytes RAM
  10. **
  11. ** Set heap size, stack size and stack location according
  12. ** to application requirements.
  13. **
  14. ** Set memory bank area and size if external memory is used.
  15. **
  16. ** Target : STMicroelectronics STM32
  17. **
  18. ** Distribution: The file is distributed as is, without any warranty
  19. ** of any kind.
  20. **
  21. *****************************************************************************
  22. ** @attention
  23. **
  24. ** Copyright (c) 2021 STMicroelectronics.
  25. ** All rights reserved.
  26. **
  27. ** This software is licensed under terms that can be found in the LICENSE file
  28. ** in the root directory of this software component.
  29. ** If no LICENSE file comes with this software, it is provided AS-IS.
  30. **
  31. ****************************************************************************
  32. */
  33. /* Entry Point */
  34. ENTRY(Reset_Handler)
  35. /* Highest address of the user mode stack */
  36. _estack = ORIGIN(DTCMRAM) + LENGTH(DTCMRAM); /* end of RAM */
  37. /* Generate a link error if heap and stack don't fit into RAM */
  38. _Min_Heap_Size = 0x200 ; /* required amount of heap */
  39. _Min_Stack_Size = 0x400 ; /* required amount of stack */
  40. /* Specify the memory areas */
  41. MEMORY
  42. {
  43. RAM_EXEC (xrw) : ORIGIN = 0x24000000, LENGTH = 320K
  44. DTCMRAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
  45. ITCMRAM (xrw) : ORIGIN = 0x00000000, LENGTH = 64K
  46. RAM_D2 (xrw) : ORIGIN = 0x30000000, LENGTH = 32K
  47. RAM_D3 (xrw) : ORIGIN = 0x38000000, LENGTH = 16K
  48. }
  49. /* Define output sections */
  50. SECTIONS
  51. {
  52. /* The startup code goes first into RAM_EXEC */
  53. .isr_vector :
  54. {
  55. . = ALIGN(4);
  56. KEEP(*(.isr_vector)) /* Startup code */
  57. . = ALIGN(4);
  58. } >RAM_EXEC
  59. /* The program code and other data goes into RAM_EXEC */
  60. .text :
  61. {
  62. . = ALIGN(4);
  63. *(.text) /* .text sections (code) */
  64. *(.text*) /* .text* sections (code) */
  65. *(.glue_7) /* glue arm to thumb code */
  66. *(.glue_7t) /* glue thumb to arm code */
  67. *(.eh_frame)
  68. *(.RamFunc) /* .RamFunc sections */
  69. *(.RamFunc*) /* .RamFunc* sections */
  70. KEEP (*(.init))
  71. KEEP (*(.fini))
  72. . = ALIGN(4);
  73. _etext = .; /* define a global symbols at end of code */
  74. } >RAM_EXEC
  75. /* Constant data goes into RAM_EXEC */
  76. .rodata :
  77. {
  78. . = ALIGN(4);
  79. *(.rodata) /* .rodata sections (constants, strings, etc.) */
  80. *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
  81. . = ALIGN(4);
  82. } >RAM_EXEC
  83. .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >RAM_EXEC
  84. .ARM : {
  85. __exidx_start = .;
  86. *(.ARM.exidx*)
  87. __exidx_end = .;
  88. } >RAM_EXEC
  89. .preinit_array :
  90. {
  91. PROVIDE_HIDDEN (__preinit_array_start = .);
  92. KEEP (*(.preinit_array*))
  93. PROVIDE_HIDDEN (__preinit_array_end = .);
  94. } >RAM_EXEC
  95. .init_array :
  96. {
  97. PROVIDE_HIDDEN (__init_array_start = .);
  98. KEEP (*(SORT(.init_array.*)))
  99. KEEP (*(.init_array*))
  100. PROVIDE_HIDDEN (__init_array_end = .);
  101. } >RAM_EXEC
  102. .fini_array :
  103. {
  104. PROVIDE_HIDDEN (__fini_array_start = .);
  105. KEEP (*(SORT(.fini_array.*)))
  106. KEEP (*(.fini_array*))
  107. PROVIDE_HIDDEN (__fini_array_end = .);
  108. } >RAM_EXEC
  109. /* used by the startup to initialize data */
  110. _sidata = LOADADDR(.data);
  111. /* Initialized data sections goes into RAM, load LMA copy after code */
  112. .data :
  113. {
  114. . = ALIGN(4);
  115. _sdata = .; /* create a global symbol at data start */
  116. *(.data) /* .data sections */
  117. *(.data*) /* .data* sections */
  118. . = ALIGN(4);
  119. _edata = .; /* define a global symbol at data end */
  120. } >DTCMRAM AT> RAM_EXEC
  121. /* Uninitialized data section */
  122. . = ALIGN(4);
  123. .bss :
  124. {
  125. /* This is used by the startup in order to initialize the .bss section */
  126. _sbss = .; /* define a global symbol at bss start */
  127. __bss_start__ = _sbss;
  128. *(.bss)
  129. *(.bss*)
  130. *(COMMON)
  131. . = ALIGN(4);
  132. _ebss = .; /* define a global symbol at bss end */
  133. __bss_end__ = _ebss;
  134. } >DTCMRAM
  135. /* User_heap_stack section, used to check that there is enough RAM left */
  136. ._user_heap_stack :
  137. {
  138. . = ALIGN(8);
  139. PROVIDE ( end = . );
  140. PROVIDE ( _end = . );
  141. . = . + _Min_Heap_Size;
  142. . = . + _Min_Stack_Size;
  143. . = ALIGN(8);
  144. } >DTCMRAM
  145. /* Remove information from the standard libraries */
  146. /DISCARD/ :
  147. {
  148. libc.a ( * )
  149. libm.a ( * )
  150. libgcc.a ( * )
  151. }
  152. .ARM.attributes 0 : { *(.ARM.attributes) }
  153. }