lpc4357.ld 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324
  1. /*
  2. * GENERATED FILE - DO NOT EDIT
  3. * (c) Code Red Technologies Ltd, 2008-2013
  4. * (c) NXP Semiconductors 2013-2019
  5. * Generated linker script file for LPC4357
  6. * Created from linkscript.ldt by FMCreateLinkLibraries
  7. * Using Freemarker v2.3.23
  8. * MCUXpresso IDE v10.2.1 [Build 795] [2018-07-25] on May 15, 2019 5:48:43 PM
  9. */
  10. MEMORY
  11. {
  12. /* Define each memory region */
  13. MFlashA512 (rx) : ORIGIN = 0x1a000000, LENGTH = 0x80000 /* 512K bytes (alias Flash) */
  14. MFlashB512 (rx) : ORIGIN = 0x1b000000, LENGTH = 0x80000 /* 512K bytes (alias Flash2) */
  15. RamLoc32 (rwx) : ORIGIN = 0x10000000, LENGTH = 0x8000 /* 32K bytes (alias RAM) */
  16. RamLoc40 (rwx) : ORIGIN = 0x10080000, LENGTH = 0xa000 /* 40K bytes (alias RAM2) */
  17. RamAHB32 (rwx) : ORIGIN = 0x20000000, LENGTH = 0x8000 /* 32K bytes (alias RAM3) */
  18. RamAHB16 (rwx) : ORIGIN = 0x20008000, LENGTH = 0x4000 /* 16K bytes (alias RAM4) */
  19. RamAHB_ETB16 (rwx) : ORIGIN = 0x2000c000, LENGTH = 0x4000 /* 16K bytes (alias RAM5) */
  20. }
  21. /* Define a symbol for the top of each memory region */
  22. __base_MFlashA512 = 0x1a000000 ; /* MFlashA512 */
  23. __base_Flash = 0x1a000000 ; /* Flash */
  24. __top_MFlashA512 = 0x1a000000 + 0x80000 ; /* 512K bytes */
  25. __top_Flash = 0x1a000000 + 0x80000 ; /* 512K bytes */
  26. __base_MFlashB512 = 0x1b000000 ; /* MFlashB512 */
  27. __base_Flash2 = 0x1b000000 ; /* Flash2 */
  28. __top_MFlashB512 = 0x1b000000 + 0x80000 ; /* 512K bytes */
  29. __top_Flash2 = 0x1b000000 + 0x80000 ; /* 512K bytes */
  30. __base_RamLoc32 = 0x10000000 ; /* RamLoc32 */
  31. __base_RAM = 0x10000000 ; /* RAM */
  32. __top_RamLoc32 = 0x10000000 + 0x8000 ; /* 32K bytes */
  33. __top_RAM = 0x10000000 + 0x8000 ; /* 32K bytes */
  34. __base_RamLoc40 = 0x10080000 ; /* RamLoc40 */
  35. __base_RAM2 = 0x10080000 ; /* RAM2 */
  36. __top_RamLoc40 = 0x10080000 + 0xa000 ; /* 40K bytes */
  37. __top_RAM2 = 0x10080000 + 0xa000 ; /* 40K bytes */
  38. __base_RamAHB32 = 0x20000000 ; /* RamAHB32 */
  39. __base_RAM3 = 0x20000000 ; /* RAM3 */
  40. __top_RamAHB32 = 0x20000000 + 0x8000 ; /* 32K bytes */
  41. __top_RAM3 = 0x20000000 + 0x8000 ; /* 32K bytes */
  42. __base_RamAHB16 = 0x20008000 ; /* RamAHB16 */
  43. __base_RAM4 = 0x20008000 ; /* RAM4 */
  44. __top_RamAHB16 = 0x20008000 + 0x4000 ; /* 16K bytes */
  45. __top_RAM4 = 0x20008000 + 0x4000 ; /* 16K bytes */
  46. __base_RamAHB_ETB16 = 0x2000c000 ; /* RamAHB_ETB16 */
  47. __base_RAM5 = 0x2000c000 ; /* RAM5 */
  48. __top_RamAHB_ETB16 = 0x2000c000 + 0x4000 ; /* 16K bytes */
  49. __top_RAM5 = 0x2000c000 + 0x4000 ; /* 16K bytes */
  50. ENTRY(ResetISR)
  51. SECTIONS
  52. {
  53. .text_Flash2 : ALIGN(4)
  54. {
  55. FILL(0xff)
  56. *(.text_Flash2*) /* for compatibility with previous releases */
  57. *(.text_MFlashB512*) /* for compatibility with previous releases */
  58. *(.text.$Flash2*)
  59. *(.text.$MFlashB512*)
  60. *(.rodata.$Flash2*)
  61. *(.rodata.$MFlashB512*)
  62. } > MFlashB512
  63. /* MAIN TEXT SECTION */
  64. .text : ALIGN(4)
  65. {
  66. FILL(0xff)
  67. __vectors_start__ = ABSOLUTE(.) ;
  68. KEEP(*(.isr_vector))
  69. /* Global Section Table */
  70. . = ALIGN(4) ;
  71. __section_table_start = .;
  72. __data_section_table = .;
  73. LONG(LOADADDR(.data));
  74. LONG( ADDR(.data));
  75. LONG( SIZEOF(.data));
  76. LONG(LOADADDR(.data_RAM2));
  77. LONG( ADDR(.data_RAM2));
  78. LONG( SIZEOF(.data_RAM2));
  79. LONG(LOADADDR(.data_RAM3));
  80. LONG( ADDR(.data_RAM3));
  81. LONG( SIZEOF(.data_RAM3));
  82. LONG(LOADADDR(.data_RAM4));
  83. LONG( ADDR(.data_RAM4));
  84. LONG( SIZEOF(.data_RAM4));
  85. LONG(LOADADDR(.data_RAM5));
  86. LONG( ADDR(.data_RAM5));
  87. LONG( SIZEOF(.data_RAM5));
  88. __data_section_table_end = .;
  89. __bss_section_table = .;
  90. LONG( ADDR(.bss));
  91. LONG( SIZEOF(.bss));
  92. LONG( ADDR(.bss_RAM2));
  93. LONG( SIZEOF(.bss_RAM2));
  94. LONG( ADDR(.bss_RAM3));
  95. LONG( SIZEOF(.bss_RAM3));
  96. LONG( ADDR(.bss_RAM4));
  97. LONG( SIZEOF(.bss_RAM4));
  98. LONG( ADDR(.bss_RAM5));
  99. LONG( SIZEOF(.bss_RAM5));
  100. __bss_section_table_end = .;
  101. __section_table_end = . ;
  102. /* End of Global Section Table */
  103. *(.after_vectors*)
  104. } > MFlashA512
  105. .text : ALIGN(4)
  106. {
  107. *(.text*)
  108. *(.rodata .rodata.* .constdata .constdata.*)
  109. . = ALIGN(4);
  110. } > MFlashA512
  111. /*
  112. * for exception handling/unwind - some Newlib functions (in common
  113. * with C++ and STDC++) use this.
  114. */
  115. .ARM.extab : ALIGN(4)
  116. {
  117. *(.ARM.extab* .gnu.linkonce.armextab.*)
  118. } > MFlashA512
  119. __exidx_start = .;
  120. .ARM.exidx : ALIGN(4)
  121. {
  122. *(.ARM.exidx* .gnu.linkonce.armexidx.*)
  123. } > MFlashA512
  124. __exidx_end = .;
  125. _etext = .;
  126. /* DATA section for RamLoc40 */
  127. .data_RAM2 : ALIGN(4)
  128. {
  129. FILL(0xff)
  130. PROVIDE(__start_data_RAM2 = .) ;
  131. *(.ramfunc.$RAM2)
  132. *(.ramfunc.$RamLoc40)
  133. *(.data.$RAM2*)
  134. *(.data.$RamLoc40*)
  135. . = ALIGN(4) ;
  136. PROVIDE(__end_data_RAM2 = .) ;
  137. } > RamLoc40 AT>MFlashA512
  138. /* DATA section for RamAHB32 */
  139. .data_RAM3 : ALIGN(4)
  140. {
  141. FILL(0xff)
  142. PROVIDE(__start_data_RAM3 = .) ;
  143. *(.ramfunc.$RAM3)
  144. *(.ramfunc.$RamAHB32)
  145. *(.data.$RAM3*)
  146. *(.data.$RamAHB32*)
  147. . = ALIGN(4) ;
  148. PROVIDE(__end_data_RAM3 = .) ;
  149. } > RamAHB32 AT>MFlashA512
  150. /* DATA section for RamAHB16 */
  151. .data_RAM4 : ALIGN(4)
  152. {
  153. FILL(0xff)
  154. PROVIDE(__start_data_RAM4 = .) ;
  155. *(.ramfunc.$RAM4)
  156. *(.ramfunc.$RamAHB16)
  157. *(.data.$RAM4*)
  158. *(.data.$RamAHB16*)
  159. . = ALIGN(4) ;
  160. PROVIDE(__end_data_RAM4 = .) ;
  161. } > RamAHB16 AT>MFlashA512
  162. /* DATA section for RamAHB_ETB16 */
  163. .data_RAM5 : ALIGN(4)
  164. {
  165. FILL(0xff)
  166. PROVIDE(__start_data_RAM5 = .) ;
  167. *(.ramfunc.$RAM5)
  168. *(.ramfunc.$RamAHB_ETB16)
  169. *(.data.$RAM5*)
  170. *(.data.$RamAHB_ETB16*)
  171. . = ALIGN(4) ;
  172. PROVIDE(__end_data_RAM5 = .) ;
  173. } > RamAHB_ETB16 AT>MFlashA512
  174. /* MAIN DATA SECTION */
  175. .uninit_RESERVED : ALIGN(4)
  176. {
  177. KEEP(*(.bss.$RESERVED*))
  178. . = ALIGN(4) ;
  179. _end_uninit_RESERVED = .;
  180. } > RamLoc32
  181. /* Main DATA section (RamLoc32) */
  182. .data : ALIGN(4)
  183. {
  184. FILL(0xff)
  185. _data = . ;
  186. *(vtable)
  187. *(.ramfunc*)
  188. *(.data*)
  189. . = ALIGN(4) ;
  190. _edata = . ;
  191. } > RamLoc32 AT>MFlashA512
  192. /* BSS section for RamLoc40 */
  193. .bss_RAM2 : ALIGN(4)
  194. {
  195. PROVIDE(__start_bss_RAM2 = .) ;
  196. *(.bss.$RAM2*)
  197. *(.bss.$RamLoc40*)
  198. . = ALIGN (. != 0 ? 4 : 1) ; /* avoid empty segment */
  199. PROVIDE(__end_bss_RAM2 = .) ;
  200. } > RamLoc40
  201. /* BSS section for RamAHB32 */
  202. .bss_RAM3 : ALIGN(4)
  203. {
  204. PROVIDE(__start_bss_RAM3 = .) ;
  205. *(.bss.$RAM3*)
  206. *(.bss.$RamAHB32*)
  207. . = ALIGN (. != 0 ? 4 : 1) ; /* avoid empty segment */
  208. PROVIDE(__end_bss_RAM3 = .) ;
  209. } > RamAHB32
  210. /* BSS section for RamAHB16 */
  211. .bss_RAM4 : ALIGN(4)
  212. {
  213. PROVIDE(__start_bss_RAM4 = .) ;
  214. *(.bss.$RAM4*)
  215. *(.bss.$RamAHB16*)
  216. . = ALIGN (. != 0 ? 4 : 1) ; /* avoid empty segment */
  217. PROVIDE(__end_bss_RAM4 = .) ;
  218. } > RamAHB16
  219. /* BSS section for RamAHB_ETB16 */
  220. .bss_RAM5 : ALIGN(4)
  221. {
  222. PROVIDE(__start_bss_RAM5 = .) ;
  223. *(.bss.$RAM5*)
  224. *(.bss.$RamAHB_ETB16*)
  225. . = ALIGN (. != 0 ? 4 : 1) ; /* avoid empty segment */
  226. PROVIDE(__end_bss_RAM5 = .) ;
  227. } > RamAHB_ETB16
  228. /* MAIN BSS SECTION */
  229. .bss : ALIGN(4)
  230. {
  231. _bss = .;
  232. *(.bss*)
  233. *(COMMON)
  234. . = ALIGN(4) ;
  235. _ebss = .;
  236. PROVIDE(end = .);
  237. } > RamLoc32
  238. /* NOINIT section for RamLoc40 */
  239. .noinit_RAM2 (NOLOAD) : ALIGN(4)
  240. {
  241. *(.noinit.$RAM2*)
  242. *(.noinit.$RamLoc40*)
  243. . = ALIGN(4) ;
  244. } > RamLoc40
  245. /* NOINIT section for RamAHB32 */
  246. .noinit_RAM3 (NOLOAD) : ALIGN(4)
  247. {
  248. *(.noinit.$RAM3*)
  249. *(.noinit.$RamAHB32*)
  250. . = ALIGN(4) ;
  251. } > RamAHB32
  252. /* NOINIT section for RamAHB16 */
  253. .noinit_RAM4 (NOLOAD) : ALIGN(4)
  254. {
  255. *(.noinit.$RAM4*)
  256. *(.noinit.$RamAHB16*)
  257. . = ALIGN(4) ;
  258. } > RamAHB16
  259. /* NOINIT section for RamAHB_ETB16 */
  260. .noinit_RAM5 (NOLOAD) : ALIGN(4)
  261. {
  262. *(.noinit.$RAM5*)
  263. *(.noinit.$RamAHB_ETB16*)
  264. . = ALIGN(4) ;
  265. } > RamAHB_ETB16
  266. /* DEFAULT NOINIT SECTION */
  267. .noinit (NOLOAD): ALIGN(4)
  268. {
  269. _noinit = .;
  270. *(.noinit*)
  271. . = ALIGN(4) ;
  272. _end_noinit = .;
  273. } > RamLoc32
  274. PROVIDE(_pvHeapStart = DEFINED(__user_heap_base) ? __user_heap_base : .);
  275. PROVIDE(_vStackTop = DEFINED(__user_stack_top) ? __user_stack_top : __top_RamLoc32 - 0);
  276. /* ## Create checksum value (used in startup) ## */
  277. PROVIDE(__valid_user_code_checksum = 0 -
  278. (_vStackTop
  279. + (ResetISR + 1)
  280. + (NMI_Handler + 1)
  281. + (HardFault_Handler + 1)
  282. + (( DEFINED(MemManage_Handler) ? MemManage_Handler : 0 ) + 1) /* MemManage_Handler may not be defined */
  283. + (( DEFINED(BusFault_Handler) ? BusFault_Handler : 0 ) + 1) /* BusFault_Handler may not be defined */
  284. + (( DEFINED(UsageFault_Handler) ? UsageFault_Handler : 0 ) + 1) /* UsageFault_Handler may not be defined */
  285. ) );
  286. /* Provide basic symbols giving location and size of main text
  287. * block, including initial values of RW data sections. Note that
  288. * these will need extending to give a complete picture with
  289. * complex images (e.g multiple Flash banks).
  290. */
  291. _image_start = LOADADDR(.text);
  292. _image_end = LOADADDR(.data) + SIZEOF(.data);
  293. _image_size = _image_end - _image_start;
  294. }