You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

STM32F401RETX_RAM.ld 4.5KB

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