STM32L476RGTX_RAM.ld 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. /*
  2. ******************************************************************************
  3. **
  4. ** @file : LinkerScript.ld (debug in RAM dedicated)
  5. **
  6. ** @author : Auto-generated by STM32CubeIDE
  7. **
  8. ** @brief : Linker script for STM32L476RGTx Device from STM32L4 series
  9. ** 1024KBytes FLASH
  10. ** 96KBytes RAM
  11. ** 32KBytes RAM2
  12. **
  13. ** Set heap size, stack size and stack location according
  14. ** to application requirements.
  15. **
  16. ** Set memory bank area and size if external memory is used
  17. **
  18. ** Target : STMicroelectronics STM32
  19. **
  20. ** Distribution: The file is distributed as is, without any warranty
  21. ** of any kind.
  22. **
  23. ******************************************************************************
  24. ** @attention
  25. **
  26. ** Copyright (c) 2024 STMicroelectronics.
  27. ** All rights reserved.
  28. **
  29. ** This software is licensed under terms that can be found in the LICENSE file
  30. ** in the root directory of this software component.
  31. ** If no LICENSE file comes with this software, it is provided AS-IS.
  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 = 96K
  45. RAM2 (xrw) : ORIGIN = 0x10000000, LENGTH = 32K
  46. FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 1024K
  47. }
  48. /* Sections */
  49. SECTIONS
  50. {
  51. /* The startup code into "RAM" Ram type memory */
  52. .isr_vector :
  53. {
  54. . = ALIGN(4);
  55. KEEP(*(.isr_vector)) /* Startup code */
  56. . = ALIGN(4);
  57. } >RAM
  58. /* The program code and other data into "RAM" Ram type memory */
  59. .text :
  60. {
  61. . = ALIGN(4);
  62. *(.text) /* .text sections (code) */
  63. *(.text*) /* .text* sections (code) */
  64. *(.glue_7) /* glue arm to thumb code */
  65. *(.glue_7t) /* glue thumb to arm code */
  66. *(.eh_frame)
  67. *(.RamFunc) /* .RamFunc sections */
  68. *(.RamFunc*) /* .RamFunc* sections */
  69. KEEP (*(.init))
  70. KEEP (*(.fini))
  71. . = ALIGN(4);
  72. _etext = .; /* define a global symbols at end of code */
  73. } >RAM
  74. /* Constant data into "RAM" Ram type memory */
  75. .rodata :
  76. {
  77. . = ALIGN(4);
  78. *(.rodata) /* .rodata sections (constants, strings, etc.) */
  79. *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
  80. . = ALIGN(4);
  81. } >RAM
  82. .ARM.extab (READONLY) : /* The "READONLY" keyword is only supported in GCC11 and later, remove it if using GCC10 or earlier. */
  83. {
  84. . = ALIGN(4);
  85. *(.ARM.extab* .gnu.linkonce.armextab.*)
  86. . = ALIGN(4);
  87. } >RAM
  88. .ARM (READONLY) : /* The "READONLY" keyword is only supported in GCC11 and later, remove it if using GCC10 or earlier. */
  89. {
  90. . = ALIGN(4);
  91. __exidx_start = .;
  92. *(.ARM.exidx*)
  93. __exidx_end = .;
  94. . = ALIGN(4);
  95. } >RAM
  96. .preinit_array (READONLY) : /* The "READONLY" keyword is only supported in GCC11 and later, remove it if using GCC10 or earlier. */
  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
  104. .init_array (READONLY) : /* The "READONLY" keyword is only supported in GCC11 and later, remove it if using GCC10 or earlier. */
  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
  113. .fini_array (READONLY) : /* The "READONLY" keyword is only supported in GCC11 and later, remove it if using GCC10 or earlier. */
  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
  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
  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
  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
  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. }