STM32L432KCUX_FLASH.ld 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. /*
  2. ******************************************************************************
  3. **
  4. ** @file : LinkerScript.ld
  5. **
  6. ** @author : Auto-generated by STM32CubeIDE
  7. **
  8. ** Abstract : Linker script for NUCLEO-L432KC Board embedding STM32L432KCUx Device from stm32l4 series
  9. ** 256KBytes FLASH
  10. ** 48KBytes RAM
  11. ** 16KBytes 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) 2025 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 = 48K
  45. RAM2 (xrw) : ORIGIN = 0x10000000, LENGTH = 16K
  46. FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 256K
  47. }
  48. /* Sections */
  49. SECTIONS
  50. {
  51. /* The startup code into "FLASH" Rom type memory */
  52. .isr_vector :
  53. {
  54. . = ALIGN(4);
  55. KEEP(*(.isr_vector)) /* Startup code */
  56. . = ALIGN(4);
  57. } >FLASH
  58. /* The program code and other data into "FLASH" Rom 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. KEEP (*(.init))
  68. KEEP (*(.fini))
  69. . = ALIGN(4);
  70. _etext = .; /* define a global symbols at end of code */
  71. } >FLASH
  72. /* Constant data into "FLASH" Rom type memory */
  73. .rodata :
  74. {
  75. . = ALIGN(4);
  76. *(.rodata) /* .rodata sections (constants, strings, etc.) */
  77. *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
  78. . = ALIGN(4);
  79. } >FLASH
  80. .ARM.extab (READONLY) : /* The "READONLY" keyword is only supported in GCC11 and later, remove it if using GCC10 or earlier. */
  81. {
  82. . = ALIGN(4);
  83. *(.ARM.extab* .gnu.linkonce.armextab.*)
  84. . = ALIGN(4);
  85. } >FLASH
  86. .ARM (READONLY) : /* The "READONLY" keyword is only supported in GCC11 and later, remove it if using GCC10 or earlier. */
  87. {
  88. . = ALIGN(4);
  89. __exidx_start = .;
  90. *(.ARM.exidx*)
  91. __exidx_end = .;
  92. . = ALIGN(4);
  93. } >FLASH
  94. .preinit_array (READONLY) : /* The "READONLY" keyword is only supported in GCC11 and later, remove it if using GCC10 or earlier. */
  95. {
  96. . = ALIGN(4);
  97. PROVIDE_HIDDEN (__preinit_array_start = .);
  98. KEEP (*(.preinit_array*))
  99. PROVIDE_HIDDEN (__preinit_array_end = .);
  100. . = ALIGN(4);
  101. } >FLASH
  102. .init_array (READONLY) : /* The "READONLY" keyword is only supported in GCC11 and later, remove it if using GCC10 or earlier. */
  103. {
  104. . = ALIGN(4);
  105. PROVIDE_HIDDEN (__init_array_start = .);
  106. KEEP (*(SORT(.init_array.*)))
  107. KEEP (*(.init_array*))
  108. PROVIDE_HIDDEN (__init_array_end = .);
  109. . = ALIGN(4);
  110. } >FLASH
  111. .fini_array (READONLY) : /* The "READONLY" keyword is only supported in GCC11 and later, remove it if using GCC10 or earlier. */
  112. {
  113. . = ALIGN(4);
  114. PROVIDE_HIDDEN (__fini_array_start = .);
  115. KEEP (*(SORT(.fini_array.*)))
  116. KEEP (*(.fini_array*))
  117. PROVIDE_HIDDEN (__fini_array_end = .);
  118. . = ALIGN(4);
  119. } >FLASH
  120. /* Used by the startup to initialize data */
  121. _sidata = LOADADDR(.data);
  122. /* Initialized data sections into "RAM" Ram type memory */
  123. .data :
  124. {
  125. . = ALIGN(4);
  126. _sdata = .; /* create a global symbol at data start */
  127. *(.data) /* .data sections */
  128. *(.data*) /* .data* sections */
  129. *(.RamFunc) /* .RamFunc sections */
  130. *(.RamFunc*) /* .RamFunc* sections */
  131. . = ALIGN(4);
  132. _edata = .; /* define a global symbol at data end */
  133. } >RAM AT> FLASH
  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. }