link.sct 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  1. #! armclang -E --target=arm-arm-none-eabi -x c -mcpu=cortex-m4
  2. ; The first line specifies a preprocessor command that the linker invokes
  3. ; to pass a scatter file through a C preprocessor.
  4. ;*******************************************************************************
  5. ;* \file cy8c6xxa_cm4_dual.sct
  6. ;* \version 2.91
  7. ;*
  8. ;* Linker file for the ARMCC.
  9. ;*
  10. ;* The main purpose of the linker script is to describe how the sections in the
  11. ;* input files should be mapped into the output file, and to control the memory
  12. ;* layout of the output file.
  13. ;*
  14. ;* \note The entry point location is fixed and starts at 0x10000000. The valid
  15. ;* application image should be placed there.
  16. ;*
  17. ;* \note The linker files included with the PDL template projects must be
  18. ;* generic and handle all common use cases. Your project may not use every
  19. ;* section defined in the linker files. In that case you may see the warnings
  20. ;* during the build process: L6314W (no section matches pattern) and/or L6329W
  21. ;* (pattern only matches removed unused sections). In your project, you can
  22. ;* suppress the warning by passing the "--diag_suppress=L6314W,L6329W" option to
  23. ;* the linker, simply comment out or remove the relevant code in the linker
  24. ;* file.
  25. ;*
  26. ;*******************************************************************************
  27. ;* \copyright
  28. ;* Copyright 2016-2021 Cypress Semiconductor Corporation
  29. ;* SPDX-License-Identifier: Apache-2.0
  30. ;*
  31. ;* Licensed under the Apache License, Version 2.0 (the "License");
  32. ;* you may not use this file except in compliance with the License.
  33. ;* You may obtain a copy of the License at
  34. ;*
  35. ;* http://www.apache.org/licenses/LICENSE-2.0
  36. ;*
  37. ;* Unless required by applicable law or agreed to in writing, software
  38. ;* distributed under the License is distributed on an "AS IS" BASIS,
  39. ;* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  40. ;* See the License for the specific language governing permissions and
  41. ;* limitations under the License.
  42. ;******************************************************************************/
  43. ; The defines below describe the location and size of blocks of memory in the target.
  44. ; Use these defines to specify the memory regions available for allocation.
  45. ; The following defines control RAM and flash memory allocation for the CM4 core.
  46. ; You can change the memory allocation by editing RAM and Flash defines.
  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 defines for CM0+ core in 'xx_cm0plus.scat',
  50. ; where 'xx' is the device group; for example, 'cy8c6xx7_cm0plus.scat'.
  51. ; RAM
  52. #define RAM_START 0x08002000
  53. #define RAM_SIZE 0x000FD800
  54. ; Flash
  55. #define FLASH_START 0x10000000
  56. #define FLASH_SIZE 0x00200000
  57. ; The size of the stack section at the end of CM4 SRAM
  58. #define STACK_SIZE 0x00001000
  59. ; By default, the COMPONENT_CM0P_SLEEP prebuilt image is used for the CM0p core.
  60. ; More about CM0+ prebuilt images, see here:
  61. ; https://github.com/cypresssemiconductorco/psoc6cm0p
  62. ; The size of the Cortex-M0+ application flash image
  63. #define FLASH_CM0P_SIZE 0x2000
  64. ; The following defines describe a 32K flash region used for EEPROM emulation.
  65. ; This region can also be used as the general purpose flash.
  66. ; You can assign sections to this memory region for only one of the cores.
  67. ; Note some middleware (e.g. BLE, Emulated EEPROM) can place their data into this memory region.
  68. ; Therefore, repurposing this memory region will prevent such middleware from operation.
  69. #define EM_EEPROM_START 0x14000000
  70. #define EM_EEPROM_SIZE 0x8000
  71. ; The following defines describe device specific memory regions and must not be changed.
  72. ; Supervisory flash: User data
  73. #define SFLASH_USER_DATA_START 0x16000800
  74. #define SFLASH_USER_DATA_SIZE 0x00000800
  75. ; Supervisory flash: Normal Access Restrictions (NAR)
  76. #define SFLASH_NAR_START 0x16001A00
  77. #define SFLASH_NAR_SIZE 0x00000200
  78. ; Supervisory flash: Public Key
  79. #define SFLASH_PUBLIC_KEY_START 0x16005A00
  80. #define SFLASH_PUBLIC_KEY_SIZE 0x00000C00
  81. ; Supervisory flash: Table of Content # 2
  82. #define SFLASH_TOC_2_START 0x16007C00
  83. #define SFLASH_TOC_2_SIZE 0x00000200
  84. ; Supervisory flash: Table of Content # 2 Copy
  85. #define SFLASH_RTOC_2_START 0x16007E00
  86. #define SFLASH_RTOC_2_SIZE 0x00000200
  87. ; External memory
  88. #define XIP_START 0x18000000
  89. #define XIP_SIZE 0x08000000
  90. ; eFuse
  91. #define EFUSE_START 0x90700000
  92. #define EFUSE_SIZE 0x100000
  93. ; Cortex-M0+ application flash image area
  94. LR_IROM FLASH_START FLASH_CM0P_SIZE
  95. {
  96. .cy_m0p_image +0 FLASH_CM0P_SIZE
  97. {
  98. * (.cy_m0p_image)
  99. }
  100. }
  101. ; Cortex-M4 application flash area
  102. LR_IROM1 (FLASH_START + FLASH_CM0P_SIZE) (FLASH_SIZE - FLASH_CM0P_SIZE)
  103. {
  104. ER_FLASH_VECTORS +0
  105. {
  106. * (RESET, +FIRST)
  107. }
  108. ER_FLASH_CODE +0 FIXED
  109. {
  110. * (InRoot$$Sections)
  111. * (+RO)
  112. }
  113. ER_RAM_VECTORS RAM_START UNINIT
  114. {
  115. * (RESET_RAM, +FIRST)
  116. }
  117. RW_RAM_DATA +0
  118. {
  119. * (.cy_ramfunc)
  120. * (+RW, +ZI)
  121. }
  122. ; Place variables in the section that should not be initialized during the
  123. ; device startup.
  124. RW_IRAM1 +0 UNINIT
  125. {
  126. * (.noinit)
  127. }
  128. ; Application heap area (HEAP)
  129. ARM_LIB_HEAP +0 EMPTY ((RAM_START+RAM_SIZE)-AlignExpr(ImageLimit(RW_IRAM1), 8)-STACK_SIZE)
  130. {
  131. }
  132. ; Stack region growing down
  133. ARM_LIB_STACK (RAM_START+RAM_SIZE) EMPTY -STACK_SIZE
  134. {
  135. }
  136. ; Used for the digital signature of the secure application and the
  137. ; Bootloader SDK application. The size of the section depends on the required
  138. ; data size.
  139. .cy_app_signature (FLASH_START + FLASH_SIZE - 256) 256
  140. {
  141. * (.cy_app_signature)
  142. }
  143. }
  144. ; Emulated EEPROM Flash area
  145. LR_EM_EEPROM EM_EEPROM_START EM_EEPROM_SIZE
  146. {
  147. .cy_em_eeprom +0
  148. {
  149. * (.cy_em_eeprom)
  150. }
  151. }
  152. ; Supervisory flash: User data
  153. LR_SFLASH_USER_DATA SFLASH_USER_DATA_START SFLASH_USER_DATA_SIZE
  154. {
  155. .cy_sflash_user_data +0
  156. {
  157. * (.cy_sflash_user_data)
  158. }
  159. }
  160. ; Supervisory flash: Normal Access Restrictions (NAR)
  161. LR_SFLASH_NAR SFLASH_NAR_START SFLASH_NAR_SIZE
  162. {
  163. .cy_sflash_nar +0
  164. {
  165. * (.cy_sflash_nar)
  166. }
  167. }
  168. ; Supervisory flash: Public Key
  169. LR_SFLASH_PUBLIC_KEY SFLASH_PUBLIC_KEY_START SFLASH_PUBLIC_KEY_SIZE
  170. {
  171. .cy_sflash_public_key +0
  172. {
  173. * (.cy_sflash_public_key)
  174. }
  175. }
  176. ; Supervisory flash: Table of Content # 2
  177. LR_SFLASH_TOC_2 SFLASH_TOC_2_START SFLASH_TOC_2_SIZE
  178. {
  179. .cy_toc_part2 +0
  180. {
  181. * (.cy_toc_part2)
  182. }
  183. }
  184. ; Supervisory flash: Table of Content # 2 Copy
  185. LR_SFLASH_RTOC_2 SFLASH_RTOC_2_START SFLASH_RTOC_2_SIZE
  186. {
  187. .cy_rtoc_part2 +0
  188. {
  189. * (.cy_rtoc_part2)
  190. }
  191. }
  192. ; Places the code in the Execute in Place (XIP) section. See the smif driver documentation for details.
  193. LR_EROM XIP_START XIP_SIZE
  194. {
  195. cy_xip +0
  196. {
  197. * (.cy_xip)
  198. }
  199. }
  200. ; eFuse
  201. LR_EFUSE EFUSE_START EFUSE_SIZE
  202. {
  203. .cy_efuse +0
  204. {
  205. * (.cy_efuse)
  206. }
  207. }
  208. ; The section is used for additional metadata (silicon revision, Silicon/JTAG ID, etc.) storage.
  209. CYMETA 0x90500000
  210. {
  211. .cymeta +0 { * (.cymeta) }
  212. }
  213. /* The following symbols used by the cymcuelftool. */
  214. /* Flash */
  215. #define __cy_memory_0_start 0x10000000
  216. #define __cy_memory_0_length 0x00200000
  217. #define __cy_memory_0_row_size 0x200
  218. /* Emulated EEPROM Flash area */
  219. #define __cy_memory_1_start 0x14000000
  220. #define __cy_memory_1_length 0x8000
  221. #define __cy_memory_1_row_size 0x200
  222. /* Supervisory Flash */
  223. #define __cy_memory_2_start 0x16000000
  224. #define __cy_memory_2_length 0x8000
  225. #define __cy_memory_2_row_size 0x200
  226. /* XIP */
  227. #define __cy_memory_3_start 0x18000000
  228. #define __cy_memory_3_length 0x08000000
  229. #define __cy_memory_3_row_size 0x200
  230. /* eFuse */
  231. #define __cy_memory_4_start 0x90700000
  232. #define __cy_memory_4_length 0x100000
  233. #define __cy_memory_4_row_size 1
  234. /* [] END OF FILE */