STM32F446RCTX_RAM.ld 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. /*
  2. ******************************************************************************
  3. **
  4. ** @file : LinkerScript.ld (debug in RAM dedicated)
  5. **
  6. ** @author : Auto-generated by STM32CubeIDE
  7. **
  8. ** @brief : Linker script for STM32F446RCTx Device from STM32F4 series
  9. ** 256Kbytes FLASH
  10. ** 128Kbytes 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. ** <h2><center>&copy; Copyright (c) 2021 STMicroelectronics.
  26. ** All rights reserved.</center></h2>
  27. **
  28. ** This software component is licensed by ST under BSD 3-Clause license,
  29. ** the "License"; You may not use this file except in compliance with the
  30. ** License. You may obtain a copy of the License at:
  31. ** opensource.org/licenses/BSD-3-Clause
  32. **
  33. ******************************************************************************
  34. */
  35. /* Entry Point */
  36. ENTRY(Reset_Handler)
  37. /* Highest address of the user mode stack */
  38. _estack = ORIGIN(RAM) + LENGTH(RAM); /* end of "RAM" Ram type memory */
  39. _Min_Heap_Size = 0x200; /* required amount of heap */
  40. _Min_Stack_Size = 0x400; /* required amount of stack */
  41. /* Memories definition */
  42. MEMORY
  43. {
  44. RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
  45. FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 256K
  46. }
  47. /* Sections */
  48. SECTIONS
  49. {
  50. /* The startup code into "RAM" Ram type memory */
  51. .isr_vector :
  52. {
  53. . = ALIGN(4);
  54. KEEP(*(.isr_vector)) /* Startup code */
  55. . = ALIGN(4);
  56. } >RAM
  57. /* The program code and other data into "RAM" Ram type memory */
  58. .text :
  59. {
  60. . = ALIGN(4);
  61. *(.text) /* .text sections (code) */
  62. *(.text*) /* .text* sections (code) */
  63. *(.glue_7) /* glue arm to thumb code */
  64. *(.glue_7t) /* glue thumb to arm code */
  65. *(.eh_frame)
  66. *(.RamFunc) /* .RamFunc sections */
  67. *(.RamFunc*) /* .RamFunc* sections */
  68. KEEP (*(.init))
  69. KEEP (*(.fini))
  70. . = ALIGN(4);
  71. _etext = .; /* define a global symbols at end of code */
  72. } >RAM
  73. /* Constant data into "RAM" Ram type memory */
  74. .rodata :
  75. {
  76. . = ALIGN(4);
  77. *(.rodata) /* .rodata sections (constants, strings, etc.) */
  78. *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
  79. . = ALIGN(4);
  80. } >RAM
  81. .ARM.extab : {
  82. . = ALIGN(4);
  83. *(.ARM.extab* .gnu.linkonce.armextab.*)
  84. . = ALIGN(4);
  85. } >RAM
  86. .ARM : {
  87. . = ALIGN(4);
  88. __exidx_start = .;
  89. *(.ARM.exidx*)
  90. __exidx_end = .;
  91. . = ALIGN(4);
  92. } >RAM
  93. .preinit_array :
  94. {
  95. . = ALIGN(4);
  96. PROVIDE_HIDDEN (__preinit_array_start = .);
  97. KEEP (*(.preinit_array*))
  98. PROVIDE_HIDDEN (__preinit_array_end = .);
  99. . = ALIGN(4);
  100. } >RAM
  101. .init_array :
  102. {
  103. . = ALIGN(4);
  104. PROVIDE_HIDDEN (__init_array_start = .);
  105. KEEP (*(SORT(.init_array.*)))
  106. KEEP (*(.init_array*))
  107. PROVIDE_HIDDEN (__init_array_end = .);
  108. . = ALIGN(4);
  109. } >RAM
  110. .fini_array :
  111. {
  112. . = ALIGN(4);
  113. PROVIDE_HIDDEN (__fini_array_start = .);
  114. KEEP (*(SORT(.fini_array.*)))
  115. KEEP (*(.fini_array*))
  116. PROVIDE_HIDDEN (__fini_array_end = .);
  117. . = ALIGN(4);
  118. } >RAM
  119. /* Used by the startup to initialize data */
  120. _sidata = LOADADDR(.data);
  121. /* Initialized data sections into "RAM" Ram type memory */
  122. .data :
  123. {
  124. . = ALIGN(4);
  125. _sdata = .; /* create a global symbol at data start */
  126. *(.data) /* .data sections */
  127. *(.data*) /* .data* sections */
  128. . = ALIGN(4);
  129. _edata = .; /* define a global symbol at data end */
  130. } >RAM
  131. /* Uninitialized data section into "RAM" Ram type memory */
  132. . = ALIGN(4);
  133. .bss :
  134. {
  135. /* This is used by the startup in order to initialize the .bss section */
  136. _sbss = .; /* define a global symbol at bss start */
  137. __bss_start__ = _sbss;
  138. *(.bss)
  139. *(.bss*)
  140. *(COMMON)
  141. . = ALIGN(4);
  142. _ebss = .; /* define a global symbol at bss end */
  143. __bss_end__ = _ebss;
  144. } >RAM
  145. /* User_heap_stack section, used to check that there is enough "RAM" Ram type memory left */
  146. ._user_heap_stack :
  147. {
  148. . = ALIGN(8);
  149. PROVIDE ( end = . );
  150. PROVIDE ( _end = . );
  151. . = . + _Min_Heap_Size;
  152. . = . + _Min_Stack_Size;
  153. . = ALIGN(8);
  154. } >RAM
  155. /* Remove information from the compiler libraries */
  156. /DISCARD/ :
  157. {
  158. libc.a ( * )
  159. libm.a ( * )
  160. libgcc.a ( * )
  161. }
  162. .ARM.attributes 0 : { *(.ARM.attributes) }
  163. }