STM32H743ZITx_FLASH.ld 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. /*
  2. ******************************************************************************
  3. **
  4. ** File : LinkerScript.ld
  5. **
  6. ** Author : STM32CubeMX
  7. **
  8. ** Abstract : Linker script for STM32H743ZITx series
  9. ** 2048Kbytes FLASH and 1056Kbytes 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. ** <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
  25. **
  26. ** Redistribution and use in source and binary forms, with or without modification,
  27. ** are permitted provided that the following conditions are met:
  28. ** 1. Redistributions of source code must retain the above copyright notice,
  29. ** this list of conditions and the following disclaimer.
  30. ** 2. Redistributions in binary form must reproduce the above copyright notice,
  31. ** this list of conditions and the following disclaimer in the documentation
  32. ** and/or other materials provided with the distribution.
  33. ** 3. Neither the name of STMicroelectronics nor the names of its contributors
  34. ** may be used to endorse or promote products derived from this software
  35. ** without specific prior written permission.
  36. **
  37. ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  38. ** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  39. ** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  40. ** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
  41. ** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  42. ** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  43. ** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  44. ** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  45. ** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  46. ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  47. **
  48. *****************************************************************************
  49. */
  50. /* Entry Point */
  51. ENTRY(Reset_Handler)
  52. /* Highest address of the user mode stack */
  53. _estack = ORIGIN(DTCMRAM) + LENGTH(DTCMRAM); /* end of RAM */
  54. /* Generate a link error if heap and stack don't fit into RAM */
  55. _Min_Heap_Size = 0x200; /* required amount of heap */
  56. _Min_Stack_Size = 0x400; /* required amount of stack */
  57. /* Specify the memory areas */
  58. MEMORY
  59. {
  60. DTCMRAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
  61. RAM_D1 (xrw) : ORIGIN = 0x24000000, LENGTH = 512K
  62. RAM_D2 (xrw) : ORIGIN = 0x30000000, LENGTH = 288K
  63. RAM_D3 (xrw) : ORIGIN = 0x38000000, LENGTH = 64K
  64. ITCMRAM (xrw) : ORIGIN = 0x00000000, LENGTH = 64K
  65. FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 2048K
  66. }
  67. /* Define output sections */
  68. SECTIONS
  69. {
  70. /* The startup code goes first into FLASH */
  71. .isr_vector :
  72. {
  73. . = ALIGN(4);
  74. KEEP(*(.isr_vector)) /* Startup code */
  75. . = ALIGN(4);
  76. } >FLASH
  77. /* The program code and other data goes into FLASH */
  78. .text :
  79. {
  80. . = ALIGN(4);
  81. *(.text) /* .text sections (code) */
  82. *(.text*) /* .text* sections (code) */
  83. *(.glue_7) /* glue arm to thumb code */
  84. *(.glue_7t) /* glue thumb to arm code */
  85. *(.eh_frame)
  86. KEEP (*(.init))
  87. KEEP (*(.fini))
  88. . = ALIGN(4);
  89. _etext = .; /* define a global symbols at end of code */
  90. } >FLASH
  91. /* Constant data goes into FLASH */
  92. .rodata :
  93. {
  94. . = ALIGN(4);
  95. *(.rodata) /* .rodata sections (constants, strings, etc.) */
  96. *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
  97. . = ALIGN(4);
  98. } >FLASH
  99. .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH
  100. .ARM : {
  101. __exidx_start = .;
  102. *(.ARM.exidx*)
  103. __exidx_end = .;
  104. } >FLASH
  105. .preinit_array :
  106. {
  107. PROVIDE_HIDDEN (__preinit_array_start = .);
  108. KEEP (*(.preinit_array*))
  109. PROVIDE_HIDDEN (__preinit_array_end = .);
  110. } >FLASH
  111. .init_array :
  112. {
  113. PROVIDE_HIDDEN (__init_array_start = .);
  114. KEEP (*(SORT(.init_array.*)))
  115. KEEP (*(.init_array*))
  116. PROVIDE_HIDDEN (__init_array_end = .);
  117. } >FLASH
  118. .fini_array :
  119. {
  120. PROVIDE_HIDDEN (__fini_array_start = .);
  121. KEEP (*(SORT(.fini_array.*)))
  122. KEEP (*(.fini_array*))
  123. PROVIDE_HIDDEN (__fini_array_end = .);
  124. } >FLASH
  125. /* used by the startup to initialize data */
  126. _sidata = LOADADDR(.data);
  127. /* Initialized data sections goes into RAM, load LMA copy after code */
  128. .data :
  129. {
  130. . = ALIGN(4);
  131. _sdata = .; /* create a global symbol at data start */
  132. *(.data) /* .data sections */
  133. *(.data*) /* .data* sections */
  134. . = ALIGN(4);
  135. _edata = .; /* define a global symbol at data end */
  136. } >DTCMRAM AT> FLASH
  137. /* Uninitialized data section */
  138. . = ALIGN(4);
  139. .bss :
  140. {
  141. /* This is used by the startup in order to initialize the .bss secion */
  142. _sbss = .; /* define a global symbol at bss start */
  143. __bss_start__ = _sbss;
  144. *(.bss)
  145. *(.bss*)
  146. *(COMMON)
  147. . = ALIGN(4);
  148. _ebss = .; /* define a global symbol at bss end */
  149. __bss_end__ = _ebss;
  150. } >DTCMRAM
  151. /* User_heap_stack section, used to check that there is enough RAM left */
  152. ._user_heap_stack :
  153. {
  154. . = ALIGN(8);
  155. PROVIDE ( end = . );
  156. PROVIDE ( _end = . );
  157. . = . + _Min_Heap_Size;
  158. . = . + _Min_Stack_Size;
  159. . = ALIGN(8);
  160. } >DTCMRAM
  161. /* Remove information from the standard libraries */
  162. /DISCARD/ :
  163. {
  164. libc.a ( * )
  165. libm.a ( * )
  166. libgcc.a ( * )
  167. }
  168. .ARM.attributes 0 : { *(.ARM.attributes) }
  169. }