Advertisement
Guest User

Untitled

a guest
Jun 30th, 2021
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.99 KB | None | 0 0
  1. /* Linker script for Silicon Labs EFM32GG devices */
  2. /* */
  3. /* This file is subject to the license terms as defined in ARM's */
  4. /* CMSIS END USER LICENSE AGREEMENT.pdf, governing the use of */
  5. /* Example Code. */
  6. /* */
  7. /* Silicon Laboratories, Inc. 2015 */
  8. /* */
  9. /* Version 4.2.0 */
  10. /* */
  11.  
  12. #if !defined(MBED_APP_START)
  13. #define MBED_APP_START 0x00000000
  14. #endif
  15.  
  16. #if !defined(MBED_APP_SIZE)
  17. #define MBED_APP_SIZE 1048576
  18. #endif
  19.  
  20. #if !defined(MBED_BOOT_STACK_SIZE)
  21. #define MBED_BOOT_STACK_SIZE 0x400
  22. #endif
  23.  
  24. /* With the RTOS in use, this does not affect the main stack size. The size of
  25. * the stack where main runs is determined via the RTOS. */
  26. STACK_SIZE = MBED_BOOT_STACK_SIZE;
  27.  
  28. HEAP_SIZE = 0x6000;
  29.  
  30. MEMORY
  31. {
  32. FLASH (rx) : ORIGIN = MBED_APP_START, LENGTH = MBED_APP_SIZE
  33. RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 131072
  34. }
  35. /* MBED: mbed needs to be able to dynamically set the interrupt vector table.
  36. * We make room for the table at the very beginning of RAM, i.e. at
  37. * 0x20000000. We need (16+39) * sizeof(uint32_t) = 220 4(8-byte aligned) bytes for EFM32GG */
  38. __vector_size = 0xE0;
  39.  
  40. /* Linker script to place sections and symbol values. Should be used together
  41. * with other linker script that defines memory regions FLASH and RAM.
  42. * It references following symbols, which must be defined in code:
  43. * Reset_Handler : Entry of reset handler
  44. *
  45. * It defines following symbols, which code can use without definition:
  46. * __exidx_start
  47. * __exidx_end
  48. * __copy_table_start__
  49. * __copy_table_end__
  50. * __zero_table_start__
  51. * __zero_table_end__
  52. * __etext
  53. * __data_start__
  54. * __preinit_array_start
  55. * __preinit_array_end
  56. * __init_array_start
  57. * __init_array_end
  58. * __fini_array_start
  59. * __fini_array_end
  60. * __data_end__
  61. * __bss_start__
  62. * __bss_end__
  63. * __end__
  64. * end
  65. * __HeapLimit
  66. * __StackLimit
  67. * __StackTop
  68. * __stack
  69. * __Vectors_End
  70. * __Vectors_Size
  71. */
  72. ENTRY(Reset_Handler)
  73.  
  74. SECTIONS
  75. {
  76. .text :
  77. {
  78. KEEP(*(.vectors))
  79. __Vectors_End = .;
  80. __Vectors_Size = __Vectors_End - __Vectors;
  81. __end__ = .;
  82.  
  83.  
  84. *(.text*)
  85.  
  86. KEEP(*(.init))
  87. KEEP(*(.fini))
  88.  
  89. /* .ctors */
  90. *crtbegin.o(.ctors)
  91. *crtbegin?.o(.ctors)
  92. *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
  93. *(SORT(.ctors.*))
  94. *(.ctors)
  95.  
  96. /* .dtors */
  97. *crtbegin.o(.dtors)
  98. *crtbegin?.o(.dtors)
  99. *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors)
  100. *(SORT(.dtors.*))
  101. *(.dtors)
  102.  
  103. *(.rodata*)
  104.  
  105. KEEP(*(.eh_frame*))
  106. } > FLASH
  107.  
  108. .ARM.extab :
  109. {
  110. *(.ARM.extab* .gnu.linkonce.armextab.*)
  111. } > FLASH
  112.  
  113. __exidx_start = .;
  114. .ARM.exidx :
  115. {
  116. *(.ARM.exidx* .gnu.linkonce.armexidx.*)
  117. } > FLASH
  118. __exidx_end = .;
  119.  
  120. /* To copy multiple ROM to RAM sections,
  121. * uncomment .copy.table section and,
  122. * define __STARTUP_COPY_MULTIPLE in startup_ARMCMx.S */
  123. /*
  124. .copy.table :
  125. {
  126. . = ALIGN(8);
  127. __copy_table_start__ = .;
  128. LONG (__etext)
  129. LONG (__data_start__)
  130. LONG (__data_end__ - __data_start__)
  131. LONG (__etext2)
  132. LONG (__data2_start__)
  133. LONG (__data2_end__ - __data2_start__)
  134. __copy_table_end__ = .;
  135. } > FLASH
  136. */
  137.  
  138. /* To clear multiple BSS sections,
  139. * uncomment .zero.table section and,
  140. * define __STARTUP_CLEAR_BSS_MULTIPLE in startup_ARMCMx.S */
  141. /*
  142. .zero.table :
  143. {
  144. . = ALIGN(8);
  145. __zero_table_start__ = .;
  146. LONG (__bss_start__)
  147. LONG (__bss_end__ - __bss_start__)
  148. LONG (__bss2_start__)
  149. LONG (__bss2_end__ - __bss2_start__)
  150. __zero_table_end__ = .;
  151. } > FLASH
  152. */
  153.  
  154.  
  155. .data :
  156. {
  157. PROVIDE(__etext = LOADADDR(.data)); /* Define a global symbol at end of code, */
  158. PROVIDE(__DATA_ROM = LOADADDR(.data)); /* Symbol is used by startup for data initialization. */
  159.  
  160. __data_start__ = .;
  161. *("dma")
  162. PROVIDE( __start_vector_table__ = .);
  163. . += __vector_size;
  164. PROVIDE( __end_vector_table__ = .);
  165. *(vtable)
  166. *(.data*)
  167. . = ALIGN (8);
  168. *(.ram)
  169.  
  170. . = ALIGN(8);
  171. /* preinit data */
  172. PROVIDE_HIDDEN (__preinit_array_start = .);
  173. KEEP(*(.preinit_array))
  174. PROVIDE_HIDDEN (__preinit_array_end = .);
  175.  
  176. . = ALIGN(8);
  177. /* init data */
  178. PROVIDE_HIDDEN (__init_array_start = .);
  179. KEEP(*(SORT(.init_array.*)))
  180. KEEP(*(.init_array))
  181. PROVIDE_HIDDEN (__init_array_end = .);
  182.  
  183. . = ALIGN(8);
  184. /* finit data */
  185. PROVIDE_HIDDEN (__fini_array_start = .);
  186. KEEP(*(SORT(.fini_array.*)))
  187. KEEP(*(.fini_array))
  188. PROVIDE_HIDDEN (__fini_array_end = .);
  189.  
  190. KEEP(*(.jcr*))
  191. . = ALIGN(8);
  192. /* All data end */
  193. __data_end__ = .;
  194.  
  195. } > RAM AT > FLASH
  196.  
  197.  
  198. /* Uninitialized data section
  199. * This region is not initialized by the C/C++ library and can be used to
  200. * store state across soft reboots. */
  201. .uninitialized (NOLOAD):
  202. {
  203. . = ALIGN(32);
  204. __uninitialized_start = .;
  205. *(.uninitialized)
  206. KEEP(*(.keep.uninitialized))
  207. . = ALIGN(32);
  208. __uninitialized_end = .;
  209. } > RAM
  210.  
  211. .bss :
  212. {
  213. . = ALIGN(8);
  214. __bss_start__ = .;
  215. *(.bss*)
  216. *(COMMON)
  217. . = ALIGN(8);
  218. __bss_end__ = .;
  219. } > RAM
  220.  
  221. .heap (NOLOAD):
  222. {
  223. __HeapBase = .;
  224. __end__ = .;
  225. end = __end__;
  226. _end = __end__;
  227. . = ORIGIN(RAM) + LENGTH(RAM) - STACK_SIZE;
  228. __HeapLimit = .;
  229. } > RAM
  230.  
  231. __StackTop = ORIGIN(RAM) + LENGTH(RAM);
  232. __stack = __StackTop;
  233. __StackLimit = __StackTop - STACK_SIZE;
  234.  
  235. ASSERT(__StackLimit >= __HeapLimit, "Region RAM overflowed with stack and heap")
  236.  
  237. .neai 0x0000000020000000 :
  238. {
  239. KEEP(*(.neai)) /* keep my variable even if not referenced */
  240. } > RAM
  241.  
  242. }
  243.  
  244.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement