Implement a secure ICS protocol targeting LoRa Node151 microcontroller for controlling irrigation.
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.
 
 
 
 
 
 

202 lines
5.8 KiB

  1. /*
  2. ******************************************************************************
  3. **
  4. ** File : LinkerScript.ld
  5. **
  6. XXXX
  7. ** Set heap size, stack size and stack location according
  8. ** to application requirements.
  9. **
  10. ** Set memory bank area and size if external memory is used.
  11. **
  12. ** Target : STMicroelectronics STM32
  13. **
  14. ** Distribution: The file is distributed as is without any warranty
  15. ** of any kind.
  16. **
  17. *****************************************************************************
  18. ** @attention
  19. **
  20. ** <h2><center>&copy; COPYRIGHT(c) 2020 STMicroelectronics</center></h2>
  21. **
  22. ** Redistribution and use in source and binary forms, with or without modification,
  23. ** are permitted provided that the following conditions are met:
  24. ** 1. Redistributions of source code must retain the above copyright notice,
  25. ** this list of conditions and the following disclaimer.
  26. ** 2. Redistributions in binary form must reproduce the above copyright notice,
  27. ** this list of conditions and the following disclaimer in the documentation
  28. ** and/or other materials provided with the distribution.
  29. ** 3. Neither the name of STMicroelectronics nor the names of its contributors
  30. ** may be used to endorse or promote products derived from this software
  31. ** without specific prior written permission.
  32. **
  33. ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  34. ** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  35. ** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  36. ** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
  37. ** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  38. ** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  39. ** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  40. ** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  41. ** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  42. ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  43. **
  44. *****************************************************************************
  45. */
  46. /* Entry Point */
  47. ENTRY(Reset_Handler)
  48. /* Highest address of the user mode stack */
  49. _estack = ORIGIN(RAM) + LENGTH(RAM); /* end of "RAM" Ram type memory */
  50. _Min_Heap_Size = 0x200 ; /* required amount of heap */
  51. _Min_Stack_Size = 0x400 ; /* required amount of stack */
  52. /* Memories definition */
  53. MEMORY
  54. {
  55. RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 20K
  56. FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 64K
  57. }
  58. /* Sections */
  59. SECTIONS
  60. {
  61. /* The startup code into "FLASH" Rom type memory */
  62. .isr_vector :
  63. {
  64. . = ALIGN(4);
  65. KEEP(*(.isr_vector)) /* Startup code */
  66. . = ALIGN(4);
  67. } >FLASH
  68. /* The program code and other data into "FLASH" Rom type memory */
  69. .text :
  70. {
  71. . = ALIGN(4);
  72. *(.text) /* .text sections (code) */
  73. *(.text*) /* .text* sections (code) */
  74. *(.glue_7) /* glue arm to thumb code */
  75. *(.glue_7t) /* glue thumb to arm code */
  76. *(.eh_frame)
  77. KEEP (*(.init))
  78. KEEP (*(.fini))
  79. . = ALIGN(4);
  80. _etext = .; /* define a global symbols at end of code */
  81. } >FLASH
  82. /* Constant data into "FLASH" Rom type memory */
  83. .rodata :
  84. {
  85. . = ALIGN(4);
  86. *(.rodata) /* .rodata sections (constants, strings, etc.) */
  87. *(.rodata*) /* .rodata* sections (constants, strings, etc.) */
  88. . = ALIGN(4);
  89. __start_set_sysinit_set = .;
  90. KEEP(*(set_sysinit_set)) /* sysinit linker sets */
  91. __stop_set_sysinit_set = .;
  92. . = ALIGN(4);
  93. } >FLASH
  94. .ARM.extab : {
  95. . = ALIGN(4);
  96. *(.ARM.extab* .gnu.linkonce.armextab.*)
  97. . = ALIGN(4);
  98. } >FLASH
  99. .ARM : {
  100. . = ALIGN(4);
  101. __exidx_start = .;
  102. *(.ARM.exidx*)
  103. __exidx_end = .;
  104. . = ALIGN(4);
  105. } >FLASH
  106. .preinit_array :
  107. {
  108. . = ALIGN(4);
  109. PROVIDE_HIDDEN (__preinit_array_start = .);
  110. KEEP (*(.preinit_array*))
  111. PROVIDE_HIDDEN (__preinit_array_end = .);
  112. . = ALIGN(4);
  113. } >FLASH
  114. .init_array :
  115. {
  116. . = ALIGN(4);
  117. PROVIDE_HIDDEN (__init_array_start = .);
  118. KEEP (*(SORT(.init_array.*)))
  119. KEEP (*(.init_array*))
  120. PROVIDE_HIDDEN (__init_array_end = .);
  121. . = ALIGN(4);
  122. } >FLASH
  123. .fini_array :
  124. {
  125. . = ALIGN(4);
  126. PROVIDE_HIDDEN (__fini_array_start = .);
  127. KEEP (*(SORT(.fini_array.*)))
  128. KEEP (*(.fini_array*))
  129. PROVIDE_HIDDEN (__fini_array_end = .);
  130. . = ALIGN(4);
  131. } >FLASH
  132. /* Used by the startup to initialize data */
  133. _sidata = LOADADDR(.data);
  134. /* Initialized data sections into "RAM" Ram type memory */
  135. .data :
  136. {
  137. . = ALIGN(4);
  138. _sdata = .; /* create a global symbol at data start */
  139. *(.data) /* .data sections */
  140. *(.data*) /* .data* sections */
  141. . = ALIGN(4);
  142. _edata = .; /* define a global symbol at data end */
  143. } >RAM AT> FLASH
  144. /* Uninitialized data section into "RAM" Ram type memory */
  145. . = ALIGN(4);
  146. .bss :
  147. {
  148. /* This is used by the startup in order to initialize the .bss section */
  149. _sbss = .; /* define a global symbol at bss start */
  150. __bss_start__ = _sbss;
  151. *(.bss)
  152. *(.bss*)
  153. *(COMMON)
  154. . = ALIGN(4);
  155. _ebss = .; /* define a global symbol at bss end */
  156. __bss_end__ = _ebss;
  157. } >RAM
  158. /* User_heap_stack section, used to check that there is enough "RAM" Ram type memory left */
  159. ._user_heap_stack :
  160. {
  161. . = ALIGN(8);
  162. PROVIDE ( end = . );
  163. PROVIDE ( _end = . );
  164. . = . + _Min_Heap_Size;
  165. . = . + _Min_Stack_Size;
  166. . = ALIGN(8);
  167. } >RAM
  168. /* Remove information from the compiler libraries */
  169. /DISCARD/ :
  170. {
  171. libc.a ( * )
  172. libm.a ( * )
  173. libgcc.a ( * )
  174. }
  175. .ARM.attributes 0 : { *(.ARM.attributes) }
  176. }