|
| 1 | +/* |
| 2 | + * Copyright (c) 2018-2019, Nuvoton Technology Corporation |
| 3 | + * |
| 4 | + * SPDX-License-Identifier: Apache-2.0 |
| 5 | + * |
| 6 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | + * you may not use this file except in compliance with the License. |
| 8 | + * You may obtain a copy of the License at |
| 9 | + * |
| 10 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | + * |
| 12 | + * Unless required by applicable law or agreed to in writing, software |
| 13 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | + * See the License for the specific language governing permissions and |
| 16 | + * limitations under the License. |
| 17 | + */ |
| 18 | + |
| 19 | +/*###ICF### Section handled by ICF editor, don't touch! ****/ |
| 20 | +/*-Editor annotation file-*/ |
| 21 | +/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */ |
| 22 | + |
| 23 | +include "../../../device/partition_M2351_mem.icf.h"; |
| 24 | + |
| 25 | +if (!isdefinedsymbol(MBED_BOOT_STACK_SIZE)) { |
| 26 | + define symbol MBED_BOOT_STACK_SIZE = 0x400; |
| 27 | +} |
| 28 | + |
| 29 | +/* FIXME: Check NSC area requirement */ |
| 30 | + |
| 31 | +/*-Specials-*/ |
| 32 | +define symbol __ICFEDIT_intvec_start__ = MBED_APP_START; |
| 33 | +/*-Memory Regions-*/ |
| 34 | +define symbol __ICFEDIT_region_ROM_start__ = MBED_APP_START; |
| 35 | +define symbol __ICFEDIT_region_ROM_end__ = MBED_APP_START + MBED_APP_SIZE - 1; |
| 36 | +define symbol __ICFEDIT_region_IRAM_start__ = MBED_RAM_APP_START; |
| 37 | +define symbol __ICFEDIT_region_IRAM_end__ = MBED_RAM_APP_START + MBED_RAM_APP_SIZE - 1; |
| 38 | + |
| 39 | +/*-Sizes-*/ |
| 40 | +define symbol __ICFEDIT_size_cstack__ = MBED_BOOT_STACK_SIZE; |
| 41 | +define symbol __ICFEDIT_size_intvec__ = 4 * (16 + 102); |
| 42 | +define symbol __ICFEDIT_size_heap__ = 0x400; |
| 43 | + |
| 44 | + |
| 45 | +/**** End of ICF editor section. ###ICF###*/ |
| 46 | + |
| 47 | + |
| 48 | +define memory mem with size = 4G; |
| 49 | +define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__]; |
| 50 | +define region IRAM_region = mem:[from __ICFEDIT_region_IRAM_start__ to __ICFEDIT_region_IRAM_end__]; |
| 51 | + |
| 52 | +/* IAR has something wrong with "$$" in section/block name. So unlike other toolchains, |
| 53 | + * we name "ER_IROM_NSC" instead of "Image$$ER_IROM_NSC". */ |
| 54 | +define block ER_IROM_NSC with alignment = 32 { readonly section Veneer$$CMSE }; |
| 55 | + |
| 56 | +define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; |
| 57 | +define block HEAP with expanding size, alignment = 8, minimum size = __ICFEDIT_size_heap__ { }; |
| 58 | +/* NOTE: Vector table base requires to be aligned to the power of vector table size. Give a safe value here. */ |
| 59 | +define block IRAMVEC with alignment = 1024, size = __ICFEDIT_size_intvec__ { }; |
| 60 | + |
| 61 | + |
| 62 | +initialize by copy { readwrite }; |
| 63 | +do not initialize { section .noinit }; |
| 64 | + |
| 65 | +place at address mem: __ICFEDIT_intvec_start__ { readonly section .intvec }; |
| 66 | +place in ROM_region { readonly }; |
| 67 | +place at address mem: NU_TZ_NSC_START { block ER_IROM_NSC }; |
| 68 | + |
| 69 | +place at start of IRAM_region { block CSTACK }; |
| 70 | +place in IRAM_region { block IRAMVEC }; |
| 71 | +place in IRAM_region { readwrite }; |
| 72 | +place in IRAM_region { block HEAP }; |
| 73 | + |
| 74 | +define exported symbol Image$$ER_IROM_NSC$$Base = NU_TZ_NSC_START; |
0 commit comments