link.icf 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247
  1. /*******************************************************************************
  2. * \file cy8c6xxa_cm4_dual.icf
  3. * \version 2.91
  4. *
  5. * Linker file for the IAR compiler.
  6. *
  7. * The main purpose of the linker script is to describe how the sections in the
  8. * input files should be mapped into the output file, and to control the memory
  9. * layout of the output file.
  10. *
  11. * \note The entry point is fixed and starts at 0x10000000. The valid application
  12. * image should be placed there.
  13. *
  14. * \note The linker files included with the PDL template projects must be generic
  15. * and handle all common use cases. Your project may not use every section
  16. * defined in the linker files. In that case you may see warnings during the
  17. * build process. In your project, you can simply comment out or remove the
  18. * relevant code in the linker file.
  19. *
  20. ********************************************************************************
  21. * \copyright
  22. * Copyright 2016-2021 Cypress Semiconductor Corporation
  23. * SPDX-License-Identifier: Apache-2.0
  24. *
  25. * Licensed under the Apache License, Version 2.0 (the "License");
  26. * you may not use this file except in compliance with the License.
  27. * You may obtain a copy of the License at
  28. *
  29. * http://www.apache.org/licenses/LICENSE-2.0
  30. *
  31. * Unless required by applicable law or agreed to in writing, software
  32. * distributed under the License is distributed on an "AS IS" BASIS,
  33. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  34. * See the License for the specific language governing permissions and
  35. * limitations under the License.
  36. *******************************************************************************/
  37. /*###ICF### Section handled by ICF editor, don't touch! ****/
  38. /*-Editor annotation file-*/
  39. /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_4.xml" */
  40. /*-Specials-*/
  41. define symbol __ICFEDIT_intvec_start__ = 0x00000000;
  42. /* The symbols below define the location and size of blocks of memory in the target.
  43. * Use these symbols to specify the memory regions available for allocation.
  44. */
  45. /* The following symbols control RAM and flash memory allocation for the CM4 core.
  46. * You can change the memory allocation by editing RAM and Flash symbols.
  47. * Note that 2 KB of RAM (at the end of the SRAM) are reserved for system use.
  48. * Using this memory region for other purposes will lead to unexpected behavior.
  49. * Your changes must be aligned with the corresponding symbols for CM0+ core in 'xx_cm0plus.icf',
  50. * where 'xx' is the device group; for example, 'cy8c6xx7_cm0plus.icf'.
  51. */
  52. /* RAM */
  53. define symbol __ICFEDIT_region_IRAM1_start__ = 0x08002000;
  54. define symbol __ICFEDIT_region_IRAM1_end__ = 0x080FF7FF;
  55. /* Flash */
  56. define symbol __ICFEDIT_region_IROM1_start__ = 0x10000000;
  57. define symbol __ICFEDIT_region_IROM1_end__ = 0x101FFFFF;
  58. /* The following symbols define a 32K flash region used for EEPROM emulation.
  59. * This region can also be used as the general purpose flash.
  60. * You can assign sections to this memory region for only one of the cores.
  61. * Note some middleware (e.g. BLE, Emulated EEPROM) can place their data into this memory region.
  62. * Therefore, repurposing this memory region will prevent such middleware from operation.
  63. */
  64. define symbol __ICFEDIT_region_IROM2_start__ = 0x14000000;
  65. define symbol __ICFEDIT_region_IROM2_end__ = 0x14007FFF;
  66. /* The following symbols define device specific memory regions and must not be changed. */
  67. /* Supervisory FLASH - User Data */
  68. define symbol __ICFEDIT_region_IROM3_start__ = 0x16000800;
  69. define symbol __ICFEDIT_region_IROM3_end__ = 0x16000FFF;
  70. /* Supervisory FLASH - Normal Access Restrictions (NAR) */
  71. define symbol __ICFEDIT_region_IROM4_start__ = 0x16001A00;
  72. define symbol __ICFEDIT_region_IROM4_end__ = 0x16001BFF;
  73. /* Supervisory FLASH - Public Key */
  74. define symbol __ICFEDIT_region_IROM5_start__ = 0x16005A00;
  75. define symbol __ICFEDIT_region_IROM5_end__ = 0x160065FF;
  76. /* Supervisory FLASH - Table of Content # 2 */
  77. define symbol __ICFEDIT_region_IROM6_start__ = 0x16007C00;
  78. define symbol __ICFEDIT_region_IROM6_end__ = 0x16007DFF;
  79. /* Supervisory FLASH - Table of Content # 2 Copy */
  80. define symbol __ICFEDIT_region_IROM7_start__ = 0x16007E00;
  81. define symbol __ICFEDIT_region_IROM7_end__ = 0x16007FFF;
  82. /* eFuse */
  83. define symbol __ICFEDIT_region_IROM8_start__ = 0x90700000;
  84. define symbol __ICFEDIT_region_IROM8_end__ = 0x907FFFFF;
  85. /* XIP */
  86. define symbol __ICFEDIT_region_EROM1_start__ = 0x18000000;
  87. define symbol __ICFEDIT_region_EROM1_end__ = 0x1FFFFFFF;
  88. define symbol __ICFEDIT_region_EROM2_start__ = 0x0;
  89. define symbol __ICFEDIT_region_EROM2_end__ = 0x0;
  90. define symbol __ICFEDIT_region_EROM3_start__ = 0x0;
  91. define symbol __ICFEDIT_region_EROM3_end__ = 0x0;
  92. define symbol __ICFEDIT_region_IRAM2_start__ = 0x0;
  93. define symbol __ICFEDIT_region_IRAM2_end__ = 0x0;
  94. define symbol __ICFEDIT_region_ERAM1_start__ = 0x0;
  95. define symbol __ICFEDIT_region_ERAM1_end__ = 0x0;
  96. define symbol __ICFEDIT_region_ERAM2_start__ = 0x0;
  97. define symbol __ICFEDIT_region_ERAM2_end__ = 0x0;
  98. define symbol __ICFEDIT_region_ERAM3_start__ = 0x0;
  99. define symbol __ICFEDIT_region_ERAM3_end__ = 0x0;
  100. /*-Sizes-*/
  101. if (!isdefinedsymbol(__STACK_SIZE)) {
  102. define symbol __ICFEDIT_size_cstack__ = 0x1000;
  103. } else {
  104. define symbol __ICFEDIT_size_cstack__ = __STACK_SIZE;
  105. }
  106. define symbol __ICFEDIT_size_proc_stack__ = 0x0;
  107. /* Defines the minimum heap size. The actual heap size will be expanded to the end of the stack region */
  108. if (!isdefinedsymbol(__HEAP_SIZE)) {
  109. define symbol __ICFEDIT_size_heap__ = 0x0400;
  110. } else {
  111. define symbol __ICFEDIT_size_heap__ = __HEAP_SIZE;
  112. }
  113. /**** End of ICF editor section. ###ICF###*/
  114. /* By default, the COMPONENT_CM0P_SLEEP prebuilt image is used for the CM0p core.
  115. * More about CM0+ prebuilt images, see here:
  116. * https://github.com/cypresssemiconductorco/psoc6cm0p
  117. */
  118. /* The size of the Cortex-M0+ application image */
  119. define symbol FLASH_CM0P_SIZE = 0x2000;
  120. define memory mem with size = 4G;
  121. define region IROM1_region = mem:[from __ICFEDIT_region_IROM1_start__ to __ICFEDIT_region_IROM1_end__];
  122. define region IROM2_region = mem:[from __ICFEDIT_region_IROM2_start__ to __ICFEDIT_region_IROM2_end__];
  123. define region IROM3_region = mem:[from __ICFEDIT_region_IROM3_start__ to __ICFEDIT_region_IROM3_end__];
  124. define region IROM4_region = mem:[from __ICFEDIT_region_IROM4_start__ to __ICFEDIT_region_IROM4_end__];
  125. define region IROM5_region = mem:[from __ICFEDIT_region_IROM5_start__ to __ICFEDIT_region_IROM5_end__];
  126. define region IROM6_region = mem:[from __ICFEDIT_region_IROM6_start__ to __ICFEDIT_region_IROM6_end__];
  127. define region IROM7_region = mem:[from __ICFEDIT_region_IROM7_start__ to __ICFEDIT_region_IROM7_end__];
  128. define region IROM8_region = mem:[from __ICFEDIT_region_IROM8_start__ to __ICFEDIT_region_IROM8_end__];
  129. define region EROM1_region = mem:[from __ICFEDIT_region_EROM1_start__ to __ICFEDIT_region_EROM1_end__];
  130. define region IRAM1_region = mem:[from __ICFEDIT_region_IRAM1_start__ to __ICFEDIT_region_IRAM1_end__];
  131. define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
  132. define block PROC_STACK with alignment = 8, size = __ICFEDIT_size_proc_stack__ { };
  133. define block HEAP with expanding size, alignment = 8, minimum size = __ICFEDIT_size_heap__ { };
  134. define block HSTACK {block HEAP, block PROC_STACK, last block CSTACK};
  135. define block CM0P_RO with size = FLASH_CM0P_SIZE { readonly section .cy_m0p_image };
  136. define block RO {first section .intvec, readonly};
  137. define block cy_xip { section .cy_xip };
  138. /*-Initializations-*/
  139. initialize by copy { readwrite };
  140. do not initialize { section .noinit, section .intvec_ram };
  141. /*-Placement-*/
  142. /* Flash - Cortex-M0+ application image */
  143. place at start of IROM1_region { block CM0P_RO };
  144. /* Flash - Cortex-M4 application */
  145. place in IROM1_region { block RO };
  146. /* Used for the digital signature of the secure application and the Bootloader SDK application. */
  147. ".cy_app_signature" : place at address (__ICFEDIT_region_IROM1_end__ - 0x200) { section .cy_app_signature };
  148. /* Emulated EEPROM Flash area */
  149. ".cy_em_eeprom" : place at start of IROM2_region { section .cy_em_eeprom };
  150. /* Supervisory Flash - User Data */
  151. ".cy_sflash_user_data" : place at start of IROM3_region { section .cy_sflash_user_data };
  152. /* Supervisory Flash - NAR */
  153. ".cy_sflash_nar" : place at start of IROM4_region { section .cy_sflash_nar };
  154. /* Supervisory Flash - Public Key */
  155. ".cy_sflash_public_key" : place at start of IROM5_region { section .cy_sflash_public_key };
  156. /* Supervisory Flash - TOC2 */
  157. ".cy_toc_part2" : place at start of IROM6_region { section .cy_toc_part2 };
  158. /* Supervisory Flash - RTOC2 */
  159. ".cy_rtoc_part2" : place at start of IROM7_region { section .cy_rtoc_part2 };
  160. /* eFuse */
  161. ".cy_efuse" : place at start of IROM8_region { section .cy_efuse };
  162. /* Execute in Place (XIP). See the smif driver documentation for details. */
  163. "cy_xip" : place at start of EROM1_region { block cy_xip };
  164. /* RAM */
  165. place at start of IRAM1_region { readwrite section .intvec_ram};
  166. place in IRAM1_region { readwrite };
  167. place at end of IRAM1_region { block HSTACK };
  168. /* These sections are used for additional metadata (silicon revision, Silicon/JTAG ID, etc.) storage. */
  169. ".cymeta" : place at address mem : 0x90500000 { readonly section .cymeta };
  170. keep { section .cy_m0p_image,
  171. section .cy_app_signature,
  172. section .cy_em_eeprom,
  173. section .cy_sflash_user_data,
  174. section .cy_sflash_nar,
  175. section .cy_sflash_public_key,
  176. section .cy_toc_part2,
  177. section .cy_rtoc_part2,
  178. section .cy_efuse,
  179. section .cy_xip,
  180. section .cymeta,
  181. };
  182. /* The following symbols used by the cymcuelftool. */
  183. /* Flash */
  184. define exported symbol __cy_memory_0_start = 0x10000000;
  185. define exported symbol __cy_memory_0_length = 0x00200000;
  186. define exported symbol __cy_memory_0_row_size = 0x200;
  187. /* Emulated EEPROM Flash area */
  188. define exported symbol __cy_memory_1_start = 0x14000000;
  189. define exported symbol __cy_memory_1_length = 0x8000;
  190. define exported symbol __cy_memory_1_row_size = 0x200;
  191. /* Supervisory Flash */
  192. define exported symbol __cy_memory_2_start = 0x16000000;
  193. define exported symbol __cy_memory_2_length = 0x8000;
  194. define exported symbol __cy_memory_2_row_size = 0x200;
  195. /* XIP */
  196. define exported symbol __cy_memory_3_start = 0x18000000;
  197. define exported symbol __cy_memory_3_length = 0x08000000;
  198. define exported symbol __cy_memory_3_row_size = 0x200;
  199. /* eFuse */
  200. define exported symbol __cy_memory_4_start = 0x90700000;
  201. define exported symbol __cy_memory_4_length = 0x100000;
  202. define exported symbol __cy_memory_4_row_size = 1;
  203. /* EOF */