|
| 1 | +#! armclang -E --target=arm-arm-none-eabi -x c -mcpu=cortex-m0 |
| 2 | +; The first line specifies a preprocessor command that the linker invokes |
| 3 | +; to pass a scatter file through a C preprocessor. |
| 4 | + |
| 5 | +;******************************************************************************* |
| 6 | +;* \file cy8c6xx7_cm0plus.sct |
| 7 | +;* \version 2.70 |
| 8 | +;* |
| 9 | +;* Linker file for the ARMCC. |
| 10 | +;* |
| 11 | +;* The main purpose of the linker script is to describe how the sections in the |
| 12 | +;* input files should be mapped into the output file, and to control the memory |
| 13 | +;* layout of the output file. |
| 14 | +;* |
| 15 | +;* \note The entry point location is fixed and starts at 0x10000000. The valid |
| 16 | +;* application image should be placed there. |
| 17 | +;* |
| 18 | +;* \note The linker files included with the PDL template projects must be |
| 19 | +;* generic and handle all common use cases. Your project may not use every |
| 20 | +;* section defined in the linker files. In that case you may see the warnings |
| 21 | +;* during the build process: L6314W (no section matches pattern) and/or L6329W |
| 22 | +;* (pattern only matches removed unused sections). In your project, you can |
| 23 | +;* suppress the warning by passing the "--diag_suppress=L6314W,L6329W" option to |
| 24 | +;* the linker, simply comment out or remove the relevant code in the linker |
| 25 | +;* file. |
| 26 | +;* |
| 27 | +;******************************************************************************* |
| 28 | +;* \copyright |
| 29 | +;* Copyright 2016-2019 Cypress Semiconductor Corporation |
| 30 | +;* SPDX-License-Identifier: Apache-2.0 |
| 31 | +;* |
| 32 | +;* Licensed under the Apache License, Version 2.0 (the "License"); |
| 33 | +;* you may not use this file except in compliance with the License. |
| 34 | +;* You may obtain a copy of the License at |
| 35 | +;* |
| 36 | +;* http://www.apache.org/licenses/LICENSE-2.0 |
| 37 | +;* |
| 38 | +;* Unless required by applicable law or agreed to in writing, software |
| 39 | +;* distributed under the License is distributed on an "AS IS" BASIS, |
| 40 | +;* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 41 | +;* See the License for the specific language governing permissions and |
| 42 | +;* limitations under the License. |
| 43 | +;******************************************************************************/ |
| 44 | + |
| 45 | +#if !defined(MBED_ROM_START) |
| 46 | + #define MBED_ROM_START 0x10000000 |
| 47 | +#endif |
| 48 | + |
| 49 | +;* MBED_APP_START is being used by the bootloader build script and |
| 50 | +;* will be calculate by the system. Without bootloader the MBED_APP_START |
| 51 | +;* is equal to MBED_ROM_START |
| 52 | +;* |
| 53 | +#if !defined(MBED_APP_START) |
| 54 | + #define MBED_APP_START MBED_ROM_START |
| 55 | +#endif |
| 56 | + |
| 57 | +#if !defined(MBED_ROM_SIZE) |
| 58 | + #define MBED_ROM_SIZE 0x80000 |
| 59 | +#endif |
| 60 | + |
| 61 | +;* MBED_APP_SIZE is being used by the bootloader build script and |
| 62 | +;* will be calculate by the system. Without bootloader the MBED_APP_SIZE |
| 63 | +;* is equal to MBED_ROM_SIZE |
| 64 | +;* |
| 65 | +#if !defined(MBED_APP_SIZE) |
| 66 | + #define MBED_APP_SIZE MBED_ROM_SIZE |
| 67 | +#endif |
| 68 | + |
| 69 | +#if !defined(MBED_RAM_START) |
| 70 | + #define MBED_RAM_START 0x08000000 |
| 71 | +#endif |
| 72 | + |
| 73 | +#if !defined(MBED_RAM_SIZE) |
| 74 | + #define MBED_RAM_SIZE 0x00010000 |
| 75 | +#endif |
| 76 | + |
| 77 | +#if !defined(MBED_PUBLIC_RAM_SIZE) |
| 78 | + #define MBED_PUBLIC_RAM_SIZE 0x200 |
| 79 | +#endif |
| 80 | + |
| 81 | +; The size of the stack section at the end of CM0+ SRAM |
| 82 | +#if !defined(MBED_BOOT_STACK_SIZE) |
| 83 | + #define MBED_BOOT_STACK_SIZE 0x400 |
| 84 | +#endif |
| 85 | + |
| 86 | +#define STACK_SIZE MBED_BOOT_STACK_SIZE |
| 87 | + |
| 88 | +#if !defined(MBED_PUBLIC_RAM_START) |
| 89 | + #define MBED_PUBLIC_RAM_START (MBED_RAM_START + MBED_RAM_SIZE - STACK_SIZE - MBED_PUBLIC_RAM_SIZE) |
| 90 | +#endif |
| 91 | + |
| 92 | +; The defines below describe the location and size of blocks of memory in the target. |
| 93 | +; Use these defines to specify the memory regions available for allocation. |
| 94 | + |
| 95 | +; The following defines control RAM and flash memory allocation for the CM0+ core. |
| 96 | +; You can change the memory allocation by editing the RAM and Flash defines. |
| 97 | +; Note that 2 KB of RAM (at the end of the SRAM) are reserved for system use. |
| 98 | +; Using this memory region for other purposes will lead to unexpected behavior. |
| 99 | +; Your changes must be aligned with the corresponding defines for the CM4 core in 'xx_cm4_dual.scat', |
| 100 | +; where 'xx' is the device group; for example, 'cy8c6xx7_cm4_dual.scat'. |
| 101 | +; RAM |
| 102 | +#define RAM_START MBED_RAM_START |
| 103 | +#define RAM_SIZE MBED_RAM_SIZE |
| 104 | +; Public RAM |
| 105 | +#define PUBLIC_RAM_START MBED_PUBLIC_RAM_START |
| 106 | +#define PUBLIC_RAM_SIZE MBED_PUBLIC_RAM_SIZE |
| 107 | +; Flash |
| 108 | +#define FLASH_START MBED_APP_START |
| 109 | +#define FLASH_SIZE MBED_APP_SIZE |
| 110 | + |
| 111 | +; The following defines describe a 32K flash region used for EEPROM emulation. |
| 112 | +; This region can also be used as the general purpose flash. |
| 113 | +; You can assign sections to this memory region for only one of the cores. |
| 114 | +; Note some middleware (e.g. BLE, Emulated EEPROM) can place their data into this memory region. |
| 115 | +; Therefore, repurposing this memory region will prevent such middleware from operation. |
| 116 | +#define EM_EEPROM_START 0x14000000 |
| 117 | +#define EM_EEPROM_SIZE 0x8000 |
| 118 | + |
| 119 | +; The following defines describe device specific memory regions and must not be changed. |
| 120 | +; Supervisory flash: User data |
| 121 | +#define SFLASH_USER_DATA_START 0x16000800 |
| 122 | +#define SFLASH_USER_DATA_SIZE 0x00000800 |
| 123 | + |
| 124 | +; Supervisory flash: Normal Access Restrictions (NAR) |
| 125 | +#define SFLASH_NAR_START 0x16001A00 |
| 126 | +#define SFLASH_NAR_SIZE 0x00000200 |
| 127 | + |
| 128 | +; Supervisory flash: Public Key |
| 129 | +#define SFLASH_PUBLIC_KEY_START 0x16005A00 |
| 130 | +#define SFLASH_PUBLIC_KEY_SIZE 0x00000C00 |
| 131 | + |
| 132 | +; Supervisory flash: Table of Content # 2 |
| 133 | +#define SFLASH_TOC_2_START 0x16007C00 |
| 134 | +#define SFLASH_TOC_2_SIZE 0x00000200 |
| 135 | + |
| 136 | +; Supervisory flash: Table of Content # 2 Copy |
| 137 | +#define SFLASH_RTOC_2_START 0x16007E00 |
| 138 | +#define SFLASH_RTOC_2_SIZE 0x00000200 |
| 139 | + |
| 140 | +; External memory |
| 141 | +#define XIP_START 0x18000000 |
| 142 | +#define XIP_SIZE 0x08000000 |
| 143 | + |
| 144 | +; eFuse |
| 145 | +#define EFUSE_START 0x90700000 |
| 146 | +#define EFUSE_SIZE 0x100000 |
| 147 | + |
| 148 | + |
| 149 | +; Cortex-M0+ application flash area |
| 150 | +LR_IROM1 FLASH_START (FLASH_SIZE - 0x8000) |
| 151 | +{ |
| 152 | + .cy_app_header +0 |
| 153 | + { |
| 154 | + * (.cy_app_header) |
| 155 | + } |
| 156 | + |
| 157 | + ER_FLASH_VECTORS +0 |
| 158 | + { |
| 159 | + * (RESET, +FIRST) |
| 160 | + } |
| 161 | + |
| 162 | + ER_FLASH_CODE +0 FIXED |
| 163 | + { |
| 164 | + * (InRoot$$Sections) |
| 165 | + * (+RO) |
| 166 | + } |
| 167 | + |
| 168 | + ER_RAM_VECTORS RAM_START UNINIT |
| 169 | + { |
| 170 | + * (RESET_RAM, +FIRST) |
| 171 | + } |
| 172 | + |
| 173 | + RW_RAM_DATA +0 |
| 174 | + { |
| 175 | + * (.cy_ramfunc) |
| 176 | + * (+RW, +ZI) |
| 177 | + } |
| 178 | + |
| 179 | + ; Place variables in the section that should not be initialized during the |
| 180 | + ; device startup. |
| 181 | + RW_IRAM1 +0 UNINIT |
| 182 | + { |
| 183 | + * (.noinit) |
| 184 | + } |
| 185 | + |
| 186 | + RW_IRAM2 PUBLIC_RAM_START UNINIT |
| 187 | + { |
| 188 | + * (.cy_sharedmem) |
| 189 | + } |
| 190 | + |
| 191 | + ; Application heap area (HEAP) |
| 192 | + ARM_LIB_HEAP +0 |
| 193 | + { |
| 194 | + * (HEAP) |
| 195 | + } |
| 196 | + |
| 197 | + ; Stack region growing down |
| 198 | + ARM_LIB_STACK RAM_START+RAM_SIZE -STACK_SIZE |
| 199 | + { |
| 200 | + * (STACK) |
| 201 | + } |
| 202 | +} |
| 203 | + |
| 204 | + |
| 205 | +; Emulated EEPROM Flash area |
| 206 | +LR_EM_EEPROM EM_EEPROM_START EM_EEPROM_SIZE |
| 207 | +{ |
| 208 | + .cy_em_eeprom +0 |
| 209 | + { |
| 210 | + * (.cy_em_eeprom) |
| 211 | + } |
| 212 | +} |
| 213 | + |
| 214 | +; Supervisory flash: User data |
| 215 | +LR_SFLASH_USER_DATA SFLASH_USER_DATA_START SFLASH_USER_DATA_SIZE |
| 216 | +{ |
| 217 | + .cy_sflash_user_data +0 |
| 218 | + { |
| 219 | + * (.cy_sflash_user_data) |
| 220 | + } |
| 221 | +} |
| 222 | + |
| 223 | +; Supervisory flash: Normal Access Restrictions (NAR) |
| 224 | +LR_SFLASH_NAR SFLASH_NAR_START SFLASH_NAR_SIZE |
| 225 | +{ |
| 226 | + .cy_sflash_nar +0 |
| 227 | + { |
| 228 | + * (.cy_sflash_nar) |
| 229 | + } |
| 230 | +} |
| 231 | + |
| 232 | +; Supervisory flash: Public Key |
| 233 | +LR_SFLASH_PUBLIC_KEY SFLASH_PUBLIC_KEY_START SFLASH_PUBLIC_KEY_SIZE |
| 234 | +{ |
| 235 | + .cy_sflash_public_key +0 |
| 236 | + { |
| 237 | + * (.cy_sflash_public_key) |
| 238 | + } |
| 239 | +} |
| 240 | + |
| 241 | +; Supervisory flash: Table of Content # 2 |
| 242 | +LR_SFLASH_TOC_2 SFLASH_TOC_2_START SFLASH_TOC_2_SIZE |
| 243 | +{ |
| 244 | + .cy_toc_part2 +0 |
| 245 | + { |
| 246 | + * (.cy_toc_part2) |
| 247 | + } |
| 248 | +} |
| 249 | + |
| 250 | +; Supervisory flash: Table of Content # 2 Copy |
| 251 | +LR_SFLASH_RTOC_2 SFLASH_RTOC_2_START SFLASH_RTOC_2_SIZE |
| 252 | +{ |
| 253 | + .cy_rtoc_part2 +0 |
| 254 | + { |
| 255 | + * (.cy_rtoc_part2) |
| 256 | + } |
| 257 | +} |
| 258 | + |
| 259 | + |
| 260 | +; Places the code in the Execute in Place (XIP) section. See the smif driver documentation for details. |
| 261 | +LR_EROM XIP_START XIP_SIZE |
| 262 | +{ |
| 263 | + .cy_xip +0 |
| 264 | + { |
| 265 | + * (.cy_xip) |
| 266 | + } |
| 267 | +} |
| 268 | + |
| 269 | + |
| 270 | +; eFuse |
| 271 | +LR_EFUSE EFUSE_START EFUSE_SIZE |
| 272 | +{ |
| 273 | + .cy_efuse +0 |
| 274 | + { |
| 275 | + * (.cy_efuse) |
| 276 | + } |
| 277 | +} |
| 278 | + |
| 279 | + |
| 280 | +; The section is used for additional metadata (silicon revision, Silicon/JTAG ID, etc.) storage. |
| 281 | +CYMETA 0x90500000 |
| 282 | +{ |
| 283 | + .cymeta +0 { * (.cymeta) } |
| 284 | +} |
| 285 | + |
| 286 | +/* The following symbols used by the cymcuelftool. */ |
| 287 | +/* Flash */ |
| 288 | +#define __cy_memory_0_start 0x10000000 |
| 289 | +#define __cy_memory_0_length 0x00100000 |
| 290 | +#define __cy_memory_0_row_size 0x200 |
| 291 | + |
| 292 | +/* Emulated EEPROM Flash area */ |
| 293 | +#define __cy_memory_1_start 0x14000000 |
| 294 | +#define __cy_memory_1_length 0x8000 |
| 295 | +#define __cy_memory_1_row_size 0x200 |
| 296 | + |
| 297 | +/* Supervisory Flash */ |
| 298 | +#define __cy_memory_2_start 0x16000000 |
| 299 | +#define __cy_memory_2_length 0x8000 |
| 300 | +#define __cy_memory_2_row_size 0x200 |
| 301 | + |
| 302 | +/* XIP */ |
| 303 | +#define __cy_memory_3_start 0x18000000 |
| 304 | +#define __cy_memory_3_length 0x08000000 |
| 305 | +#define __cy_memory_3_row_size 0x200 |
| 306 | + |
| 307 | +/* eFuse */ |
| 308 | +#define __cy_memory_4_start 0x90700000 |
| 309 | +#define __cy_memory_4_length 0x100000 |
| 310 | +#define __cy_memory_4_row_size 1 |
| 311 | + |
| 312 | + |
| 313 | +/* [] END OF FILE */ |
0 commit comments