SPC56EC74.ld 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  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. * SPC56EC74 memory setup.
  15. */
  16. MEMORY
  17. {
  18. flash : org = 0x00000000, len = 3M
  19. dataflash : org = 0x00800000, len = 64k
  20. ram : org = 0x40000000, len = 256k
  21. }
  22. OPTION ("-e=_reset_address")
  23. SECTIONS
  24. {
  25. .boot0 ALIGN(16) :
  26. {
  27. __ivpr_base__ = .;
  28. *(.boot)
  29. *(.handlers)
  30. *(.crt0)
  31. } > flash
  32. .vectors ALIGN(0x800) :
  33. {
  34. /* The vectors table requires a 2kB alignment.*/
  35. *(.vectors)
  36. } > flash
  37. constructors ALIGN(4) :
  38. {
  39. PROVIDE(__init_array_start = .);
  40. "*(.init_array.*)"
  41. *(.init_array)
  42. PROVIDE(__init_array_end = .);
  43. } > flash
  44. destructors ALIGN(4) :
  45. {
  46. PROVIDE(__fini_array_start = .);
  47. *(.fini_array)
  48. "*(.fini_array.*)"
  49. PROVIDE(__fini_array_end = .);
  50. } > flash
  51. .vletext ALIGN(16) :
  52. {
  53. *(.vletext)
  54. "*(.vletext.*)"
  55. } > flash
  56. .text ALIGN(16) :
  57. {
  58. *(.text)
  59. "*(.text.*)"
  60. } > flash
  61. .rodata ALIGN(16) :
  62. {
  63. *(.rodata)
  64. "*(.rodata.*)"
  65. *(.rodata1)
  66. } > flash
  67. .sdata2 ALIGN(16) :
  68. {
  69. __sdata2_start__ = . + 0x8000;
  70. *(.sdata2)
  71. "*(.sdata2.*)"
  72. *(.sbss2)
  73. "*(.sbss2.*)"
  74. } > flash
  75. .stacks ALIGN(16) :
  76. {
  77. . = ALIGN(8);
  78. __irq_stack_base__ = .;
  79. . += __irq_stack_size__;
  80. . = ALIGN(8);
  81. __irq_stack_end__ = .;
  82. __process_stack_base__ = .;
  83. __main_thread_stack_base__ = .;
  84. . += __process_stack_size__;
  85. . = ALIGN(8);
  86. __process_stack_end__ = .;
  87. __main_thread_stack_end__ = .;
  88. } > ram
  89. .romdatastart ALIGN(16) :
  90. {
  91. __romdata_start__ = .;
  92. } > flash
  93. .data ALIGN(4) : AT(__romdata_start__)
  94. {
  95. __data_start__ = .;
  96. *(.data)
  97. "*(.data.*)"
  98. . = ALIGN(4);
  99. *(.ramtext)
  100. . = ALIGN(4);
  101. __data_end__ = .;
  102. } > ram
  103. __romsdata_start__ = (__data_end__ - __data_start__) + __romdata_start__;
  104. .sdata ALIGN(4) : AT(__romsdata_start__)
  105. {
  106. __sdata_start__ = . + 0x8000;
  107. *(.sdata)
  108. "*(.sdata.*)"
  109. } > ram
  110. .sbss ALIGN(4) :
  111. {
  112. __bss_start__ = .;
  113. *(.sbss)
  114. "*(.sbss.*)"
  115. *(.scommon)
  116. } > ram
  117. .bss ALIGN(4) :
  118. {
  119. *(.bss)
  120. "*(.bss.*)"
  121. *(COMMON)
  122. __bss_end__ = .;
  123. } > ram
  124. __flash_size__ = SIZEOF(flash);
  125. __flash_start__ = ADDR(flash);
  126. __flash_end__ = ENDADDR(flash);
  127. __dataflash_size__ = SIZEOF(dataflash);
  128. __dataflash_start__ = ADDR(dataflash);
  129. __dataflash_end__ = ENDADDR(dataflash);
  130. __ram_size__ = SIZEOF(ram);
  131. __ram_start__ = ADDR(ram);
  132. __ram_end__ = ENDADDR(ram);
  133. __heap_base__ = __bss_end__;
  134. __heap_end__ = __ram_end__;
  135. }