LPC54608J512_flash.icf 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. /*
  2. ** ###################################################################
  3. ** Processors: LPC54608J512BD208
  4. ** LPC54608J512ET180
  5. **
  6. ** Compiler: IAR ANSI C/C++ Compiler for ARM
  7. ** Reference manual: LPC54S60x/LPC5460x User manual Rev.0.9 7 Nov 2016
  8. ** Version: rev. 1.1, 2016-11-25
  9. ** Build: b161227
  10. **
  11. ** Abstract:
  12. ** Linker file for the IAR ANSI C/C++ Compiler for ARM
  13. **
  14. ** Copyright (c) 2016 Freescale Semiconductor, Inc.
  15. ** Copyright 2016 - 2017 NXP
  16. ** Redistribution and use in source and binary forms, with or without modification,
  17. ** are permitted provided that the following conditions are met:
  18. **
  19. ** o Redistributions of source code must retain the above copyright notice, this list
  20. ** of conditions and the following disclaimer.
  21. **
  22. ** o Redistributions in binary form must reproduce the above copyright notice, this
  23. ** list of conditions and the following disclaimer in the documentation and/or
  24. ** other materials provided with the distribution.
  25. **
  26. ** o Neither the name of the copyright holder nor the names of its
  27. ** contributors may be used to endorse or promote products derived from this
  28. ** software without specific prior written permission.
  29. **
  30. ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  31. ** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  32. ** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  33. ** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
  34. ** ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  35. ** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  36. ** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  37. ** ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  38. ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  39. ** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  40. **
  41. ** http: www.nxp.com
  42. ** mail: support@nxp.com
  43. **
  44. ** ###################################################################
  45. */
  46. define symbol __ram_vector_table_size__ = isdefinedsymbol(__ram_vector_table__) ? 0x00000400 : 0;
  47. define symbol __ram_vector_table_offset__ = isdefinedsymbol(__ram_vector_table__) ? 0x000003FF : 0;
  48. define symbol m_interrupts_start = 0x00000000;
  49. define symbol m_interrupts_end = 0x000003FF;
  50. define symbol m_text_start = 0x00000400;
  51. define symbol m_text_end = 0x0007FFFF;
  52. define symbol m_interrupts_ram_start = 0x20000000;
  53. define symbol m_interrupts_ram_end = 0x20000000 + __ram_vector_table_offset__;
  54. define symbol m_data_start = m_interrupts_ram_start + __ram_vector_table_size__;
  55. define symbol m_data_end = 0x20027FFF;
  56. define symbol m_usb_sram_start = 0x40100000;
  57. define symbol m_usb_sram_end = 0x40101FFF;
  58. /* USB BDT size */
  59. define symbol usb_bdt_size = 0x0;
  60. /* Sizes */
  61. if (isdefinedsymbol(__stack_size__)) {
  62. define symbol __size_cstack__ = __stack_size__;
  63. } else {
  64. define symbol __size_cstack__ = 0x0400;
  65. }
  66. if (isdefinedsymbol(__heap_size__)) {
  67. define symbol __size_heap__ = __heap_size__;
  68. } else {
  69. define symbol __size_heap__ = 0x0400;
  70. }
  71. define exported symbol __VECTOR_TABLE = m_interrupts_start;
  72. define exported symbol __VECTOR_RAM = isdefinedsymbol(__ram_vector_table__) ? m_interrupts_ram_start : m_interrupts_start;
  73. define exported symbol __RAM_VECTOR_TABLE_SIZE = __ram_vector_table_size__;
  74. define memory mem with size = 4G;
  75. define region TEXT_region = mem:[from m_interrupts_start to m_interrupts_end]
  76. | mem:[from m_text_start to m_text_end];
  77. define region DATA_region = mem:[from m_data_start to m_data_end-__size_cstack__];
  78. define region CSTACK_region = mem:[from m_data_end-__size_cstack__+1 to m_data_end];
  79. define region m_interrupts_ram_region = mem:[from m_interrupts_ram_start to m_interrupts_ram_end];
  80. define block CSTACK with alignment = 8, size = __size_cstack__ { };
  81. define block HEAP with alignment = 8, size = __size_heap__ { };
  82. define block RW { readwrite };
  83. define block ZI { zi };
  84. define block RTT_INIT_FUNC with fixed order { readonly section .rti_fn* };
  85. /* regions for USB */
  86. define region USB_BDT_region = mem:[from m_usb_sram_start to m_usb_sram_start + usb_bdt_size - 1];
  87. define region USB_SRAM_region = mem:[from m_usb_sram_start + usb_bdt_size to m_usb_sram_end];
  88. place in USB_BDT_region { section m_usb_bdt };
  89. place in USB_SRAM_region { section m_usb_global };
  90. initialize by copy { readwrite, section .textrw };
  91. if (isdefinedsymbol(__USE_DLIB_PERTHREAD))
  92. {
  93. /* Required in a multi-threaded application */
  94. initialize by copy with packing = none { section __DLIB_PERTHREAD };
  95. }
  96. do not initialize { section .noinit, section m_usb_bdt, section m_usb_global };
  97. keep { section FSymTab };
  98. keep { section VSymTab };
  99. keep { section .rti_fn* };
  100. keep { section RTMSymTab };
  101. place at address mem: m_interrupts_start { readonly section .intvec };
  102. place in TEXT_region { readonly, block RTT_INIT_FUNC };
  103. place in DATA_region { block RW , block ZI, block CSTACK, last block HEAP};
  104. place in m_interrupts_ram_region { section m_interrupts_ram };