STM32F101RBTX_FLASH.ld 4.6 KB

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