My Marlin configs for Fabrikator Mini and CTC i3 Pro B
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.

flash.ld 4.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. /* ----------------------------------------------------------------------------
  2. * SAM Software Package License
  3. * ----------------------------------------------------------------------------
  4. * Copyright (c) 2012, Atmel Corporation
  5. *
  6. * All rights reserved.
  7. *
  8. * Redistribution and use in source and binary forms, with or without
  9. * modification, are permitted provided that the following condition is met:
  10. *
  11. * - Redistributions of source code must retain the above copyright notice,
  12. * this list of conditions and the disclaimer below.
  13. *
  14. * Atmel's name may not be used to endorse or promote products derived from
  15. * this software without specific prior written permission.
  16. *
  17. * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
  18. * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  19. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
  20. * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
  21. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  22. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
  23. * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  24. * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  25. * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  26. * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  27. * ----------------------------------------------------------------------------
  28. */
  29. OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
  30. OUTPUT_ARCH(arm)
  31. SEARCH_DIR(.)
  32. /* Memory Spaces Definitions */
  33. MEMORY
  34. {
  35. rom (rx) : ORIGIN = 0x00080000, LENGTH = 0x00080000 /* Flash, 512K */
  36. sram0 (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00010000 /* sram0, 64K */
  37. sram1 (rwx) : ORIGIN = 0x20080000, LENGTH = 0x00008000 /* sram1, 32K */
  38. ram (rwx) : ORIGIN = 0x20070000, LENGTH = 0x00018000 /* sram, 96K */
  39. }
  40. /* Section Definitions */
  41. SECTIONS
  42. {
  43. .text :
  44. {
  45. . = ALIGN(4);
  46. _sfixed = .;
  47. KEEP(*(.vectors .vectors.*))
  48. *(.text .text.* .gnu.linkonce.t.*)
  49. *(.glue_7t) *(.glue_7)
  50. *(.rodata .rodata* .gnu.linkonce.r.*)
  51. *(.ARM.extab* .gnu.linkonce.armextab.*)
  52. /* Support C constructors, and C destructors in both user code
  53. and the C library. This also provides support for C++ code. */
  54. . = ALIGN(4);
  55. KEEP(*(.init))
  56. . = ALIGN(4);
  57. __preinit_array_start = .;
  58. KEEP (*(.preinit_array))
  59. __preinit_array_end = .;
  60. . = ALIGN(4);
  61. __init_array_start = .;
  62. KEEP (*(SORT(.init_array.*)))
  63. KEEP (*(.init_array))
  64. __init_array_end = .;
  65. . = ALIGN(0x4);
  66. KEEP (*crtbegin.o(.ctors))
  67. KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
  68. KEEP (*(SORT(.ctors.*)))
  69. KEEP (*crtend.o(.ctors))
  70. . = ALIGN(4);
  71. KEEP(*(.fini))
  72. . = ALIGN(4);
  73. __fini_array_start = .;
  74. KEEP (*(.fini_array))
  75. KEEP (*(SORT(.fini_array.*)))
  76. __fini_array_end = .;
  77. KEEP (*crtbegin.o(.dtors))
  78. KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
  79. KEEP (*(SORT(.dtors.*)))
  80. KEEP (*crtend.o(.dtors))
  81. . = ALIGN(4);
  82. _efixed = .; /* End of text section */
  83. } > rom
  84. /* .ARM.exidx is sorted, so has to go in its own output section. */
  85. PROVIDE_HIDDEN (__exidx_start = .);
  86. .ARM.exidx :
  87. {
  88. *(.ARM.exidx* .gnu.linkonce.armexidx.*)
  89. } > rom
  90. PROVIDE_HIDDEN (__exidx_end = .);
  91. . = ALIGN(4);
  92. _etext = .;
  93. .relocate : AT (_etext)
  94. {
  95. . = ALIGN(4);
  96. _srelocate = .;
  97. *(.ramfunc .ramfunc.*);
  98. *(.data .data.*);
  99. . = ALIGN(4);
  100. _erelocate = .;
  101. } > ram
  102. /* .bss section which is used for uninitialized data */
  103. .bss ALIGN(4) (NOLOAD) :
  104. {
  105. . = ALIGN(4);
  106. _sbss = . ;
  107. _szero = .;
  108. *(.bss .bss.*)
  109. *(COMMON)
  110. . = ALIGN(4);
  111. _ebss = . ;
  112. _ezero = .;
  113. } > ram
  114. . = ALIGN(4);
  115. _end = . ;
  116. /* .stack_dummy section doesn't contains any symbols. It is only
  117. used for linker to calculate size of stack sections, and assign
  118. values to stack symbols later */
  119. .stack_dummy :
  120. {
  121. *(.stack*)
  122. } > ram
  123. /* Set stack top to end of ram, and stack limit move down by
  124. * size of stack_dummy section */
  125. __StackTop = ORIGIN(ram) + LENGTH(ram);
  126. __StackLimit = __StackTop - SIZEOF(.stack_dummy);
  127. PROVIDE(_sstack = __StackLimit);
  128. PROVIDE(_estack = __StackTop);
  129. }