|
| 1 | +#! armclang -E |
| 2 | + |
| 3 | +/* |
| 4 | + * Copyright (c) 2019-2020, Nuvoton Technology Corporation |
| 5 | + * |
| 6 | + * SPDX-License-Identifier: Apache-2.0 |
| 7 | + * |
| 8 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 9 | + * you may not use this file except in compliance with the License. |
| 10 | + * You may obtain a copy of the License at |
| 11 | + * |
| 12 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 13 | + * |
| 14 | + * Unless required by applicable law or agreed to in writing, software |
| 15 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 16 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 17 | + * See the License for the specific language governing permissions and |
| 18 | + * limitations under the License. |
| 19 | + */ |
| 20 | + |
| 21 | +#include "../../../device/partition_M2351_mem.h" |
| 22 | + |
| 23 | +#if !defined(MBED_BOOT_STACK_SIZE) |
| 24 | +#define MBED_BOOT_STACK_SIZE 0x400 |
| 25 | +#endif |
| 26 | + |
| 27 | +LR_IROM1 MBED_APP_START |
| 28 | +{ |
| 29 | + /* load address = execution address */ |
| 30 | + ER_IROM1 +0 |
| 31 | + { |
| 32 | + *(RESET, +First) |
| 33 | + *(InRoot$$Sections) |
| 34 | + .ANY (+RO) |
| 35 | + } |
| 36 | + |
| 37 | + ARM_LIB_STACK MBED_RAM_APP_START EMPTY MBED_BOOT_STACK_SIZE |
| 38 | + { |
| 39 | + } |
| 40 | + |
| 41 | + /* Reserve for vectors |
| 42 | + * |
| 43 | + * Vector table base address is required to be 128-byte aligned at a minimum. |
| 44 | + * A PE might impose further restrictions on it. */ |
| 45 | + ER_IRAMVEC AlignExpr(+0, 128) EMPTY (4*(16 + 102)) |
| 46 | + { |
| 47 | + } |
| 48 | + |
| 49 | + /* 16 byte-aligned */ |
| 50 | + RW_IRAM1 AlignExpr(+0, 16) |
| 51 | + { |
| 52 | + .ANY (+RW +ZI) |
| 53 | + } |
| 54 | + |
| 55 | + ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (MBED_RAM_APP_START + MBED_RAM_APP_SIZE - AlignExpr(ImageLimit(RW_IRAM1), 16)) |
| 56 | + { |
| 57 | + } |
| 58 | +} |
| 59 | + |
| 60 | +LR_IROM_NSC NU_TZ_NSC_START NU_TZ_NSC_SIZE |
| 61 | +{ |
| 62 | + ER_IROM_NSC NU_TZ_NSC_START FIXED PADVALUE 0xFFFFFFFF NU_TZ_NSC_SIZE |
| 63 | + { |
| 64 | + *(Veneer$$CMSE) |
| 65 | + } |
| 66 | +} |
| 67 | + |
| 68 | +/* By IDAU, 0~0x4000 is secure. NSC can only locate in 0x4000~0x10000000. */ |
| 69 | +ScatterAssert(ImageBase(ER_IROM_NSC) >= 0x4000) |
| 70 | + |
| 71 | +/* Heap must be allocated in RAM. */ |
| 72 | +ScatterAssert(ImageLimit(ARM_LIB_HEAP) <= (MBED_RAM_APP_START + MBED_RAM_APP_SIZE)) |
0 commit comments