|
| 1 | +#! armclang --target=arm-arm-none-eabi -march=armv8-m.main -E -xc |
| 2 | + |
| 3 | +/* |
| 4 | + * Copyright (c) 2019 ARM Limited |
| 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 "../../../partition/region_defs.h" |
| 22 | +#include "../cmsis_nvic.h" |
| 23 | + |
| 24 | +#if !defined(MBED_ROM_START) |
| 25 | + #define MBED_ROM_START NS_CODE_START // 0x000a0400 |
| 26 | +#endif |
| 27 | + |
| 28 | +#if !defined(MBED_ROM_SIZE) |
| 29 | + #define MBED_ROM_SIZE NS_CODE_SIZE // 0x5f800 |
| 30 | +#endif |
| 31 | + |
| 32 | +#if !defined(MBED_RAM_START) |
| 33 | + #define MBED_RAM_START NS_DATA_START |
| 34 | +#endif |
| 35 | + |
| 36 | +#if !defined(MBED_RAM_SIZE) |
| 37 | + #define MBED_RAM_SIZE NS_DATA_SIZE |
| 38 | +#endif |
| 39 | + |
| 40 | +#define VECTOR_SIZE NVIC_RAM_VECTOR_SIZE |
| 41 | + |
| 42 | +#if !defined(MBED_BOOT_STACK_SIZE) |
| 43 | + #define MBED_BOOT_STACK_SIZE 0x400 |
| 44 | +#endif |
| 45 | + |
| 46 | +#define RAM_FIXED_SIZE (MBED_BOOT_STACK_SIZE+VECTOR_SIZE) |
| 47 | + |
| 48 | +LR_CODE MBED_ROM_START MBED_ROM_SIZE { |
| 49 | + ER_CODE MBED_ROM_START MBED_ROM_SIZE { |
| 50 | + *.o (VECTOR +First) |
| 51 | + .ANY (+RO) |
| 52 | + } |
| 53 | + |
| 54 | + RW_IRAM1 (MBED_RAM_START+VECTOR_SIZE) (MBED_RAM_SIZE-VECTOR_SIZE) { |
| 55 | + * (+RW) ; RW data that gets copied from Flash to SRAM |
| 56 | + * (+ZI) ; ZI data that gets initialised to zero in SRAM |
| 57 | + } |
| 58 | + |
| 59 | + ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (MBED_RAM_SIZE-RAM_FIXED_SIZE+MBED_RAM_START-AlignExpr(ImageLimit(RW_IRAM1), 16)) { |
| 60 | + } |
| 61 | + |
| 62 | + ARM_LIB_STACK (MBED_RAM_START+MBED_RAM_SIZE) EMPTY -MBED_BOOT_STACK_SIZE { ; stack |
| 63 | + } |
| 64 | +} |
0 commit comments