Teensy 4.1 core updated for C++20
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

mk20dx256.ld 4.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. /* Teensyduino Core Library
  2. * http://www.pjrc.com/teensy/
  3. * Copyright (c) 2013 PJRC.COM, LLC.
  4. *
  5. * Permission is hereby granted, free of charge, to any person obtaining
  6. * a copy of this software and associated documentation files (the
  7. * "Software"), to deal in the Software without restriction, including
  8. * without limitation the rights to use, copy, modify, merge, publish,
  9. * distribute, sublicense, and/or sell copies of the Software, and to
  10. * permit persons to whom the Software is furnished to do so, subject to
  11. * the following conditions:
  12. *
  13. * 1. The above copyright notice and this permission notice shall be
  14. * included in all copies or substantial portions of the Software.
  15. *
  16. * 2. If the Software is incorporated into a build system that allows
  17. * selection among a list of target devices, then similar target
  18. * devices manufactured by PJRC.COM must be included in the list of
  19. * target devices and selectable in the same manner.
  20. *
  21. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  22. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  23. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  24. * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
  25. * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
  26. * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  27. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  28. * SOFTWARE.
  29. */
  30. MEMORY
  31. {
  32. FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 256K
  33. RAM (rwx) : ORIGIN = 0x1FFF8000, LENGTH = 64K
  34. }
  35. /* INCLUDE common.ld */
  36. /* Teensyduino Core Library
  37. * http://www.pjrc.com/teensy/
  38. * Copyright (c) 2013 PJRC.COM, LLC.
  39. *
  40. * Permission is hereby granted, free of charge, to any person obtaining
  41. * a copy of this software and associated documentation files (the
  42. * "Software"), to deal in the Software without restriction, including
  43. * without limitation the rights to use, copy, modify, merge, publish,
  44. * distribute, sublicense, and/or sell copies of the Software, and to
  45. * permit persons to whom the Software is furnished to do so, subject to
  46. * the following conditions:
  47. *
  48. * 1. The above copyright notice and this permission notice shall be
  49. * included in all copies or substantial portions of the Software.
  50. *
  51. * 2. If the Software is incorporated into a build system that allows
  52. * selection among a list of target devices, then similar target
  53. * devices manufactured by PJRC.COM must be included in the list of
  54. * target devices and selectable in the same manner.
  55. *
  56. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  57. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  58. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  59. * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
  60. * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
  61. * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  62. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  63. * SOFTWARE.
  64. */
  65. SECTIONS
  66. {
  67. .text : {
  68. . = 0;
  69. KEEP(*(.vectors))
  70. *(.startup*)
  71. /* TODO: does linker detect startup overflow onto flashconfig? */
  72. . = 0x400;
  73. KEEP(*(.flashconfig*))
  74. *(.text*)
  75. *(.rodata*)
  76. . = ALIGN(4);
  77. KEEP(*(.init))
  78. . = ALIGN(4);
  79. __preinit_array_start = .;
  80. KEEP (*(.preinit_array))
  81. __preinit_array_end = .;
  82. __init_array_start = .;
  83. KEEP (*(SORT(.init_array.*)))
  84. KEEP (*(.init_array))
  85. __init_array_end = .;
  86. } > FLASH = 0xFF
  87. .ARM.exidx : {
  88. __exidx_start = .;
  89. *(.ARM.exidx* .gnu.linkonce.armexidx.*)
  90. __exidx_end = .;
  91. } > FLASH
  92. _etext = .;
  93. .usbdescriptortable (NOLOAD) : {
  94. /* . = ORIGIN(RAM); */
  95. . = ALIGN(512);
  96. *(.usbdescriptortable*)
  97. } > RAM
  98. .dmabuffers (NOLOAD) : {
  99. . = ALIGN(4);
  100. *(.dmabuffers*)
  101. } > RAM
  102. .usbbuffers (NOLOAD) : {
  103. . = ALIGN(4);
  104. *(.usbbuffers*)
  105. } > RAM
  106. .data : AT (_etext) {
  107. . = ALIGN(4);
  108. _sdata = .;
  109. *(.data*)
  110. . = ALIGN(4);
  111. _edata = .;
  112. } > RAM
  113. .noinit (NOLOAD) : {
  114. *(.noinit*)
  115. } > RAM
  116. .bss : {
  117. . = ALIGN(4);
  118. _sbss = .;
  119. *(.bss*)
  120. *(COMMON)
  121. . = ALIGN(4);
  122. _ebss = .;
  123. __bss_end = .;
  124. } > RAM
  125. _estack = ORIGIN(RAM) + LENGTH(RAM);
  126. }