samd21j18.ld 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /*
  2. * Copyright (c) 2015, Alex Taradov <alex@taradov.com>
  3. * All rights reserved.
  4. *
  5. * Redistribution and use in source and binary forms, with or without
  6. * modification, are permitted provided that the following conditions are met:
  7. *
  8. * 1. Redistributions of source code must retain the above copyright notice,
  9. * this list of conditions and the following disclaimer.
  10. * 2. Redistributions in binary form must reproduce the above copyright
  11. * notice, this list of conditions and the following disclaimer in the
  12. * documentation and/or other materials provided with the distribution.
  13. * 3. The name of the author may not be used to endorse or promote products
  14. * derived from this software without specific prior written permission.
  15. *
  16. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  17. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  18. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  19. * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
  20. * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  21. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  22. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  23. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  24. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  25. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  26. * POSSIBILITY OF SUCH DAMAGE.
  27. */
  28. MEMORY
  29. {
  30. flash (rx) : ORIGIN = 0x00000000, LENGTH = 0x40000 /* 256k */
  31. ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x8000 /* 32k */
  32. }
  33. __top_flash = 0x40000;
  34. __top_ram = 0x20000000 + 0x8000;
  35. ENTRY(irq_handler_reset)
  36. SECTIONS
  37. {
  38. .text : ALIGN(4)
  39. {
  40. FILL(0xff)
  41. KEEP(*(.vectors))
  42. *(.text*)
  43. *(.rodata)
  44. *(.rodata.*)
  45. . = ALIGN(4);
  46. } > flash
  47. . = ALIGN(4);
  48. _etext = .;
  49. .uninit_RESERVED : ALIGN(4)
  50. {
  51. KEEP(*(.bss.$RESERVED*))
  52. } > ram
  53. .data : ALIGN(4)
  54. {
  55. FILL(0xff)
  56. _data = .;
  57. *(vtable)
  58. *(.data*)
  59. . = ALIGN(4);
  60. _edata = .;
  61. } > ram AT > flash
  62. .bss : ALIGN(4)
  63. {
  64. _bss = .;
  65. *(.bss*)
  66. *(COMMON)
  67. . = ALIGN(4);
  68. _ebss = .;
  69. PROVIDE(_end = .);
  70. } > ram
  71. PROVIDE(_stack_top = __top_ram - 0);
  72. }