application.lds 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. /*
  2. * This file is part of the MicroPython project, http://micropython.org/
  3. *
  4. * The MIT License (MIT)
  5. *
  6. * Copyright (c) 2015 Daniel Campora
  7. *
  8. * Permission is hereby granted, free of charge, to any person obtaining a copy
  9. * of this software and associated documentation files (the "Software"), to deal
  10. * in the Software without restriction, including without limitation the rights
  11. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  12. * copies of the Software, and to permit persons to whom the Software is
  13. * furnished to do so, subject to the following conditions:
  14. *
  15. * The above copyright notice and this permission notice shall be included in
  16. * all copies or substantial portions of the Software.
  17. *
  18. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  19. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  20. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  21. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  22. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  23. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  24. * THE SOFTWARE.
  25. */
  26. __stack_size__ = 2K; /* interrupts are handled within this stack */
  27. __min_heap_size__ = 8K;
  28. MEMORY
  29. {
  30. SRAMB (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00004000
  31. SRAM (rwx) : ORIGIN = 0x20004000, LENGTH = 0x0003C000
  32. }
  33. ENTRY(ResetISR)
  34. SECTIONS
  35. {
  36. /* place the FreeRTOS heap (the MicroPython stack will live here) */
  37. .rtos_heap (NOLOAD) :
  38. {
  39. . = ALIGN(8);
  40. *(.rtos_heap*)
  41. . = ALIGN(8);
  42. } > SRAMB
  43. .text :
  44. {
  45. _text = .;
  46. KEEP(*(.intvecs))
  47. *(.text*)
  48. *(.rodata*)
  49. *(.ARM.extab* .gnu.linkonce.armextab.*)
  50. . = ALIGN(8);
  51. } > SRAM
  52. .ARM :
  53. {
  54. __exidx_start = .;
  55. *(.ARM.exidx*)
  56. __exidx_end = .;
  57. _etext = .;
  58. } > SRAM
  59. .data :
  60. {
  61. . = ALIGN(8);
  62. _data = .;
  63. *(.data*)
  64. . = ALIGN(8);
  65. _edata = .;
  66. } > SRAM
  67. .bss :
  68. {
  69. . = ALIGN(8);
  70. _bss = .;
  71. *(.bss*)
  72. *(COMMON)
  73. . = ALIGN(8);
  74. _ebss = .;
  75. } > SRAM
  76. /* place here functions that are only called during boot up, */
  77. /* that way, we can re-use this area for the MicroPython heap */
  78. .boot :
  79. {
  80. . = ALIGN(8);
  81. _boot = .;
  82. *(.boot*)
  83. . = ALIGN(8);
  84. _eboot = .;
  85. } > SRAM
  86. /* allocate the MicroPython heap */
  87. .heap :
  88. {
  89. . = ALIGN(8);
  90. _heap = .;
  91. . = . + __min_heap_size__;
  92. . = . + (ORIGIN(SRAM) + LENGTH(SRAM) - __stack_size__ - ABSOLUTE(.));
  93. . = ALIGN(8);
  94. _eheap = .;
  95. } > SRAM
  96. /* allocate the main stack */
  97. .stack ORIGIN(SRAM) + LENGTH(SRAM) - __stack_size__ :
  98. {
  99. . = ALIGN(8);
  100. _stack = .;
  101. . = . + __stack_size__;
  102. . = ALIGN(8);
  103. _estack = .;
  104. } > SRAM
  105. }