link.icf 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. /*
  2. ** ###################################################################
  3. ** Processors: LPC54114J256BD64_M4
  4. ** LPC54114J256UK49_M4
  5. **
  6. ** Compiler: IAR ANSI C/C++ Compiler for ARM
  7. ** Reference manual: LPC5411x User manual Rev. 1.1 25 May 2016
  8. ** Version: rev. 1.0, 2016-04-29
  9. ** Build: b161227
  10. **
  11. ** Abstract:
  12. ** Linker file for the IAR ANSI C/C++ Compiler for ARM
  13. **
  14. ** The Clear BSD License
  15. ** Copyright 2016 Freescale Semiconductor, Inc.
  16. ** Copyright 2016-2017 NXP
  17. ** All rights reserved.
  18. **
  19. ** Redistribution and use in source and binary forms, with or without modification,
  20. ** are permitted (subject to the limitations in the disclaimer below) provided
  21. ** that the following conditions are met:
  22. **
  23. ** 1. Redistributions of source code must retain the above copyright notice, this list
  24. ** of conditions and the following disclaimer.
  25. **
  26. ** 2. Redistributions in binary form must reproduce the above copyright notice, this
  27. ** list of conditions and the following disclaimer in the documentation and/or
  28. ** other materials provided with the distribution.
  29. **
  30. ** 3. Neither the name of the copyright holder nor the names of its
  31. ** contributors may be used to endorse or promote products derived from this
  32. ** software without specific prior written permission.
  33. **
  34. ** NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE.
  35. ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  36. ** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  37. ** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  38. ** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
  39. ** ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  40. ** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  41. ** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  42. ** ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  43. ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  44. ** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  45. **
  46. ** http: www.nxp.com
  47. ** mail: support@nxp.com
  48. **
  49. ** ###################################################################
  50. */
  51. define symbol m_interrupts_start = 0x00000000;
  52. define symbol m_interrupts_end = 0x000000DF;
  53. define symbol m_text_start = 0x000000E0;
  54. define symbol m_text_end = 0x0002FFFF;
  55. define symbol m_data_start = 0x20000000;
  56. define symbol m_data_end = 0x2000FFFF;
  57. if (isdefinedsymbol(__use_shmem__)) {
  58. define exported symbol rpmsg_sh_mem_start = 0x20026800;
  59. define exported symbol rpmsg_sh_mem_end = 0x20027FFF;
  60. }
  61. define symbol m_sramx_start = 0x04000000;
  62. define symbol m_sramx_end = 0x04007FFF;
  63. define exported symbol core1_image_start = 0x00030000;
  64. define exported symbol core1_image_end = 0x0003FFFF;
  65. define symbol __crp_start__ = 0x000002FC;
  66. define symbol __crp_end__ = 0x000002FF;
  67. define symbol __ram_iap_start__ = 0x2000FFE0;
  68. define symbol __ram_iap_end__ = 0x2000FFFF;
  69. /* Sizes */
  70. if (isdefinedsymbol(__stack_size__)) {
  71. define symbol __size_cstack__ = __stack_size__;
  72. } else {
  73. define symbol __size_cstack__ = 0x0400;
  74. }
  75. if (isdefinedsymbol(__heap_size__)) {
  76. define symbol __size_heap__ = __heap_size__;
  77. } else {
  78. define symbol __size_heap__ = 0x0800;
  79. }
  80. define exported symbol __RTT_HEAP_END = m_data_end;
  81. define memory mem with size = 4G;
  82. define region TEXT_region = mem:[from m_interrupts_start to m_interrupts_end]
  83. | mem:[from m_text_start to m_text_end]
  84. - mem:[from __crp_start__ to __crp_end__];
  85. define region DATA_region = mem:[from m_data_start to m_data_end]
  86. - mem:[from __ram_iap_start__-__size_cstack__ to __ram_iap_end__];
  87. define region CSTACK_region = mem:[from __ram_iap_start__-__size_cstack__ to __ram_iap_start__-1];
  88. define region SRAMX_region = mem:[from m_sramx_start to m_sramx_end];
  89. define region CRP_region = mem:[from __crp_start__ to __crp_end__];
  90. if (isdefinedsymbol(__use_shmem__)) {
  91. define region rpmsg_sh_mem_region = mem:[from rpmsg_sh_mem_start to rpmsg_sh_mem_end];
  92. }
  93. define block CSTACK with alignment = 8, size = __size_cstack__ { };
  94. define block HEAP with alignment = 8, size = __size_heap__ { };
  95. define block RW { readwrite };
  96. define block ZI { zi };
  97. define region core1_region = mem:[from core1_image_start to core1_image_end];
  98. define block SEC_CORE_IMAGE_WBLOCK { section __sec_core };
  99. initialize by copy { readwrite };
  100. if (isdefinedsymbol(__USE_DLIB_PERTHREAD))
  101. {
  102. // Required in a multi-threaded application
  103. initialize by copy with packing = none { section __DLIB_PERTHREAD };
  104. }
  105. do not initialize { section .noinit };
  106. if (isdefinedsymbol(__use_shmem__)) {
  107. do not initialize { section rpmsg_sh_mem_section };
  108. }
  109. place at address mem: m_interrupts_start { readonly section .intvec };
  110. place in TEXT_region { readonly };
  111. place in DATA_region { block RW };
  112. place in DATA_region { block ZI };
  113. place in DATA_region { last block HEAP };
  114. place in SRAMX_region { section sramx };
  115. place in CSTACK_region { block CSTACK };
  116. place in CRP_region { section .crp };
  117. if (isdefinedsymbol(__use_shmem__)) {
  118. place in rpmsg_sh_mem_region { section rpmsg_sh_mem_section };
  119. }
  120. place in core1_region { block SEC_CORE_IMAGE_WBLOCK };