SPC560P50.ld 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. /*
  2. ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. /*
  14. * SPC560P50 memory setup.
  15. */
  16. MEMORY
  17. {
  18. flash : org = 0x00000000, len = 512k
  19. dataflash : org = 0x00800000, len = 64k
  20. ram : org = 0x40000000, len = 40k
  21. }
  22. OPTION ("-e=_reset_address")
  23. SECTIONS
  24. {
  25. .boot0 ALIGN(16) :
  26. {
  27. *(.boot)
  28. *(.handlers)
  29. *(.crt0)
  30. } > flash
  31. .vectors ALIGN(0x800) :
  32. {
  33. /* The vectors table requires a 2kB alignment.*/
  34. *(.vectors)
  35. } > flash
  36. .ivors ALIGN(0x1000) :
  37. {
  38. /* The IVORs table requires a 4kB alignment.*/
  39. __ivpr_base__ = .;
  40. *(.ivors)
  41. } > flash
  42. constructors ALIGN(4) :
  43. {
  44. PROVIDE(__init_array_start = .);
  45. "*(.init_array.*)"
  46. *(.init_array)
  47. PROVIDE(__init_array_end = .);
  48. } > flash
  49. destructors ALIGN(4) :
  50. {
  51. PROVIDE(__fini_array_start = .);
  52. *(.fini_array)
  53. "*(.fini_array.*)"
  54. PROVIDE(__fini_array_end = .);
  55. } > flash
  56. .vletext ALIGN(16) :
  57. {
  58. *(.vletext)
  59. "*(.vletext.*)"
  60. } > flash
  61. .text ALIGN(16) :
  62. {
  63. *(.text)
  64. "*(.text.*)"
  65. } > flash
  66. .rodata ALIGN(16) :
  67. {
  68. *(.rodata)
  69. "*(.rodata.*)"
  70. *(.rodata1)
  71. } > flash
  72. .sdata2 ALIGN(16) :
  73. {
  74. __sdata2_start__ = . + 0x8000;
  75. *(.sdata2)
  76. "*(.sdata2.*)"
  77. *(.sbss2)
  78. "*(.sbss2.*)"
  79. } > flash
  80. .stacks ALIGN(16) :
  81. {
  82. . = ALIGN(8);
  83. __irq_stack_base__ = .;
  84. . += __irq_stack_size__;
  85. . = ALIGN(8);
  86. __irq_stack_end__ = .;
  87. __process_stack_base__ = .;
  88. __main_thread_stack_base__ = .;
  89. . += __process_stack_size__;
  90. . = ALIGN(8);
  91. __process_stack_end__ = .;
  92. __main_thread_stack_end__ = .;
  93. } > ram
  94. .romdatastart ALIGN(16) :
  95. {
  96. __romdata_start__ = .;
  97. } > flash
  98. .data ALIGN(4) : AT(__romdata_start__)
  99. {
  100. __data_start__ = .;
  101. *(.data)
  102. "*(.data.*)"
  103. . = ALIGN(4);
  104. *(.ramtext)
  105. . = ALIGN(4);
  106. __data_end__ = .;
  107. } > ram
  108. __romsdata_start__ = (__data_end__ - __data_start__) + __romdata_start__;
  109. .sdata ALIGN(4) : AT(__romsdata_start__)
  110. {
  111. __sdata_start__ = . + 0x8000;
  112. *(.sdata)
  113. "*(.sdata.*)"
  114. } > ram
  115. .sbss ALIGN(4) :
  116. {
  117. __bss_start__ = .;
  118. *(.sbss)
  119. "*(.sbss.*)"
  120. *(.scommon)
  121. } > ram
  122. .bss ALIGN(4) :
  123. {
  124. *(.bss)
  125. "*(.bss.*)"
  126. *(COMMON)
  127. __bss_end__ = .;
  128. } > ram
  129. __flash_size__ = SIZEOF(flash);
  130. __flash_start__ = ADDR(flash);
  131. __flash_end__ = ENDADDR(flash);
  132. __dataflash_size__ = SIZEOF(dataflash);
  133. __dataflash_start__ = ADDR(dataflash);
  134. __dataflash_end__ = ENDADDR(dataflash);
  135. __ram_size__ = SIZEOF(ram);
  136. __ram_start__ = ADDR(ram);
  137. __ram_end__ = ENDADDR(ram);
  138. __heap_base__ = __bss_end__;
  139. __heap_end__ = __ram_end__;
  140. }