STM32F103RCTX_FLASH.ld 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. /*
  2. ******************************************************************************
  3. **
  4. ** @file : LinkerScript.ld
  5. **
  6. ** @author : Auto-generated by STM32CubeIDE
  7. **
  8. ** @brief : Linker script for STM32F103RCTx Device from STM32F1 series
  9. ** 256KBytes FLASH
  10. ** 48KBytes 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. ** Copyright (c) 2025 STMicroelectronics.
  26. ** All rights reserved.
  27. **
  28. ** This software is licensed under terms that can be found in the LICENSE file
  29. ** in the root directory of this software component.
  30. ** If no LICENSE file comes with this software, it is provided AS-IS.
  31. **
  32. ******************************************************************************
  33. */
  34. /* Entry Point */
  35. ENTRY(Reset_Handler)
  36. /* Highest address of the user mode stack */
  37. _estack = ORIGIN(RAM) + LENGTH(RAM); /* end of "RAM" Ram type memory */
  38. _Min_Heap_Size = 0x200; /* required amount of heap */
  39. _Min_Stack_Size = 0x400; /* required amount of stack */
  40. /* Memories definition */
  41. MEMORY
  42. {
  43. RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 48K
  44. FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 256K
  45. }
  46. /* Sections */
  47. SECTIONS
  48. {
  49. /* The startup code into "FLASH" Rom type memory */
  50. .isr_vector :
  51. {
  52. . = ALIGN(4);
  53. KEEP(*(.isr_vector)) /* Startup code */
  54. . = ALIGN(4);
  55. } >FLASH
  56. /* The program code and other data into "FLASH" Rom type memory */
  57. .text :
  58. {
  59. . = ALIGN(4);
  60. *(.text) /* .text sections (code) */
  61. *(.text*) /* .text* sections (code) */
  62. *(.glue_7) /* glue arm to thumb code */
  63. *(.glue_7t) /* glue thumb to arm code */
  64. *(.eh_frame)
  65. KEEP (*(.init))
  66. KEEP (*(.fini))
  67. . = ALIGN(4);
  68. _etext = .; /* define a global symbols at end of code */
  69. } >FLASH
  70. /* Constant data into "FLASH" Rom type memory */
  71. .rodata :
  72. {
  73. . = ALIGN(4);
  74. *(.rodata) /* .rodata sections (constants, strings, etc.) */
  75. *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
  76. . = ALIGN(4);
  77. } >FLASH
  78. /* Used by the startup to initialize data */
  79. _sidata = LOADADDR(.data);
  80. /* Initialized data sections into "RAM" Ram type memory */
  81. .data :
  82. {
  83. . = ALIGN(4);
  84. _sdata = .; /* create a global symbol at data start */
  85. *(.data) /* .data sections */
  86. *(.data*) /* .data* sections */
  87. *(.RamFunc) /* .RamFunc sections */
  88. *(.RamFunc*) /* .RamFunc* sections */
  89. . = ALIGN(4);
  90. _edata = .; /* define a global symbol at data end */
  91. } >RAM AT> FLASH
  92. /* Uninitialized data section into "RAM" Ram type memory */
  93. . = ALIGN(4);
  94. .bss :
  95. {
  96. /* This is used by the startup in order to initialize the .bss section */
  97. _sbss = .; /* define a global symbol at bss start */
  98. __bss_start__ = _sbss;
  99. *(.bss)
  100. *(.bss*)
  101. *(COMMON)
  102. . = ALIGN(4);
  103. _ebss = .; /* define a global symbol at bss end */
  104. __bss_end__ = _ebss;
  105. } >RAM
  106. /* User_heap_stack section, used to check that there is enough "RAM" Ram type memory left */
  107. ._user_heap_stack :
  108. {
  109. . = ALIGN(8);
  110. PROVIDE ( end = . );
  111. PROVIDE ( _end = . );
  112. . = . + _Min_Heap_Size;
  113. . = . + _Min_Stack_Size;
  114. . = ALIGN(8);
  115. } >RAM
  116. /* Remove information from the compiler libraries */
  117. /DISCARD/ :
  118. {
  119. libc.a ( * )
  120. libm.a ( * )
  121. libgcc.a ( * )
  122. }
  123. .ARM.attributes 0 : { *(.ARM.attributes) }
  124. }