mirror of https://github.com/ARMmbed/mbed-os.git
Nuvoton: Migrate to new memory bankc information (#382)
* Nuvoton: Remove unsupported armclang and iar toolchains Armclang and IAR toolchains are not supported in Mbed CE. Remove them for clean. * Nuvoton: Migrate to new style memory bank information Change memory bank symbols: 1. MBED_APP_START/SIZE -> MBED_CONFIGURED_ROM_BANK_IROM1_START/SIZE NOTE: IROM2 for M2354 2. MBED_RAM_APP_START/SIZE -> MBED_CONFIGURED_RAM_BANK_IRAM1_START/SIZE NOTE: IRAM2 for M2354 3. APPLICATION_ADDR/SIZE -> MBED_CONFIGURED_ROM_BANK_IROM1_START/SIZE 4. APPLICATION_RAM_ADDR/SIZE -> MBED_CONFIGURED_RAM_BANK_IRAM1_START/SIZE 5. -> MBED_CONFIGURED_RAM_BANK_XRAM1_START/SIZE NOTE: Specific to NUC472 6. NU_HYPERRAM_START/SIZE -> MBED_CONFIGURED_RAM_BANK_HYPERRAM1_START/SIZE NOTE: Specific to M467pull/15530/head
parent
ab43414e74
commit
99fcb5b3d8
|
@ -14,6 +14,7 @@ target_sources(mbed-m2354
|
|||
analogin_api.c
|
||||
analogout_api.c
|
||||
|
||||
device/partition_M2354_mem.c
|
||||
device/startup_M2354.c
|
||||
device/system_M2354.c
|
||||
device/StdDriver/src/m2354_acmp.c
|
||||
|
|
|
@ -152,6 +152,23 @@ Below summarize the copy paths from TF-M into Mbed:
|
|||
**NOTE**: `trusted-firmware-m/cmake_build/install/image_signing/keys/root-RSA-3072.pem` can be missing due to TF-M build tool issue.
|
||||
Try to get it from `trusted-firmware-m/bl2/ext/mcuboot/root-RSA-3072.pem` instead if it is just the original source.
|
||||
|
||||
Open `targets.json5` (for built-in target) or `custom_targets.json5` (for custom target),
|
||||
, locate the `memory_banks` section for this mbed target,
|
||||
and update the below symbols per above TF-M exported `region_defs.h`.
|
||||
|
||||
```json5
|
||||
"memory_banks": {
|
||||
"NS_CODE": {
|
||||
"size": /*<NS_CODE_SIZE>*/,
|
||||
"start": /*<NS_CODE_START>*/,
|
||||
},
|
||||
"NS_DATA": {
|
||||
"size": /*<NS_DATA_SIZE>*/,
|
||||
"start": /*<NS_DATA_START>*/,
|
||||
},
|
||||
},
|
||||
```
|
||||
|
||||
## PSA Firmware Update
|
||||
|
||||
### Requirement
|
||||
|
|
|
@ -1,64 +0,0 @@
|
|||
#! armclang --target=arm-arm-none-eabi -march=armv8-m.base -E -xc
|
||||
|
||||
/*
|
||||
* Copyright (c) 2020, Nuvoton Technology Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "../partition_M2354_mem.h"
|
||||
|
||||
#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
|
||||
# if defined(MBED_BOOT_STACK_SIZE)
|
||||
# define MBED_CONF_TARGET_BOOT_STACK_SIZE MBED_BOOT_STACK_SIZE
|
||||
# else
|
||||
# define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
|
||||
# endif
|
||||
#endif
|
||||
|
||||
LR_IROM1 MBED_APP_START
|
||||
{
|
||||
/* load address = execution address */
|
||||
ER_IROM1 +0
|
||||
{
|
||||
*(RESET, +First)
|
||||
*(InRoot$$Sections)
|
||||
.ANY (+RO)
|
||||
}
|
||||
|
||||
ARM_LIB_STACK MBED_RAM_APP_START EMPTY MBED_CONF_TARGET_BOOT_STACK_SIZE
|
||||
{
|
||||
}
|
||||
|
||||
/* Reserve for vectors
|
||||
*
|
||||
* Vector table base address is required to be 128-byte aligned at a minimum.
|
||||
* A PE might impose further restrictions on it. */
|
||||
ER_IRAMVEC AlignExpr(+0, 128) EMPTY (4*(16 + 116))
|
||||
{
|
||||
}
|
||||
|
||||
RW_IRAM1 AlignExpr(+0, 16)
|
||||
{
|
||||
.ANY (+RW +ZI)
|
||||
}
|
||||
|
||||
ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (MBED_RAM_APP_START + MBED_RAM_APP_SIZE - AlignExpr(ImageLimit(RW_IRAM1), 16))
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
ScatterAssert(LoadLimit(LR_IROM1) <= (MBED_APP_START + MBED_APP_SIZE))
|
||||
ScatterAssert(ImageLimit(ARM_LIB_HEAP) <= MBED_RAM_APP_START + MBED_RAM_APP_SIZE)
|
|
@ -34,9 +34,9 @@ StackSize = MBED_CONF_TARGET_BOOT_STACK_SIZE;
|
|||
|
||||
MEMORY
|
||||
{
|
||||
VECTORS (rx) : ORIGIN = MBED_APP_START, LENGTH = 0x00000400
|
||||
FLASH (rx) : ORIGIN = MBED_APP_START + 0x400, LENGTH = MBED_APP_SIZE - 0x400
|
||||
RAM_INTERN (rwx) : ORIGIN = MBED_RAM_APP_START, LENGTH = MBED_RAM_APP_SIZE
|
||||
VECTORS (rx) : ORIGIN = MBED_CONFIGURED_ROM_BANK_NS_CODE_START, LENGTH = 0x00000400
|
||||
FLASH (rx) : ORIGIN = MBED_CONFIGURED_ROM_BANK_NS_CODE_START + 0x400, LENGTH = MBED_CONFIGURED_ROM_BANK_NS_CODE_SIZE - 0x400
|
||||
RAM_INTERN (rwx) : ORIGIN = MBED_CONFIGURED_RAM_BANK_NS_DATA_START, LENGTH = MBED_CONFIGURED_RAM_BANK_NS_DATA_SIZE
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
* Copyright (c) 2020, Nuvoton Technology Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include "partition_M2354_mem.h"
|
||||
|
||||
/* Check MBED_ROM_BANK_NS_CODE_START and friends
|
||||
*
|
||||
* These symbols must be resolved by TF-M exported region_defs.h.
|
||||
*/
|
||||
static_assert(MBED_ROM_BANK_NS_CODE_START == NS_CODE_START,
|
||||
"MBED_ROM_BANK_NS_CODE_START not equal TF-M imported NS_CODE_START");
|
||||
static_assert(MBED_ROM_BANK_NS_CODE_SIZE == NS_CODE_SIZE,
|
||||
"MBED_ROM_BANK_NS_CODE_SIZE not equal TF-M imported NS_CODE_SIZE");
|
||||
static_assert(MBED_RAM_BANK_NS_DATA_START == NS_DATA_START,
|
||||
"MBED_RAM_BANK_NS_DATA_START not equal TF-M imported NS_DATA_START");
|
||||
static_assert(MBED_RAM_BANK_NS_DATA_SIZE == NS_DATA_SIZE,
|
||||
"MBED_RAM_BANK_NS_DATA_SIZE not equal TF-M imported NS_DATA_SIZE");
|
|
@ -19,113 +19,45 @@
|
|||
#ifndef __PARTITION_M2354_MEM_H__
|
||||
#define __PARTITION_M2354_MEM_H__
|
||||
|
||||
/* About partition_M2354_mem.h/partition_M2354_mem.icf.h
|
||||
*
|
||||
* 1. partition_M2354_mem.h is created for centralizing memory partition configuration. It will be
|
||||
* included by C/C++ files and linker files (except IAR linker file).
|
||||
* 2. IAR linker doesn't support preprocessor, so partition_M2354_mem.icf.h, duplicate of partition_M2354_mem.h
|
||||
* is created for IAR linker file.
|
||||
* 3. To continue above, we name partition_M2354_mem.icf.h instead of partition_M2354_mem.icf because:
|
||||
* (1) Mbed OS build tool may mis-regard partition_M2354_mem.icf as the main linker configuration file.
|
||||
* (2) *.icf files may not be present in search directories for "include" directive. Per observation,
|
||||
* the search directories are inconsistent among normal example build and test code build. To address
|
||||
* it, we name partition_M2354_mem.icf.h instead because *.h files are always present in these builds
|
||||
* (already there or via copy).
|
||||
*/
|
||||
|
||||
#include "nu_tfm_import_define.h"
|
||||
#include NU_TFM_S_REGION_DEFS_H_PATH
|
||||
#include "nu_tfm_import_undefine.h"
|
||||
|
||||
/* Resolve MBED_ROM_START and friends
|
||||
/* Resolve MBED_ROM_BANK_NS_CODE_START and friends
|
||||
*
|
||||
* TF-M exported region_defs.h essentially resolves MBED_ROM_START and friends.
|
||||
* target.mbed_rom_start and friends get unnecessary.
|
||||
* TF-M exported region_defs.h essentially resolves MBED_ROM_BANK_NS_CODE_START and friends.
|
||||
*/
|
||||
/* Resolve non-secure ROM start */
|
||||
#undef MBED_ROM_START
|
||||
#define MBED_ROM_START NS_CODE_START
|
||||
|
||||
/* Resolve non-secure ROM size */
|
||||
#undef MBED_ROM_SIZE
|
||||
#define MBED_ROM_SIZE NS_CODE_SIZE
|
||||
|
||||
/* Resolve non-secure RAM start */
|
||||
#undef MBED_RAM_START
|
||||
#define MBED_RAM_START NS_DATA_START
|
||||
|
||||
/* Resolve non-secure RAM size */
|
||||
#undef MBED_RAM_SIZE
|
||||
#define MBED_RAM_SIZE NS_DATA_SIZE
|
||||
|
||||
/* Mbed build tool passes just APPLICATION_xxx macros to C/C++ files and just
|
||||
* MBED_APP_xxx macros to linker files even though they mean the same thing.
|
||||
* Because this file is to include by both C/C++ files and linker files, we add
|
||||
* these macros according to the others for consistency when they are missing
|
||||
* in compile or link stage. */
|
||||
|
||||
#ifndef APPLICATION_ADDR
|
||||
#ifdef MBED_APP_START
|
||||
#define APPLICATION_ADDR MBED_APP_START
|
||||
#else
|
||||
#define APPLICATION_ADDR MBED_ROM_START
|
||||
/* Physical NS_CODE start/size */
|
||||
#if !defined(MBED_ROM_BANK_NS_CODE_START)
|
||||
#define MBED_ROM_BANK_NS_CODE_START NS_CODE_START
|
||||
#endif
|
||||
#if !defined(MBED_ROM_BANK_NS_CODE_SIZE)
|
||||
#define MBED_ROM_BANK_NS_CODE_SIZE NS_CODE_SIZE
|
||||
#endif
|
||||
|
||||
/* Physical NS_DATA start/size */
|
||||
#if !defined(MBED_RAM_BANK_NS_DATA_START)
|
||||
#define MBED_RAM_BANK_NS_DATA_START NS_DATA_START
|
||||
#endif
|
||||
#if !defined(MBED_RAM_BANK_NS_DATA_SIZE)
|
||||
#define MBED_RAM_BANK_NS_DATA_SIZE NS_DATA_SIZE
|
||||
#endif
|
||||
|
||||
#ifndef APPLICATION_SIZE
|
||||
#ifdef MBED_APP_SIZE
|
||||
#define APPLICATION_SIZE MBED_APP_SIZE
|
||||
#else
|
||||
#define APPLICATION_SIZE MBED_ROM_SIZE
|
||||
#endif
|
||||
/* Configured NS_CODE start/size */
|
||||
#if !defined(MBED_CONFIGURED_ROM_BANK_NS_CODE_START)
|
||||
#define MBED_CONFIGURED_ROM_BANK_NS_CODE_START MBED_ROM_BANK_NS_CODE_START
|
||||
#endif
|
||||
#if !defined(MBED_CONFIGURED_ROM_BANK_NS_CODE_SIZE)
|
||||
#define MBED_CONFIGURED_ROM_BANK_NS_CODE_SIZE MBED_ROM_BANK_NS_CODE_SIZE
|
||||
#endif
|
||||
|
||||
#ifndef APPLICATION_RAM_ADDR
|
||||
#ifdef MBED_RAM_APP_START
|
||||
#define APPLICATION_RAM_ADDR MBED_RAM_APP_START
|
||||
#else
|
||||
#define APPLICATION_RAM_ADDR MBED_RAM_START
|
||||
/* Configured NS_DATA start/size */
|
||||
#if !defined(MBED_CONFIGURED_RAM_BANK_NS_DATA_START)
|
||||
#define MBED_CONFIGURED_RAM_BANK_NS_DATA_START MBED_RAM_BANK_NS_DATA_START
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef APPLICATION_RAM_SIZE
|
||||
#ifdef MBED_RAM_APP_SIZE
|
||||
#define APPLICATION_RAM_SIZE MBED_RAM_APP_SIZE
|
||||
#else
|
||||
#define APPLICATION_RAM_SIZE MBED_RAM_SIZE
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef MBED_APP_START
|
||||
#define MBED_APP_START APPLICATION_ADDR
|
||||
#endif
|
||||
|
||||
#ifndef MBED_APP_SIZE
|
||||
#define MBED_APP_SIZE APPLICATION_SIZE
|
||||
#endif
|
||||
|
||||
#ifndef MBED_RAM_APP_START
|
||||
#define MBED_RAM_APP_START APPLICATION_RAM_ADDR
|
||||
#endif
|
||||
|
||||
#ifndef MBED_RAM_APP_SIZE
|
||||
#define MBED_RAM_APP_SIZE APPLICATION_RAM_SIZE
|
||||
#endif
|
||||
|
||||
#if (APPLICATION_ADDR != MBED_APP_START)
|
||||
#error("APPLICATION_ADDR and MBED_APP_START are not the same!!!")
|
||||
#endif
|
||||
|
||||
#if (APPLICATION_SIZE != MBED_APP_SIZE)
|
||||
#error("APPLICATION_SIZE and MBED_APP_SIZE are not the same!!!")
|
||||
#endif
|
||||
|
||||
#if (APPLICATION_RAM_ADDR != MBED_RAM_APP_START)
|
||||
#error("APPLICATION_RAM_ADDR and MBED_RAM_APP_START are not the same!!!")
|
||||
#endif
|
||||
|
||||
#if (APPLICATION_RAM_SIZE != MBED_RAM_APP_SIZE)
|
||||
#error("APPLICATION_RAM_SIZE and MBED_RAM_APP_SIZE are not the same!!!")
|
||||
#if !defined(MBED_CONFIGURED_RAM_BANK_NS_DATA_SIZE)
|
||||
#define MBED_CONFIGURED_RAM_BANK_NS_DATA_SIZE MBED_RAM_BANK_NS_DATA_SIZE
|
||||
#endif
|
||||
|
||||
#endif /* __PARTITION_M2354_MEM_H__ */
|
||||
|
|
|
@ -1,112 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2020, Nuvoton Technology Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/* See partition_M2354_mem.h for documentation */
|
||||
|
||||
/* Update MBED_ROM_START and friends on redoing TF-M import (for IAR)
|
||||
*
|
||||
* IAR doesn't support CPP, so we cannot resolve MBED_ROM_START and friends by
|
||||
* TF-M exported region_defs.h.
|
||||
*
|
||||
* Without target.mbed_rom_start and friends (replaced with TF-M exported region_defs.h),
|
||||
* MBED_ROM_START and friends passed along are incorrect. Because IAR doesn't allow symbol
|
||||
* redefinition, we change to MBED_ROM_START_ORIDE and friends instead for a temporary
|
||||
* solution.
|
||||
*/
|
||||
|
||||
/* Resolve non-secure ROM start */
|
||||
define symbol MBED_ROM_START_ORIDE = 0x10070400;
|
||||
|
||||
/* Resolve non-secure ROM size */
|
||||
define symbol MBED_ROM_SIZE_ORIDE = 0x8F400;
|
||||
|
||||
/* Resolve non-secure RAM start */
|
||||
define symbol MBED_RAM_START_ORIDE = 0x30018000;
|
||||
|
||||
/* Resolve non-secure RAM size */
|
||||
define symbol MBED_RAM_SIZE_ORIDE = 0x28000;
|
||||
|
||||
/* Mbed build tool passes just APPLICATION_xxx macros to C/C++ files and just
|
||||
* MBED_APP_xxx macros to linker files even though they mean the same thing.
|
||||
* Because this file is to include by both C/C++ files and linker files, we add
|
||||
* these macros according to the others for consistency when they are missing
|
||||
* in compile or link stage. */
|
||||
|
||||
if (!isdefinedsymbol(APPLICATION_ADDR)) {
|
||||
if (isdefinedsymbol(MBED_APP_START)) {
|
||||
define symbol APPLICATION_ADDR = MBED_APP_START;
|
||||
} else {
|
||||
define symbol APPLICATION_ADDR = MBED_ROM_START_ORIDE;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(APPLICATION_SIZE)) {
|
||||
if (isdefinedsymbol(MBED_APP_SIZE)) {
|
||||
define symbol APPLICATION_SIZE = MBED_APP_SIZE;
|
||||
} else {
|
||||
define symbol APPLICATION_SIZE = MBED_ROM_SIZE_ORIDE;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(APPLICATION_RAM_ADDR)) {
|
||||
if (isdefinedsymbol(MBED_RAM_APP_START)) {
|
||||
define symbol APPLICATION_RAM_ADDR = MBED_RAM_APP_START;
|
||||
} else {
|
||||
define symbol APPLICATION_RAM_ADDR = MBED_RAM_START_ORIDE;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(APPLICATION_RAM_SIZE)) {
|
||||
if (isdefinedsymbol(MBED_RAM_APP_SIZE)) {
|
||||
define symbol APPLICATION_RAM_SIZE = MBED_RAM_APP_SIZE;
|
||||
} else {
|
||||
define symbol APPLICATION_RAM_SIZE = MBED_RAM_SIZE_ORIDE;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(MBED_APP_START)) {
|
||||
define symbol MBED_APP_START = APPLICATION_ADDR;
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(MBED_APP_SIZE)) {
|
||||
define symbol MBED_APP_SIZE = APPLICATION_SIZE;
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(MBED_RAM_APP_START)) {
|
||||
define symbol MBED_RAM_APP_START = APPLICATION_RAM_ADDR;
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(MBED_RAM_APP_SIZE)) {
|
||||
define symbol MBED_RAM_APP_SIZE = APPLICATION_RAM_SIZE;
|
||||
}
|
||||
|
||||
if (APPLICATION_ADDR != MBED_APP_START) {
|
||||
error "APPLICATION_ADDR and MBED_APP_START are not the same!!!";
|
||||
}
|
||||
|
||||
if (APPLICATION_SIZE != MBED_APP_SIZE) {
|
||||
error "APPLICATION_SIZE and MBED_APP_SIZE are not the same!!!";
|
||||
}
|
||||
|
||||
if (APPLICATION_RAM_ADDR != MBED_RAM_APP_START) {
|
||||
error "APPLICATION_RAM_ADDR and MBED_RAM_APP_START are not the same!!!";
|
||||
}
|
||||
|
||||
if (APPLICATION_RAM_SIZE != MBED_RAM_APP_SIZE) {
|
||||
error "APPLICATION_RAM_SIZE and MBED_RAM_APP_SIZE are not the same!!!";
|
||||
}
|
|
@ -19,115 +19,42 @@
|
|||
#ifndef __M251_MEM_H__
|
||||
#define __M251_MEM_H__
|
||||
|
||||
/* About M251_mem.h/M251_mem.icf.h
|
||||
*
|
||||
* 1. M251_mem.h is created for centralizing memory configuration. It will be included by C/C++ files
|
||||
* and linker files (except IAR linker file).
|
||||
* 2. IAR linker doesn't support preprocessor, so M251_mem.icf.h, duplicate of M251_mem.h
|
||||
* is created for IAR linker file.
|
||||
* 3. To continue above, we name M251_mem.icf.h instead of M251_mem.icf because:
|
||||
* (1) Mbed OS build tool may mis-regard M251_mem.icf as the main linker configuration file.
|
||||
* (2) *.icf files may not be present in search directories for "include" directive. Per observation,
|
||||
* the search directories are inconsistent among normal example build and test code build. To address
|
||||
* it, we name M251_mem.icf.h instead because *.h files are always present in these builds
|
||||
* (already there or via copy).
|
||||
*/
|
||||
|
||||
/* Default memory specification
|
||||
*
|
||||
* Flash size: 256KiB
|
||||
* SRAM size: 32KiB
|
||||
*/
|
||||
|
||||
/* Resolve ROM start */
|
||||
#ifndef MBED_ROM_START
|
||||
#define MBED_ROM_START (0x0)
|
||||
/* Physical IROM1 start/size */
|
||||
#if !defined(MBED_ROM_BANK_IROM1_START)
|
||||
#define MBED_ROM_BANK_IROM1_START 0x0
|
||||
#endif
|
||||
#if !defined(MBED_ROM_BANK_IROM1_SIZE)
|
||||
#define MBED_ROM_BANK_IROM1_SIZE 0x40000
|
||||
#endif
|
||||
|
||||
/* Physical IRAM1 start/size */
|
||||
#if !defined(MBED_RAM_BANK_IRAM1_START)
|
||||
#define MBED_RAM_BANK_IRAM1_START 0x20000000
|
||||
#endif
|
||||
#if !defined(MBED_RAM_BANK_IRAM1_SIZE)
|
||||
#define MBED_RAM_BANK_IRAM1_SIZE 0x8000
|
||||
#endif
|
||||
|
||||
/* Resolve ROM size */
|
||||
#ifndef MBED_ROM_SIZE
|
||||
#define MBED_ROM_SIZE (0x40000)
|
||||
/* Configured IROM1 start/size */
|
||||
#if !defined(MBED_CONFIGURED_ROM_BANK_IROM1_START)
|
||||
#define MBED_CONFIGURED_ROM_BANK_IROM1_START MBED_ROM_BANK_IROM1_START
|
||||
#endif
|
||||
#if !defined(MBED_CONFIGURED_ROM_BANK_IROM1_SIZE)
|
||||
#define MBED_CONFIGURED_ROM_BANK_IROM1_SIZE MBED_ROM_BANK_IROM1_SIZE
|
||||
#endif
|
||||
|
||||
/* Resolve RAM start */
|
||||
#ifndef MBED_RAM_START
|
||||
#define MBED_RAM_START (0x20000000)
|
||||
/* Configured IRAM1 start/size */
|
||||
#if !defined(MBED_CONFIGURED_RAM_BANK_IRAM1_START)
|
||||
#define MBED_CONFIGURED_RAM_BANK_IRAM1_START MBED_RAM_BANK_IRAM1_START
|
||||
#endif
|
||||
|
||||
/* Resolve RAM size */
|
||||
#ifndef MBED_RAM_SIZE
|
||||
#define MBED_RAM_SIZE (0x8000)
|
||||
#endif
|
||||
|
||||
|
||||
/* Mbed build tool passes just APPLICATION_xxx macros to C/C++ files and just
|
||||
* MBED_APP_xxx macros to linker files even though they mean the same thing.
|
||||
* Because this file is to include by both C/C++ files and linker files, we add
|
||||
* these macros according to the others for consistency when they are missing
|
||||
* in compile or link stage. */
|
||||
|
||||
#ifndef APPLICATION_ADDR
|
||||
#ifdef MBED_APP_START
|
||||
#define APPLICATION_ADDR MBED_APP_START
|
||||
#else
|
||||
#define APPLICATION_ADDR MBED_ROM_START
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef APPLICATION_SIZE
|
||||
#ifdef MBED_APP_SIZE
|
||||
#define APPLICATION_SIZE MBED_APP_SIZE
|
||||
#else
|
||||
#define APPLICATION_SIZE MBED_ROM_SIZE
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef APPLICATION_RAM_ADDR
|
||||
#ifdef MBED_RAM_APP_START
|
||||
#define APPLICATION_RAM_ADDR MBED_RAM_APP_START
|
||||
#else
|
||||
#define APPLICATION_RAM_ADDR MBED_RAM_START
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef APPLICATION_RAM_SIZE
|
||||
#ifdef MBED_RAM_APP_SIZE
|
||||
#define APPLICATION_RAM_SIZE MBED_RAM_APP_SIZE
|
||||
#else
|
||||
#define APPLICATION_RAM_SIZE MBED_RAM_SIZE
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef MBED_APP_START
|
||||
#define MBED_APP_START APPLICATION_ADDR
|
||||
#endif
|
||||
|
||||
#ifndef MBED_APP_SIZE
|
||||
#define MBED_APP_SIZE APPLICATION_SIZE
|
||||
#endif
|
||||
|
||||
#ifndef MBED_RAM_APP_START
|
||||
#define MBED_RAM_APP_START APPLICATION_RAM_ADDR
|
||||
#endif
|
||||
|
||||
#ifndef MBED_RAM_APP_SIZE
|
||||
#define MBED_RAM_APP_SIZE APPLICATION_RAM_SIZE
|
||||
#endif
|
||||
|
||||
#if (APPLICATION_ADDR != MBED_APP_START)
|
||||
#error("APPLICATION_ADDR and MBED_APP_START are not the same!!!")
|
||||
#endif
|
||||
|
||||
#if (APPLICATION_SIZE != MBED_APP_SIZE)
|
||||
#error("APPLICATION_SIZE and MBED_APP_SIZE are not the same!!!")
|
||||
#endif
|
||||
|
||||
#if (APPLICATION_RAM_ADDR != MBED_RAM_APP_START)
|
||||
#error("APPLICATION_RAM_ADDR and MBED_RAM_APP_START are not the same!!!")
|
||||
#endif
|
||||
|
||||
#if (APPLICATION_RAM_SIZE != MBED_RAM_APP_SIZE)
|
||||
#error("APPLICATION_RAM_SIZE and MBED_RAM_APP_SIZE are not the same!!!")
|
||||
#if !defined(MBED_CONFIGURED_RAM_BANK_IRAM1_SIZE)
|
||||
#define MBED_CONFIGURED_RAM_BANK_IRAM1_SIZE MBED_RAM_BANK_IRAM1_SIZE
|
||||
#endif
|
||||
|
||||
#endif /* __M251_MEM_H__ */
|
||||
|
|
|
@ -1,115 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2020, Nuvoton Technology Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/* See M251_mem.h for documentation */
|
||||
|
||||
/* Default memory specification
|
||||
*
|
||||
* Flash size: 256KiB
|
||||
* SRAM size: 32KiB
|
||||
*/
|
||||
|
||||
/* Resolve ROM start */
|
||||
if (!isdefinedsymbol(MBED_ROM_START)) {
|
||||
define symbol MBED_ROM_START = 0x0;
|
||||
}
|
||||
|
||||
/* Resolve ROM size */
|
||||
if (!isdefinedsymbol(MBED_ROM_SIZE)) {
|
||||
define symbol MBED_ROM_SIZE = 0x40000;
|
||||
}
|
||||
|
||||
/* Resolve RAM start */
|
||||
if (!isdefinedsymbol(MBED_RAM_START)) {
|
||||
define symbol MBED_RAM_START = 0x20000000;
|
||||
}
|
||||
|
||||
/* Resolve RAM size */
|
||||
if (!isdefinedsymbol(MBED_RAM_SIZE)) {
|
||||
define symbol MBED_RAM_SIZE = 0x8000;
|
||||
}
|
||||
|
||||
/* Mbed build tool passes just APPLICATION_xxx macros to C/C++ files and just
|
||||
* MBED_APP_xxx macros to linker files even though they mean the same thing.
|
||||
* Because this file is to include by both C/C++ files and linker files, we add
|
||||
* these macros according to the others for consistency when they are missing
|
||||
* in compile or link stage. */
|
||||
|
||||
if (!isdefinedsymbol(APPLICATION_ADDR)) {
|
||||
if (isdefinedsymbol(MBED_APP_START)) {
|
||||
define symbol APPLICATION_ADDR = MBED_APP_START;
|
||||
} else {
|
||||
define symbol APPLICATION_ADDR = MBED_ROM_START;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(APPLICATION_SIZE)) {
|
||||
if (isdefinedsymbol(MBED_APP_SIZE)) {
|
||||
define symbol APPLICATION_SIZE = MBED_APP_SIZE;
|
||||
} else {
|
||||
define symbol APPLICATION_SIZE = MBED_ROM_SIZE;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(APPLICATION_RAM_ADDR)) {
|
||||
if (isdefinedsymbol(MBED_RAM_APP_START)) {
|
||||
define symbol APPLICATION_RAM_ADDR = MBED_RAM_APP_START;
|
||||
} else {
|
||||
define symbol APPLICATION_RAM_ADDR = MBED_RAM_START;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(APPLICATION_RAM_SIZE)) {
|
||||
if (isdefinedsymbol(MBED_RAM_APP_SIZE)) {
|
||||
define symbol APPLICATION_RAM_SIZE = MBED_RAM_APP_SIZE;
|
||||
} else {
|
||||
define symbol APPLICATION_RAM_SIZE = MBED_RAM_SIZE;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(MBED_APP_START)) {
|
||||
define symbol MBED_APP_START = APPLICATION_ADDR;
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(MBED_APP_SIZE)) {
|
||||
define symbol MBED_APP_SIZE = APPLICATION_SIZE;
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(MBED_RAM_APP_START)) {
|
||||
define symbol MBED_RAM_APP_START = APPLICATION_RAM_ADDR;
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(MBED_RAM_APP_SIZE)) {
|
||||
define symbol MBED_RAM_APP_SIZE = APPLICATION_RAM_SIZE;
|
||||
}
|
||||
|
||||
if (APPLICATION_ADDR != MBED_APP_START) {
|
||||
error "APPLICATION_ADDR and MBED_APP_START are not the same!!!";
|
||||
}
|
||||
|
||||
if (APPLICATION_SIZE != MBED_APP_SIZE) {
|
||||
error "APPLICATION_SIZE and MBED_APP_SIZE are not the same!!!";
|
||||
}
|
||||
|
||||
if (APPLICATION_RAM_ADDR != MBED_RAM_APP_START) {
|
||||
error "APPLICATION_RAM_ADDR and MBED_RAM_APP_START are not the same!!!";
|
||||
}
|
||||
|
||||
if (APPLICATION_RAM_SIZE != MBED_RAM_APP_SIZE) {
|
||||
error "APPLICATION_RAM_SIZE and MBED_RAM_APP_SIZE are not the same!!!";
|
||||
}
|
|
@ -1,67 +0,0 @@
|
|||
#! armclang -E --target=arm-arm-none-eabi -x c -mcpu=cortex-m23
|
||||
|
||||
/*
|
||||
* Copyright (c) 2019, Nuvoton Technology Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "../M251_mem.h"
|
||||
|
||||
#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
|
||||
# if defined(MBED_BOOT_STACK_SIZE)
|
||||
# define MBED_CONF_TARGET_BOOT_STACK_SIZE MBED_BOOT_STACK_SIZE
|
||||
# else
|
||||
# define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#define VECTOR_SIZE (4*(16 + 64))
|
||||
|
||||
LR_IROM1 MBED_APP_START MBED_APP_SIZE
|
||||
{
|
||||
/* load address = execution address */
|
||||
ER_IROM1 +0
|
||||
{
|
||||
*(RESET, +First)
|
||||
*(InRoot$$Sections)
|
||||
.ANY (+RO)
|
||||
}
|
||||
|
||||
ARM_LIB_STACK MBED_RAM_APP_START EMPTY MBED_CONF_TARGET_BOOT_STACK_SIZE
|
||||
{
|
||||
}
|
||||
|
||||
/* Reserve for vectors
|
||||
*
|
||||
* Vector table base address is required to be 128-byte aligned at a minimum.
|
||||
* A PE might impose further restrictions on it. */
|
||||
ER_IRAMVEC AlignExpr(+0, 128) EMPTY VECTOR_SIZE
|
||||
{
|
||||
}
|
||||
|
||||
/* 16 byte-aligned */
|
||||
RW_IRAM1 AlignExpr(+0, 16)
|
||||
{
|
||||
.ANY (+RW +ZI)
|
||||
}
|
||||
|
||||
ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (MBED_RAM_APP_START + MBED_RAM_APP_SIZE - AlignExpr(ImageLimit(RW_IRAM1), 16))
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
ScatterAssert(LoadLimit(LR_IROM1) <= (MBED_APP_START + MBED_APP_SIZE))
|
||||
ScatterAssert(ImageLimit(ARM_LIB_HEAP) <= (MBED_RAM_APP_START + MBED_RAM_APP_SIZE))
|
|
@ -32,9 +32,9 @@ StackSize = MBED_CONF_TARGET_BOOT_STACK_SIZE;
|
|||
|
||||
MEMORY
|
||||
{
|
||||
VECTORS (rx) : ORIGIN = MBED_APP_START, LENGTH = 0x00000400
|
||||
FLASH (rx) : ORIGIN = MBED_APP_START + 0x400, LENGTH = MBED_APP_SIZE - 0x400
|
||||
RAM_INTERN (rwx) : ORIGIN = MBED_RAM_APP_START, LENGTH = MBED_RAM_APP_SIZE
|
||||
VECTORS (rx) : ORIGIN = MBED_CONFIGURED_ROM_BANK_IROM1_START, LENGTH = 0x00000400
|
||||
FLASH (rx) : ORIGIN = MBED_CONFIGURED_ROM_BANK_IROM1_START + 0x400, LENGTH = MBED_CONFIGURED_ROM_BANK_IROM1_SIZE - 0x400
|
||||
RAM_INTERN (rwx) : ORIGIN = MBED_CONFIGURED_RAM_BANK_IRAM1_START, LENGTH = MBED_CONFIGURED_RAM_BANK_IRAM1_SIZE
|
||||
}
|
||||
|
||||
/* Must match cmsis_nvic.h */
|
||||
|
|
|
@ -94,7 +94,7 @@ static const flash_algo_t flash_algo_config = {
|
|||
|
||||
/* Secure flash */
|
||||
static const sector_info_t sectors_info[] = {
|
||||
{MBED_ROM_START, 0x200}, // (start, sector size)
|
||||
{MBED_ROM_BANK_IROM1_START, 0x200}, // (start, sector size)
|
||||
};
|
||||
|
||||
/* Secure flash */
|
||||
|
@ -102,8 +102,8 @@ static const flash_target_config_t flash_target_config = {
|
|||
.page_size = 4, // 4 bytes
|
||||
// Here page_size is program unit, which is different
|
||||
// than FMC definition.
|
||||
.flash_start = MBED_ROM_START,
|
||||
.flash_size = MBED_ROM_SIZE,
|
||||
.flash_start = MBED_ROM_BANK_IROM1_START,
|
||||
.flash_size = MBED_ROM_BANK_IROM1_SIZE,
|
||||
.sectors = sectors_info,
|
||||
.sector_info_count = sizeof(sectors_info) / sizeof(sector_info_t)
|
||||
};
|
||||
|
|
|
@ -19,115 +19,42 @@
|
|||
#ifndef __M261_MEM_H__
|
||||
#define __M261_MEM_H__
|
||||
|
||||
/* About M261_mem.h/M261_mem.icf.h
|
||||
*
|
||||
* 1. M261_mem.h is created for centralizing memory configuration. It will be included by C/C++ files
|
||||
* and linker files (except IAR linker file).
|
||||
* 2. IAR linker doesn't support preprocessor, so M261_mem.icf.h, duplicate of M261_mem.h
|
||||
* is created for IAR linker file.
|
||||
* 3. To continue above, we name M261_mem.icf.h instead of M261_mem.icf because:
|
||||
* (1) Mbed OS build tool may mis-regard M261_mem.icf as the main linker configuration file.
|
||||
* (2) *.icf files may not be present in search directories for "include" directive. Per observation,
|
||||
* the search directories are inconsistent among normal example build and test code build. To address
|
||||
* it, we name M261_mem.icf.h instead because *.h files are always present in these builds
|
||||
* (already there or via copy).
|
||||
*/
|
||||
|
||||
/* Default memory specification
|
||||
*
|
||||
* Flash size: 512KiB
|
||||
* SRAM size: 96KiB
|
||||
*/
|
||||
|
||||
/* Resolve ROM start */
|
||||
#ifndef MBED_ROM_START
|
||||
#define MBED_ROM_START (0x0)
|
||||
/* Physical IROM1 start/size */
|
||||
#if !defined(MBED_ROM_BANK_IROM1_START)
|
||||
#define MBED_ROM_BANK_IROM1_START 0x0
|
||||
#endif
|
||||
#if !defined(MBED_ROM_BANK_IROM1_SIZE)
|
||||
#define MBED_ROM_BANK_IROM1_SIZE 0x80000
|
||||
#endif
|
||||
|
||||
/* Physical IRAM1 start/size */
|
||||
#if !defined(MBED_RAM_BANK_IRAM1_START)
|
||||
#define MBED_RAM_BANK_IRAM1_START 0x20000000
|
||||
#endif
|
||||
#if !defined(MBED_RAM_BANK_IRAM1_SIZE)
|
||||
#define MBED_RAM_BANK_IRAM1_SIZE 0x18000
|
||||
#endif
|
||||
|
||||
/* Resolve ROM size */
|
||||
#ifndef MBED_ROM_SIZE
|
||||
#define MBED_ROM_SIZE (0x80000)
|
||||
/* Configured IROM1 start/size */
|
||||
#if !defined(MBED_CONFIGURED_ROM_BANK_IROM1_START)
|
||||
#define MBED_CONFIGURED_ROM_BANK_IROM1_START MBED_ROM_BANK_IROM1_START
|
||||
#endif
|
||||
#if !defined(MBED_CONFIGURED_ROM_BANK_IROM1_SIZE)
|
||||
#define MBED_CONFIGURED_ROM_BANK_IROM1_SIZE MBED_ROM_BANK_IROM1_SIZE
|
||||
#endif
|
||||
|
||||
/* Resolve RAM start */
|
||||
#ifndef MBED_RAM_START
|
||||
#define MBED_RAM_START (0x20000000)
|
||||
/* Configured IRAM1 start/size */
|
||||
#if !defined(MBED_CONFIGURED_RAM_BANK_IRAM1_START)
|
||||
#define MBED_CONFIGURED_RAM_BANK_IRAM1_START MBED_RAM_BANK_IRAM1_START
|
||||
#endif
|
||||
|
||||
/* Resolve RAM size */
|
||||
#ifndef MBED_RAM_SIZE
|
||||
#define MBED_RAM_SIZE (0x18000)
|
||||
#endif
|
||||
|
||||
|
||||
/* Mbed build tool passes just APPLICATION_xxx macros to C/C++ files and just
|
||||
* MBED_APP_xxx macros to linker files even though they mean the same thing.
|
||||
* Because this file is to include by both C/C++ files and linker files, we add
|
||||
* these macros according to the others for consistency when they are missing
|
||||
* in compile or link stage. */
|
||||
|
||||
#ifndef APPLICATION_ADDR
|
||||
#ifdef MBED_APP_START
|
||||
#define APPLICATION_ADDR MBED_APP_START
|
||||
#else
|
||||
#define APPLICATION_ADDR MBED_ROM_START
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef APPLICATION_SIZE
|
||||
#ifdef MBED_APP_SIZE
|
||||
#define APPLICATION_SIZE MBED_APP_SIZE
|
||||
#else
|
||||
#define APPLICATION_SIZE MBED_ROM_SIZE
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef APPLICATION_RAM_ADDR
|
||||
#ifdef MBED_RAM_APP_START
|
||||
#define APPLICATION_RAM_ADDR MBED_RAM_APP_START
|
||||
#else
|
||||
#define APPLICATION_RAM_ADDR MBED_RAM_START
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef APPLICATION_RAM_SIZE
|
||||
#ifdef MBED_RAM_APP_SIZE
|
||||
#define APPLICATION_RAM_SIZE MBED_RAM_APP_SIZE
|
||||
#else
|
||||
#define APPLICATION_RAM_SIZE MBED_RAM_SIZE
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef MBED_APP_START
|
||||
#define MBED_APP_START APPLICATION_ADDR
|
||||
#endif
|
||||
|
||||
#ifndef MBED_APP_SIZE
|
||||
#define MBED_APP_SIZE APPLICATION_SIZE
|
||||
#endif
|
||||
|
||||
#ifndef MBED_RAM_APP_START
|
||||
#define MBED_RAM_APP_START APPLICATION_RAM_ADDR
|
||||
#endif
|
||||
|
||||
#ifndef MBED_RAM_APP_SIZE
|
||||
#define MBED_RAM_APP_SIZE APPLICATION_RAM_SIZE
|
||||
#endif
|
||||
|
||||
#if (APPLICATION_ADDR != MBED_APP_START)
|
||||
#error("APPLICATION_ADDR and MBED_APP_START are not the same!!!")
|
||||
#endif
|
||||
|
||||
#if (APPLICATION_SIZE != MBED_APP_SIZE)
|
||||
#error("APPLICATION_SIZE and MBED_APP_SIZE are not the same!!!")
|
||||
#endif
|
||||
|
||||
#if (APPLICATION_RAM_ADDR != MBED_RAM_APP_START)
|
||||
#error("APPLICATION_RAM_ADDR and MBED_RAM_APP_START are not the same!!!")
|
||||
#endif
|
||||
|
||||
#if (APPLICATION_RAM_SIZE != MBED_RAM_APP_SIZE)
|
||||
#error("APPLICATION_RAM_SIZE and MBED_RAM_APP_SIZE are not the same!!!")
|
||||
#if !defined(MBED_CONFIGURED_RAM_BANK_IRAM1_SIZE)
|
||||
#define MBED_CONFIGURED_RAM_BANK_IRAM1_SIZE MBED_RAM_BANK_IRAM1_SIZE
|
||||
#endif
|
||||
|
||||
#endif /* __M261_MEM_H__ */
|
||||
|
|
|
@ -1,115 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2020, Nuvoton Technology Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/* See M261_mem.h for documentation */
|
||||
|
||||
/* Default memory specification
|
||||
*
|
||||
* Flash size: 512KiB
|
||||
* SRAM size: 96KiB
|
||||
*/
|
||||
|
||||
/* Resolve ROM start */
|
||||
if (!isdefinedsymbol(MBED_ROM_START)) {
|
||||
define symbol MBED_ROM_START = 0x0;
|
||||
}
|
||||
|
||||
/* Resolve ROM size */
|
||||
if (!isdefinedsymbol(MBED_ROM_SIZE)) {
|
||||
define symbol MBED_ROM_SIZE = 0x80000;
|
||||
}
|
||||
|
||||
/* Resolve RAM start */
|
||||
if (!isdefinedsymbol(MBED_RAM_START)) {
|
||||
define symbol MBED_RAM_START = 0x20000000;
|
||||
}
|
||||
|
||||
/* Resolve RAM size */
|
||||
if (!isdefinedsymbol(MBED_RAM_SIZE)) {
|
||||
define symbol MBED_RAM_SIZE = 0x18000;
|
||||
}
|
||||
|
||||
/* Mbed build tool passes just APPLICATION_xxx macros to C/C++ files and just
|
||||
* MBED_APP_xxx macros to linker files even though they mean the same thing.
|
||||
* Because this file is to include by both C/C++ files and linker files, we add
|
||||
* these macros according to the others for consistency when they are missing
|
||||
* in compile or link stage. */
|
||||
|
||||
if (!isdefinedsymbol(APPLICATION_ADDR)) {
|
||||
if (isdefinedsymbol(MBED_APP_START)) {
|
||||
define symbol APPLICATION_ADDR = MBED_APP_START;
|
||||
} else {
|
||||
define symbol APPLICATION_ADDR = MBED_ROM_START;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(APPLICATION_SIZE)) {
|
||||
if (isdefinedsymbol(MBED_APP_SIZE)) {
|
||||
define symbol APPLICATION_SIZE = MBED_APP_SIZE;
|
||||
} else {
|
||||
define symbol APPLICATION_SIZE = MBED_ROM_SIZE;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(APPLICATION_RAM_ADDR)) {
|
||||
if (isdefinedsymbol(MBED_RAM_APP_START)) {
|
||||
define symbol APPLICATION_RAM_ADDR = MBED_RAM_APP_START;
|
||||
} else {
|
||||
define symbol APPLICATION_RAM_ADDR = MBED_RAM_START;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(APPLICATION_RAM_SIZE)) {
|
||||
if (isdefinedsymbol(MBED_RAM_APP_SIZE)) {
|
||||
define symbol APPLICATION_RAM_SIZE = MBED_RAM_APP_SIZE;
|
||||
} else {
|
||||
define symbol APPLICATION_RAM_SIZE = MBED_RAM_SIZE;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(MBED_APP_START)) {
|
||||
define symbol MBED_APP_START = APPLICATION_ADDR;
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(MBED_APP_SIZE)) {
|
||||
define symbol MBED_APP_SIZE = APPLICATION_SIZE;
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(MBED_RAM_APP_START)) {
|
||||
define symbol MBED_RAM_APP_START = APPLICATION_RAM_ADDR;
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(MBED_RAM_APP_SIZE)) {
|
||||
define symbol MBED_RAM_APP_SIZE = APPLICATION_RAM_SIZE;
|
||||
}
|
||||
|
||||
if (APPLICATION_ADDR != MBED_APP_START) {
|
||||
error "APPLICATION_ADDR and MBED_APP_START are not the same!!!";
|
||||
}
|
||||
|
||||
if (APPLICATION_SIZE != MBED_APP_SIZE) {
|
||||
error "APPLICATION_SIZE and MBED_APP_SIZE are not the same!!!";
|
||||
}
|
||||
|
||||
if (APPLICATION_RAM_ADDR != MBED_RAM_APP_START) {
|
||||
error "APPLICATION_RAM_ADDR and MBED_RAM_APP_START are not the same!!!";
|
||||
}
|
||||
|
||||
if (APPLICATION_RAM_SIZE != MBED_RAM_APP_SIZE) {
|
||||
error "APPLICATION_RAM_SIZE and MBED_RAM_APP_SIZE are not the same!!!";
|
||||
}
|
|
@ -1,61 +0,0 @@
|
|||
#! armclang -E --target=arm-arm-none-eabi -x c -mcpu=cortex-m23
|
||||
|
||||
/*
|
||||
* Copyright (c) 2019-2020, Nuvoton Technology Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include "../M261_mem.h"
|
||||
|
||||
#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
|
||||
# if defined(MBED_BOOT_STACK_SIZE)
|
||||
# define MBED_CONF_TARGET_BOOT_STACK_SIZE MBED_BOOT_STACK_SIZE
|
||||
# else
|
||||
# define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#define VECTOR_SIZE (4*(16 + 102))
|
||||
|
||||
LR_IROM1 MBED_APP_START {
|
||||
ER_IROM1 +0 { ; load address = execution address
|
||||
*(RESET, +First)
|
||||
*(InRoot$$Sections)
|
||||
.ANY (+RO)
|
||||
}
|
||||
|
||||
ARM_LIB_STACK MBED_RAM_APP_START EMPTY MBED_CONF_TARGET_BOOT_STACK_SIZE {
|
||||
}
|
||||
|
||||
/* Reserve for vectors
|
||||
*
|
||||
* Vector table base address is required to be 128-byte aligned at a minimum.
|
||||
* A PE might impose further restrictions on it. */
|
||||
ER_IRAMVEC AlignExpr(+0, 128) EMPTY VECTOR_SIZE { ; Reserve for vectors
|
||||
}
|
||||
|
||||
RW_m_crash_data AlignExpr(+0, 0x100) EMPTY 0x100 { ; Reserve for crash data storage
|
||||
}
|
||||
|
||||
RW_IRAM1 AlignExpr(+0, 16) { ; 16 byte-aligned
|
||||
.ANY (+RW +ZI)
|
||||
}
|
||||
|
||||
ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (MBED_RAM_APP_START + MBED_RAM_APP_SIZE - AlignExpr(ImageLimit(RW_IRAM1), 16)) {
|
||||
}
|
||||
}
|
||||
ScatterAssert(LoadLimit(LR_IROM1) <= (MBED_APP_START + MBED_APP_SIZE))
|
||||
ScatterAssert(ImageLimit(ARM_LIB_HEAP) <= (MBED_RAM_APP_START + MBED_RAM_APP_SIZE))
|
|
@ -35,9 +35,9 @@ StackSize = MBED_CONF_TARGET_BOOT_STACK_SIZE;
|
|||
|
||||
MEMORY
|
||||
{
|
||||
VECTORS (rx) : ORIGIN = MBED_APP_START, LENGTH = 0x00000400
|
||||
FLASH (rx) : ORIGIN = MBED_APP_START + 0x400, LENGTH = MBED_APP_SIZE - 0x00000400
|
||||
RAM_INTERN (rwx) : ORIGIN = MBED_RAM_APP_START, LENGTH = MBED_RAM_APP_SIZE
|
||||
VECTORS (rx) : ORIGIN = MBED_CONFIGURED_ROM_BANK_IROM1_START, LENGTH = 0x00000400
|
||||
FLASH (rx) : ORIGIN = MBED_CONFIGURED_ROM_BANK_IROM1_START + 0x400, LENGTH = MBED_CONFIGURED_ROM_BANK_IROM1_SIZE - 0x00000400
|
||||
RAM_INTERN (rwx) : ORIGIN = MBED_CONFIGURED_RAM_BANK_IRAM1_START, LENGTH = MBED_CONFIGURED_RAM_BANK_IRAM1_SIZE
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -83,7 +83,7 @@ static const flash_algo_t flash_algo_config = {
|
|||
};
|
||||
|
||||
static const sector_info_t sectors_info[] = {
|
||||
{MBED_ROM_START, 0x800}, // (start, sector size)
|
||||
{MBED_ROM_BANK_IROM1_START, 0x800}, // (start, sector size)
|
||||
};
|
||||
|
||||
/* Secure flash */
|
||||
|
@ -91,8 +91,8 @@ static const flash_target_config_t flash_target_config = {
|
|||
.page_size = 4, // 4 bytes
|
||||
// Here page_size is program unit, which is different
|
||||
// than FMC definition.
|
||||
.flash_start = MBED_ROM_START,
|
||||
.flash_size = MBED_ROM_SIZE,
|
||||
.flash_start = MBED_ROM_BANK_IROM1_START,
|
||||
.flash_size = MBED_ROM_BANK_IROM1_SIZE,
|
||||
.sectors = sectors_info,
|
||||
.sector_info_count = sizeof(sectors_info) / sizeof(sector_info_t)
|
||||
};
|
||||
|
|
|
@ -19,115 +19,42 @@
|
|||
#ifndef __M451_MEM_H__
|
||||
#define __M451_MEM_H__
|
||||
|
||||
/* About M451_mem.h/M451_mem.icf.h
|
||||
*
|
||||
* 1. M451_mem.h is created for centralizing memory configuration. It will be included by C/C++ files
|
||||
* and linker files (except IAR linker file).
|
||||
* 2. IAR linker doesn't support preprocessor, so M451_mem.icf.h, duplicate of M451_mem.h
|
||||
* is created for IAR linker file.
|
||||
* 3. To continue above, we name M451_mem.icf.h instead of M451_mem.icf because:
|
||||
* (1) Mbed OS build tool may mis-regard M451_mem.icf as the main linker configuration file.
|
||||
* (2) *.icf files may not be present in search directories for "include" directive. Per observation,
|
||||
* the search directories are inconsistent among normal example build and test code build. To address
|
||||
* it, we name M451_mem.icf.h instead because *.h files are always present in these builds
|
||||
* (already there or via copy).
|
||||
*/
|
||||
|
||||
/* Default memory specification
|
||||
*
|
||||
* Flash size: 256KiB
|
||||
* SRAM size: 32KiB
|
||||
*/
|
||||
|
||||
/* Resolve ROM start */
|
||||
#ifndef MBED_ROM_START
|
||||
#define MBED_ROM_START (0x0)
|
||||
/* Physical IROM1 start/size */
|
||||
#if !defined(MBED_ROM_BANK_IROM1_START)
|
||||
#define MBED_ROM_BANK_IROM1_START 0x0
|
||||
#endif
|
||||
#if !defined(MBED_ROM_BANK_IROM1_SIZE)
|
||||
#define MBED_ROM_BANK_IROM1_SIZE 0x40000
|
||||
#endif
|
||||
|
||||
/* Physical IRAM1 start/size */
|
||||
#if !defined(MBED_RAM_BANK_IRAM1_START)
|
||||
#define MBED_RAM_BANK_IRAM1_START 0x20000000
|
||||
#endif
|
||||
#if !defined(MBED_RAM_BANK_IRAM1_SIZE)
|
||||
#define MBED_RAM_BANK_IRAM1_SIZE 0x8000
|
||||
#endif
|
||||
|
||||
/* Resolve ROM size */
|
||||
#ifndef MBED_ROM_SIZE
|
||||
#define MBED_ROM_SIZE (0x40000)
|
||||
/* Configured IROM1 start/size */
|
||||
#if !defined(MBED_CONFIGURED_ROM_BANK_IROM1_START)
|
||||
#define MBED_CONFIGURED_ROM_BANK_IROM1_START MBED_ROM_BANK_IROM1_START
|
||||
#endif
|
||||
#if !defined(MBED_CONFIGURED_ROM_BANK_IROM1_SIZE)
|
||||
#define MBED_CONFIGURED_ROM_BANK_IROM1_SIZE MBED_ROM_BANK_IROM1_SIZE
|
||||
#endif
|
||||
|
||||
/* Resolve RAM start */
|
||||
#ifndef MBED_RAM_START
|
||||
#define MBED_RAM_START (0x20000000)
|
||||
/* Configured IRAM1 start/size */
|
||||
#if !defined(MBED_CONFIGURED_RAM_BANK_IRAM1_START)
|
||||
#define MBED_CONFIGURED_RAM_BANK_IRAM1_START MBED_RAM_BANK_IRAM1_START
|
||||
#endif
|
||||
|
||||
/* Resolve RAM size */
|
||||
#ifndef MBED_RAM_SIZE
|
||||
#define MBED_RAM_SIZE (0x8000)
|
||||
#endif
|
||||
|
||||
|
||||
/* Mbed build tool passes just APPLICATION_xxx macros to C/C++ files and just
|
||||
* MBED_APP_xxx macros to linker files even though they mean the same thing.
|
||||
* Because this file is to include by both C/C++ files and linker files, we add
|
||||
* these macros according to the others for consistency when they are missing
|
||||
* in compile or link stage. */
|
||||
|
||||
#ifndef APPLICATION_ADDR
|
||||
#ifdef MBED_APP_START
|
||||
#define APPLICATION_ADDR MBED_APP_START
|
||||
#else
|
||||
#define APPLICATION_ADDR MBED_ROM_START
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef APPLICATION_SIZE
|
||||
#ifdef MBED_APP_SIZE
|
||||
#define APPLICATION_SIZE MBED_APP_SIZE
|
||||
#else
|
||||
#define APPLICATION_SIZE MBED_ROM_SIZE
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef APPLICATION_RAM_ADDR
|
||||
#ifdef MBED_RAM_APP_START
|
||||
#define APPLICATION_RAM_ADDR MBED_RAM_APP_START
|
||||
#else
|
||||
#define APPLICATION_RAM_ADDR MBED_RAM_START
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef APPLICATION_RAM_SIZE
|
||||
#ifdef MBED_RAM_APP_SIZE
|
||||
#define APPLICATION_RAM_SIZE MBED_RAM_APP_SIZE
|
||||
#else
|
||||
#define APPLICATION_RAM_SIZE MBED_RAM_SIZE
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef MBED_APP_START
|
||||
#define MBED_APP_START APPLICATION_ADDR
|
||||
#endif
|
||||
|
||||
#ifndef MBED_APP_SIZE
|
||||
#define MBED_APP_SIZE APPLICATION_SIZE
|
||||
#endif
|
||||
|
||||
#ifndef MBED_RAM_APP_START
|
||||
#define MBED_RAM_APP_START APPLICATION_RAM_ADDR
|
||||
#endif
|
||||
|
||||
#ifndef MBED_RAM_APP_SIZE
|
||||
#define MBED_RAM_APP_SIZE APPLICATION_RAM_SIZE
|
||||
#endif
|
||||
|
||||
#if (APPLICATION_ADDR != MBED_APP_START)
|
||||
#error("APPLICATION_ADDR and MBED_APP_START are not the same!!!")
|
||||
#endif
|
||||
|
||||
#if (APPLICATION_SIZE != MBED_APP_SIZE)
|
||||
#error("APPLICATION_SIZE and MBED_APP_SIZE are not the same!!!")
|
||||
#endif
|
||||
|
||||
#if (APPLICATION_RAM_ADDR != MBED_RAM_APP_START)
|
||||
#error("APPLICATION_RAM_ADDR and MBED_RAM_APP_START are not the same!!!")
|
||||
#endif
|
||||
|
||||
#if (APPLICATION_RAM_SIZE != MBED_RAM_APP_SIZE)
|
||||
#error("APPLICATION_RAM_SIZE and MBED_RAM_APP_SIZE are not the same!!!")
|
||||
#if !defined(MBED_CONFIGURED_RAM_BANK_IRAM1_SIZE)
|
||||
#define MBED_CONFIGURED_RAM_BANK_IRAM1_SIZE MBED_RAM_BANK_IRAM1_SIZE
|
||||
#endif
|
||||
|
||||
#endif /* __M451_MEM_H__ */
|
||||
|
|
|
@ -1,115 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2020, Nuvoton Technology Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/* See M451_mem.h for documentation */
|
||||
|
||||
/* Default memory specification
|
||||
*
|
||||
* Flash size: 256KiB
|
||||
* SRAM size: 32KiB
|
||||
*/
|
||||
|
||||
/* Resolve ROM start */
|
||||
if (!isdefinedsymbol(MBED_ROM_START)) {
|
||||
define symbol MBED_ROM_START = 0x0;
|
||||
}
|
||||
|
||||
/* Resolve ROM size */
|
||||
if (!isdefinedsymbol(MBED_ROM_SIZE)) {
|
||||
define symbol MBED_ROM_SIZE = 0x40000;
|
||||
}
|
||||
|
||||
/* Resolve RAM start */
|
||||
if (!isdefinedsymbol(MBED_RAM_START)) {
|
||||
define symbol MBED_RAM_START = 0x20000000;
|
||||
}
|
||||
|
||||
/* Resolve RAM size */
|
||||
if (!isdefinedsymbol(MBED_RAM_SIZE)) {
|
||||
define symbol MBED_RAM_SIZE = 0x8000;
|
||||
}
|
||||
|
||||
/* Mbed build tool passes just APPLICATION_xxx macros to C/C++ files and just
|
||||
* MBED_APP_xxx macros to linker files even though they mean the same thing.
|
||||
* Because this file is to include by both C/C++ files and linker files, we add
|
||||
* these macros according to the others for consistency when they are missing
|
||||
* in compile or link stage. */
|
||||
|
||||
if (!isdefinedsymbol(APPLICATION_ADDR)) {
|
||||
if (isdefinedsymbol(MBED_APP_START)) {
|
||||
define symbol APPLICATION_ADDR = MBED_APP_START;
|
||||
} else {
|
||||
define symbol APPLICATION_ADDR = MBED_ROM_START;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(APPLICATION_SIZE)) {
|
||||
if (isdefinedsymbol(MBED_APP_SIZE)) {
|
||||
define symbol APPLICATION_SIZE = MBED_APP_SIZE;
|
||||
} else {
|
||||
define symbol APPLICATION_SIZE = MBED_ROM_SIZE;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(APPLICATION_RAM_ADDR)) {
|
||||
if (isdefinedsymbol(MBED_RAM_APP_START)) {
|
||||
define symbol APPLICATION_RAM_ADDR = MBED_RAM_APP_START;
|
||||
} else {
|
||||
define symbol APPLICATION_RAM_ADDR = MBED_RAM_START;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(APPLICATION_RAM_SIZE)) {
|
||||
if (isdefinedsymbol(MBED_RAM_APP_SIZE)) {
|
||||
define symbol APPLICATION_RAM_SIZE = MBED_RAM_APP_SIZE;
|
||||
} else {
|
||||
define symbol APPLICATION_RAM_SIZE = MBED_RAM_SIZE;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(MBED_APP_START)) {
|
||||
define symbol MBED_APP_START = APPLICATION_ADDR;
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(MBED_APP_SIZE)) {
|
||||
define symbol MBED_APP_SIZE = APPLICATION_SIZE;
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(MBED_RAM_APP_START)) {
|
||||
define symbol MBED_RAM_APP_START = APPLICATION_RAM_ADDR;
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(MBED_RAM_APP_SIZE)) {
|
||||
define symbol MBED_RAM_APP_SIZE = APPLICATION_RAM_SIZE;
|
||||
}
|
||||
|
||||
if (APPLICATION_ADDR != MBED_APP_START) {
|
||||
error "APPLICATION_ADDR and MBED_APP_START are not the same!!!";
|
||||
}
|
||||
|
||||
if (APPLICATION_SIZE != MBED_APP_SIZE) {
|
||||
error "APPLICATION_SIZE and MBED_APP_SIZE are not the same!!!";
|
||||
}
|
||||
|
||||
if (APPLICATION_RAM_ADDR != MBED_RAM_APP_START) {
|
||||
error "APPLICATION_RAM_ADDR and MBED_RAM_APP_START are not the same!!!";
|
||||
}
|
||||
|
||||
if (APPLICATION_RAM_SIZE != MBED_RAM_APP_SIZE) {
|
||||
error "APPLICATION_RAM_SIZE and MBED_RAM_APP_SIZE are not the same!!!";
|
||||
}
|
|
@ -34,9 +34,9 @@ StackSize = MBED_CONF_TARGET_BOOT_STACK_SIZE;
|
|||
|
||||
MEMORY
|
||||
{
|
||||
VECTORS (rx) : ORIGIN = MBED_APP_START, LENGTH = 0x400
|
||||
FLASH (rx) : ORIGIN = MBED_APP_START + 0x400, LENGTH = MBED_APP_SIZE - 0x400
|
||||
RAM_INTERN (rwx) : ORIGIN = MBED_RAM_APP_START, LENGTH = MBED_RAM_APP_SIZE
|
||||
VECTORS (rx) : ORIGIN = MBED_CONFIGURED_ROM_BANK_IROM1_START, LENGTH = 0x400
|
||||
FLASH (rx) : ORIGIN = MBED_CONFIGURED_ROM_BANK_IROM1_START + 0x400, LENGTH = MBED_CONFIGURED_ROM_BANK_IROM1_SIZE - 0x400
|
||||
RAM_INTERN (rwx) : ORIGIN = MBED_CONFIGURED_RAM_BANK_IRAM1_START, LENGTH = MBED_CONFIGURED_RAM_BANK_IRAM1_SIZE
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -63,14 +63,14 @@ static const flash_algo_t flash_algo_config = {
|
|||
};
|
||||
|
||||
static const sector_info_t sectors_info[] = {
|
||||
{MBED_ROM_START, 0x800}, // (start, sector size)
|
||||
{MBED_ROM_BANK_IROM1_START, 0x800}, // (start, sector size)
|
||||
};
|
||||
|
||||
static const flash_target_config_t flash_target_config = {
|
||||
.page_size = 4, // 4 bytes
|
||||
// Here page_size is program unit, which is different than FMC definition.
|
||||
.flash_start = MBED_ROM_START,
|
||||
.flash_size = MBED_ROM_SIZE,
|
||||
.flash_start = MBED_ROM_BANK_IROM1_START,
|
||||
.flash_size = MBED_ROM_BANK_IROM1_SIZE,
|
||||
.sectors = sectors_info,
|
||||
.sector_info_count = sizeof(sectors_info) / sizeof(sector_info_t)
|
||||
};
|
||||
|
|
|
@ -19,115 +19,58 @@
|
|||
#ifndef __M460_MEM_H__
|
||||
#define __M460_MEM_H__
|
||||
|
||||
/* About M460_mem.h/M460_mem.icf.h
|
||||
*
|
||||
* 1. M460_mem.h is created for centralizing memory configuration. It will be included by C/C++ files
|
||||
* and linker files (except IAR linker file).
|
||||
* 2. IAR linker doesn't support preprocessor, so M460_mem.icf.h, duplicate of M460_mem.h
|
||||
* is created for IAR linker file.
|
||||
* 3. To continue above, we name M460_mem.icf.h instead of M460_mem.icf because:
|
||||
* (1) Mbed OS build tool may mis-regard M460_mem.icf as the main linker configuration file.
|
||||
* (2) *.icf files may not be present in search directories for "include" directive. Per observation,
|
||||
* the search directories are inconsistent among normal example build and test code build. To address
|
||||
* it, we name M460_mem.icf.h instead because *.h files are always present in these builds
|
||||
* (already there or via copy).
|
||||
*/
|
||||
|
||||
/* Default memory specification
|
||||
*
|
||||
* Flash size: 1024KiB
|
||||
* SRAM size: 512KiB
|
||||
*/
|
||||
|
||||
/* Resolve ROM start */
|
||||
#ifndef MBED_ROM_START
|
||||
#define MBED_ROM_START (0x0)
|
||||
/* Physical IROM1 start/size */
|
||||
#if !defined(MBED_ROM_BANK_IROM1_START)
|
||||
#define MBED_ROM_BANK_IROM1_START 0x0
|
||||
#endif
|
||||
#if !defined(MBED_ROM_BANK_IROM1_SIZE)
|
||||
#define MBED_ROM_BANK_IROM1_SIZE 0x100000
|
||||
#endif
|
||||
|
||||
/* Physical IRAM1 start/size */
|
||||
#if !defined(MBED_RAM_BANK_IRAM1_START)
|
||||
#define MBED_RAM_BANK_IRAM1_START 0x20000000
|
||||
#endif
|
||||
#if !defined(MBED_RAM_BANK_IRAM1_SIZE)
|
||||
#define MBED_RAM_BANK_IRAM1_SIZE 0x80000
|
||||
#endif
|
||||
|
||||
/* Resolve ROM size */
|
||||
#ifndef MBED_ROM_SIZE
|
||||
#define MBED_ROM_SIZE (0x100000)
|
||||
/* Configured IROM1 start/size */
|
||||
#if !defined(MBED_CONFIGURED_ROM_BANK_IROM1_START)
|
||||
#define MBED_CONFIGURED_ROM_BANK_IROM1_START MBED_ROM_BANK_IROM1_START
|
||||
#endif
|
||||
#if !defined(MBED_CONFIGURED_ROM_BANK_IROM1_SIZE)
|
||||
#define MBED_CONFIGURED_ROM_BANK_IROM1_SIZE MBED_ROM_BANK_IROM1_SIZE
|
||||
#endif
|
||||
|
||||
/* Configured IRAM1 start/size */
|
||||
#if !defined(MBED_CONFIGURED_RAM_BANK_IRAM1_START)
|
||||
#define MBED_CONFIGURED_RAM_BANK_IRAM1_START MBED_RAM_BANK_IRAM1_START
|
||||
#endif
|
||||
#if !defined(MBED_CONFIGURED_RAM_BANK_IRAM1_SIZE)
|
||||
#define MBED_CONFIGURED_RAM_BANK_IRAM1_SIZE MBED_RAM_BANK_IRAM1_SIZE
|
||||
#endif
|
||||
|
||||
/* Resolve RAM start */
|
||||
#ifndef MBED_RAM_START
|
||||
#define MBED_RAM_START (0x20000000)
|
||||
/* Physical HYPERRAM1 start/size */
|
||||
#if !defined(MBED_RAM_BANK_HYPERRAM1_START)
|
||||
#define MBED_RAM_BANK_HYPERRAM1_START 0x80000000
|
||||
#endif
|
||||
#if !defined(MBED_RAM_BANK_HYPERRAM1_SIZE)
|
||||
#define MBED_RAM_BANK_HYPERRAM1_SIZE 0x800000
|
||||
#endif
|
||||
|
||||
/* Resolve RAM size */
|
||||
#ifndef MBED_RAM_SIZE
|
||||
#define MBED_RAM_SIZE (0x80000)
|
||||
/* Configured HYPERRAM1 start/size */
|
||||
#if !defined(MBED_CONFIGURED_RAM_BANK_HYPERRAM1_START)
|
||||
#define MBED_CONFIGURED_RAM_BANK_HYPERRAM1_START MBED_RAM_BANK_HYPERRAM1_START
|
||||
#endif
|
||||
|
||||
|
||||
/* Mbed build tool passes just APPLICATION_xxx macros to C/C++ files and just
|
||||
* MBED_APP_xxx macros to linker files even though they mean the same thing.
|
||||
* Because this file is to include by both C/C++ files and linker files, we add
|
||||
* these macros according to the others for consistency when they are missing
|
||||
* in compile or link stage. */
|
||||
|
||||
#ifndef APPLICATION_ADDR
|
||||
#ifdef MBED_APP_START
|
||||
#define APPLICATION_ADDR MBED_APP_START
|
||||
#else
|
||||
#define APPLICATION_ADDR MBED_ROM_START
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef APPLICATION_SIZE
|
||||
#ifdef MBED_APP_SIZE
|
||||
#define APPLICATION_SIZE MBED_APP_SIZE
|
||||
#else
|
||||
#define APPLICATION_SIZE MBED_ROM_SIZE
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef APPLICATION_RAM_ADDR
|
||||
#ifdef MBED_RAM_APP_START
|
||||
#define APPLICATION_RAM_ADDR MBED_RAM_APP_START
|
||||
#else
|
||||
#define APPLICATION_RAM_ADDR MBED_RAM_START
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef APPLICATION_RAM_SIZE
|
||||
#ifdef MBED_RAM_APP_SIZE
|
||||
#define APPLICATION_RAM_SIZE MBED_RAM_APP_SIZE
|
||||
#else
|
||||
#define APPLICATION_RAM_SIZE MBED_RAM_SIZE
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef MBED_APP_START
|
||||
#define MBED_APP_START APPLICATION_ADDR
|
||||
#endif
|
||||
|
||||
#ifndef MBED_APP_SIZE
|
||||
#define MBED_APP_SIZE APPLICATION_SIZE
|
||||
#endif
|
||||
|
||||
#ifndef MBED_RAM_APP_START
|
||||
#define MBED_RAM_APP_START APPLICATION_RAM_ADDR
|
||||
#endif
|
||||
|
||||
#ifndef MBED_RAM_APP_SIZE
|
||||
#define MBED_RAM_APP_SIZE APPLICATION_RAM_SIZE
|
||||
#endif
|
||||
|
||||
#if (APPLICATION_ADDR != MBED_APP_START)
|
||||
#error("APPLICATION_ADDR and MBED_APP_START are not the same!!!")
|
||||
#endif
|
||||
|
||||
#if (APPLICATION_SIZE != MBED_APP_SIZE)
|
||||
#error("APPLICATION_SIZE and MBED_APP_SIZE are not the same!!!")
|
||||
#endif
|
||||
|
||||
#if (APPLICATION_RAM_ADDR != MBED_RAM_APP_START)
|
||||
#error("APPLICATION_RAM_ADDR and MBED_RAM_APP_START are not the same!!!")
|
||||
#endif
|
||||
|
||||
#if (APPLICATION_RAM_SIZE != MBED_RAM_APP_SIZE)
|
||||
#error("APPLICATION_RAM_SIZE and MBED_RAM_APP_SIZE are not the same!!!")
|
||||
#if !defined(MBED_CONFIGURED_RAM_BANK_HYPERRAM1_SIZE)
|
||||
#define MBED_CONFIGURED_RAM_BANK_HYPERRAM1_SIZE MBED_RAM_BANK_HYPERRAM1_SIZE
|
||||
#endif
|
||||
|
||||
#endif /* __M460_MEM_H__ */
|
||||
|
|
|
@ -1,115 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2022, Nuvoton Technology Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/* See M460_mem.h for documentation */
|
||||
|
||||
/* Default memory specification
|
||||
*
|
||||
* Flash size: 1024KiB
|
||||
* SRAM size: 512KiB
|
||||
*/
|
||||
|
||||
/* Resolve ROM start */
|
||||
if (!isdefinedsymbol(MBED_ROM_START)) {
|
||||
define symbol MBED_ROM_START = 0x0;
|
||||
}
|
||||
|
||||
/* Resolve ROM size */
|
||||
if (!isdefinedsymbol(MBED_ROM_SIZE)) {
|
||||
define symbol MBED_ROM_SIZE = 0x100000;
|
||||
}
|
||||
|
||||
/* Resolve RAM start */
|
||||
if (!isdefinedsymbol(MBED_RAM_START)) {
|
||||
define symbol MBED_RAM_START = 0x20000000;
|
||||
}
|
||||
|
||||
/* Resolve RAM size */
|
||||
if (!isdefinedsymbol(MBED_RAM_SIZE)) {
|
||||
define symbol MBED_RAM_SIZE = 0x80000;
|
||||
}
|
||||
|
||||
/* Mbed build tool passes just APPLICATION_xxx macros to C/C++ files and just
|
||||
* MBED_APP_xxx macros to linker files even though they mean the same thing.
|
||||
* Because this file is to include by both C/C++ files and linker files, we add
|
||||
* these macros according to the others for consistency when they are missing
|
||||
* in compile or link stage. */
|
||||
|
||||
if (!isdefinedsymbol(APPLICATION_ADDR)) {
|
||||
if (isdefinedsymbol(MBED_APP_START)) {
|
||||
define symbol APPLICATION_ADDR = MBED_APP_START;
|
||||
} else {
|
||||
define symbol APPLICATION_ADDR = MBED_ROM_START;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(APPLICATION_SIZE)) {
|
||||
if (isdefinedsymbol(MBED_APP_SIZE)) {
|
||||
define symbol APPLICATION_SIZE = MBED_APP_SIZE;
|
||||
} else {
|
||||
define symbol APPLICATION_SIZE = MBED_ROM_SIZE;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(APPLICATION_RAM_ADDR)) {
|
||||
if (isdefinedsymbol(MBED_RAM_APP_START)) {
|
||||
define symbol APPLICATION_RAM_ADDR = MBED_RAM_APP_START;
|
||||
} else {
|
||||
define symbol APPLICATION_RAM_ADDR = MBED_RAM_START;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(APPLICATION_RAM_SIZE)) {
|
||||
if (isdefinedsymbol(MBED_RAM_APP_SIZE)) {
|
||||
define symbol APPLICATION_RAM_SIZE = MBED_RAM_APP_SIZE;
|
||||
} else {
|
||||
define symbol APPLICATION_RAM_SIZE = MBED_RAM_SIZE;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(MBED_APP_START)) {
|
||||
define symbol MBED_APP_START = APPLICATION_ADDR;
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(MBED_APP_SIZE)) {
|
||||
define symbol MBED_APP_SIZE = APPLICATION_SIZE;
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(MBED_RAM_APP_START)) {
|
||||
define symbol MBED_RAM_APP_START = APPLICATION_RAM_ADDR;
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(MBED_RAM_APP_SIZE)) {
|
||||
define symbol MBED_RAM_APP_SIZE = APPLICATION_RAM_SIZE;
|
||||
}
|
||||
|
||||
if (APPLICATION_ADDR != MBED_APP_START) {
|
||||
error "APPLICATION_ADDR and MBED_APP_START are not the same!!!";
|
||||
}
|
||||
|
||||
if (APPLICATION_SIZE != MBED_APP_SIZE) {
|
||||
error "APPLICATION_SIZE and MBED_APP_SIZE are not the same!!!";
|
||||
}
|
||||
|
||||
if (APPLICATION_RAM_ADDR != MBED_RAM_APP_START) {
|
||||
error "APPLICATION_RAM_ADDR and MBED_RAM_APP_START are not the same!!!";
|
||||
}
|
||||
|
||||
if (APPLICATION_RAM_SIZE != MBED_RAM_APP_SIZE) {
|
||||
error "APPLICATION_RAM_SIZE and MBED_RAM_APP_SIZE are not the same!!!";
|
||||
}
|
|
@ -30,23 +30,15 @@
|
|||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(NU_HYPERRAM_START)
|
||||
#define NU_HYPERRAM_START 0x80000000
|
||||
#endif
|
||||
|
||||
#if !defined(NU_HYPERRAM_SIZE)
|
||||
#define NU_HYPERRAM_SIZE 0x800000
|
||||
#endif
|
||||
|
||||
M_CRASH_DATA_RAM_SIZE = 0x100;
|
||||
StackSize = MBED_CONF_TARGET_BOOT_STACK_SIZE;
|
||||
|
||||
MEMORY
|
||||
{
|
||||
VECTORS (rx) : ORIGIN = MBED_APP_START, LENGTH = 0x00000400
|
||||
FLASH (rx) : ORIGIN = MBED_APP_START + 0x400, LENGTH = MBED_APP_SIZE - 0x00000400
|
||||
RAM_INTERN (rwx) : ORIGIN = MBED_RAM_APP_START, LENGTH = MBED_RAM_APP_SIZE
|
||||
HYPERRAM (rwx) : ORIGIN = NU_HYPERRAM_START, LENGTH = NU_HYPERRAM_SIZE
|
||||
VECTORS (rx) : ORIGIN = MBED_CONFIGURED_ROM_BANK_IROM1_START, LENGTH = 0x00000400
|
||||
FLASH (rx) : ORIGIN = MBED_CONFIGURED_ROM_BANK_IROM1_START + 0x400, LENGTH = MBED_CONFIGURED_ROM_BANK_IROM1_SIZE - 0x00000400
|
||||
RAM_INTERN (rwx) : ORIGIN = MBED_CONFIGURED_RAM_BANK_IRAM1_START, LENGTH = MBED_CONFIGURED_RAM_BANK_IRAM1_SIZE
|
||||
HYPERRAM (rwx) : ORIGIN = MBED_CONFIGURED_RAM_BANK_HYPERRAM1_START, LENGTH = MBED_CONFIGURED_RAM_BANK_HYPERRAM1_SIZE
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -57,14 +57,14 @@ static const flash_algo_t flash_algo_config = {
|
|||
};
|
||||
|
||||
static const sector_info_t sectors_info[] = {
|
||||
{MBED_ROM_START, 0x1000}, // (start, sector size)
|
||||
{MBED_ROM_BANK_IROM1_START, 0x1000}, // (start, sector size)
|
||||
};
|
||||
|
||||
static const flash_target_config_t flash_target_config = {
|
||||
.page_size = 4, // 4 bytes
|
||||
// Here page_size is program unit, which is different than FMC definition.
|
||||
.flash_start = MBED_ROM_START,
|
||||
.flash_size = MBED_ROM_SIZE,
|
||||
.flash_start = MBED_ROM_BANK_IROM1_START,
|
||||
.flash_size = MBED_ROM_BANK_IROM1_SIZE,
|
||||
.sectors = sectors_info,
|
||||
.sector_info_count = sizeof(sectors_info) / sizeof(sector_info_t)
|
||||
};
|
||||
|
|
|
@ -19,115 +19,42 @@
|
|||
#ifndef __M480_MEM_H__
|
||||
#define __M480_MEM_H__
|
||||
|
||||
/* About M480_mem.h/M480_mem.icf.h
|
||||
*
|
||||
* 1. M480_mem.h is created for centralizing memory configuration. It will be included by C/C++ files
|
||||
* and linker files (except IAR linker file).
|
||||
* 2. IAR linker doesn't support preprocessor, so M480_mem.icf.h, duplicate of M480_mem.h
|
||||
* is created for IAR linker file.
|
||||
* 3. To continue above, we name M480_mem.icf.h instead of M480_mem.icf because:
|
||||
* (1) Mbed OS build tool may mis-regard M480_mem.icf as the main linker configuration file.
|
||||
* (2) *.icf files may not be present in search directories for "include" directive. Per observation,
|
||||
* the search directories are inconsistent among normal example build and test code build. To address
|
||||
* it, we name M480_mem.icf.h instead because *.h files are always present in these builds
|
||||
* (already there or via copy).
|
||||
*/
|
||||
|
||||
/* Default memory specification
|
||||
*
|
||||
* Flash size: 512KiB
|
||||
* SRAM size: 160KiB = 128KiB + 32KiB (SPIM CCM)
|
||||
*/
|
||||
|
||||
/* Resolve ROM start */
|
||||
#ifndef MBED_ROM_START
|
||||
#define MBED_ROM_START (0x0)
|
||||
/* Physical IROM1 start/size */
|
||||
#if !defined(MBED_ROM_BANK_IROM1_START)
|
||||
#define MBED_ROM_BANK_IROM1_START 0x0
|
||||
#endif
|
||||
#if !defined(MBED_ROM_BANK_IROM1_SIZE)
|
||||
#define MBED_ROM_BANK_IROM1_SIZE 0x80000
|
||||
#endif
|
||||
|
||||
/* Physical IRAM1 start/size */
|
||||
#if !defined(MBED_RAM_BANK_IRAM1_START)
|
||||
#define MBED_RAM_BANK_IRAM1_START 0x20000000
|
||||
#endif
|
||||
#if !defined(MBED_RAM_BANK_IRAM1_SIZE)
|
||||
#define MBED_RAM_BANK_IRAM1_SIZE 0x28000
|
||||
#endif
|
||||
|
||||
/* Resolve ROM size */
|
||||
#ifndef MBED_ROM_SIZE
|
||||
#define MBED_ROM_SIZE (0x80000)
|
||||
/* Configured IROM1 start/size */
|
||||
#if !defined(MBED_CONFIGURED_ROM_BANK_IROM1_START)
|
||||
#define MBED_CONFIGURED_ROM_BANK_IROM1_START MBED_ROM_BANK_IROM1_START
|
||||
#endif
|
||||
#if !defined(MBED_CONFIGURED_ROM_BANK_IROM1_SIZE)
|
||||
#define MBED_CONFIGURED_ROM_BANK_IROM1_SIZE MBED_ROM_BANK_IROM1_SIZE
|
||||
#endif
|
||||
|
||||
/* Resolve RAM start */
|
||||
#ifndef MBED_RAM_START
|
||||
#define MBED_RAM_START (0x20000000)
|
||||
/* Configured IRAM1 start/size */
|
||||
#if !defined(MBED_CONFIGURED_RAM_BANK_IRAM1_START)
|
||||
#define MBED_CONFIGURED_RAM_BANK_IRAM1_START MBED_RAM_BANK_IRAM1_START
|
||||
#endif
|
||||
|
||||
/* Resolve RAM size */
|
||||
#ifndef MBED_RAM_SIZE
|
||||
#define MBED_RAM_SIZE (0x28000)
|
||||
#endif
|
||||
|
||||
|
||||
/* Mbed build tool passes just APPLICATION_xxx macros to C/C++ files and just
|
||||
* MBED_APP_xxx macros to linker files even though they mean the same thing.
|
||||
* Because this file is to include by both C/C++ files and linker files, we add
|
||||
* these macros according to the others for consistency when they are missing
|
||||
* in compile or link stage. */
|
||||
|
||||
#ifndef APPLICATION_ADDR
|
||||
#ifdef MBED_APP_START
|
||||
#define APPLICATION_ADDR MBED_APP_START
|
||||
#else
|
||||
#define APPLICATION_ADDR MBED_ROM_START
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef APPLICATION_SIZE
|
||||
#ifdef MBED_APP_SIZE
|
||||
#define APPLICATION_SIZE MBED_APP_SIZE
|
||||
#else
|
||||
#define APPLICATION_SIZE MBED_ROM_SIZE
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef APPLICATION_RAM_ADDR
|
||||
#ifdef MBED_RAM_APP_START
|
||||
#define APPLICATION_RAM_ADDR MBED_RAM_APP_START
|
||||
#else
|
||||
#define APPLICATION_RAM_ADDR MBED_RAM_START
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef APPLICATION_RAM_SIZE
|
||||
#ifdef MBED_RAM_APP_SIZE
|
||||
#define APPLICATION_RAM_SIZE MBED_RAM_APP_SIZE
|
||||
#else
|
||||
#define APPLICATION_RAM_SIZE MBED_RAM_SIZE
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef MBED_APP_START
|
||||
#define MBED_APP_START APPLICATION_ADDR
|
||||
#endif
|
||||
|
||||
#ifndef MBED_APP_SIZE
|
||||
#define MBED_APP_SIZE APPLICATION_SIZE
|
||||
#endif
|
||||
|
||||
#ifndef MBED_RAM_APP_START
|
||||
#define MBED_RAM_APP_START APPLICATION_RAM_ADDR
|
||||
#endif
|
||||
|
||||
#ifndef MBED_RAM_APP_SIZE
|
||||
#define MBED_RAM_APP_SIZE APPLICATION_RAM_SIZE
|
||||
#endif
|
||||
|
||||
#if (APPLICATION_ADDR != MBED_APP_START)
|
||||
#error("APPLICATION_ADDR and MBED_APP_START are not the same!!!")
|
||||
#endif
|
||||
|
||||
#if (APPLICATION_SIZE != MBED_APP_SIZE)
|
||||
#error("APPLICATION_SIZE and MBED_APP_SIZE are not the same!!!")
|
||||
#endif
|
||||
|
||||
#if (APPLICATION_RAM_ADDR != MBED_RAM_APP_START)
|
||||
#error("APPLICATION_RAM_ADDR and MBED_RAM_APP_START are not the same!!!")
|
||||
#endif
|
||||
|
||||
#if (APPLICATION_RAM_SIZE != MBED_RAM_APP_SIZE)
|
||||
#error("APPLICATION_RAM_SIZE and MBED_RAM_APP_SIZE are not the same!!!")
|
||||
#if !defined(MBED_CONFIGURED_RAM_BANK_IRAM1_SIZE)
|
||||
#define MBED_CONFIGURED_RAM_BANK_IRAM1_SIZE MBED_RAM_BANK_IRAM1_SIZE
|
||||
#endif
|
||||
|
||||
#endif /* __M480_MEM_H__ */
|
||||
|
|
|
@ -1,115 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2020, Nuvoton Technology Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/* See M480_mem.h for documentation */
|
||||
|
||||
/* Default memory specification
|
||||
*
|
||||
* Flash size: 512KiB
|
||||
* SRAM size: 160KiB = 128KiB + 32KiB (SPIM CCM)
|
||||
*/
|
||||
|
||||
/* Resolve ROM start */
|
||||
if (!isdefinedsymbol(MBED_ROM_START)) {
|
||||
define symbol MBED_ROM_START = 0x0;
|
||||
}
|
||||
|
||||
/* Resolve ROM size */
|
||||
if (!isdefinedsymbol(MBED_ROM_SIZE)) {
|
||||
define symbol MBED_ROM_SIZE = 0x80000;
|
||||
}
|
||||
|
||||
/* Resolve RAM start */
|
||||
if (!isdefinedsymbol(MBED_RAM_START)) {
|
||||
define symbol MBED_RAM_START = 0x20000000;
|
||||
}
|
||||
|
||||
/* Resolve RAM size */
|
||||
if (!isdefinedsymbol(MBED_RAM_SIZE)) {
|
||||
define symbol MBED_RAM_SIZE = 0x28000;
|
||||
}
|
||||
|
||||
/* Mbed build tool passes just APPLICATION_xxx macros to C/C++ files and just
|
||||
* MBED_APP_xxx macros to linker files even though they mean the same thing.
|
||||
* Because this file is to include by both C/C++ files and linker files, we add
|
||||
* these macros according to the others for consistency when they are missing
|
||||
* in compile or link stage. */
|
||||
|
||||
if (!isdefinedsymbol(APPLICATION_ADDR)) {
|
||||
if (isdefinedsymbol(MBED_APP_START)) {
|
||||
define symbol APPLICATION_ADDR = MBED_APP_START;
|
||||
} else {
|
||||
define symbol APPLICATION_ADDR = MBED_ROM_START;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(APPLICATION_SIZE)) {
|
||||
if (isdefinedsymbol(MBED_APP_SIZE)) {
|
||||
define symbol APPLICATION_SIZE = MBED_APP_SIZE;
|
||||
} else {
|
||||
define symbol APPLICATION_SIZE = MBED_ROM_SIZE;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(APPLICATION_RAM_ADDR)) {
|
||||
if (isdefinedsymbol(MBED_RAM_APP_START)) {
|
||||
define symbol APPLICATION_RAM_ADDR = MBED_RAM_APP_START;
|
||||
} else {
|
||||
define symbol APPLICATION_RAM_ADDR = MBED_RAM_START;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(APPLICATION_RAM_SIZE)) {
|
||||
if (isdefinedsymbol(MBED_RAM_APP_SIZE)) {
|
||||
define symbol APPLICATION_RAM_SIZE = MBED_RAM_APP_SIZE;
|
||||
} else {
|
||||
define symbol APPLICATION_RAM_SIZE = MBED_RAM_SIZE;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(MBED_APP_START)) {
|
||||
define symbol MBED_APP_START = APPLICATION_ADDR;
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(MBED_APP_SIZE)) {
|
||||
define symbol MBED_APP_SIZE = APPLICATION_SIZE;
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(MBED_RAM_APP_START)) {
|
||||
define symbol MBED_RAM_APP_START = APPLICATION_RAM_ADDR;
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(MBED_RAM_APP_SIZE)) {
|
||||
define symbol MBED_RAM_APP_SIZE = APPLICATION_RAM_SIZE;
|
||||
}
|
||||
|
||||
if (APPLICATION_ADDR != MBED_APP_START) {
|
||||
error "APPLICATION_ADDR and MBED_APP_START are not the same!!!";
|
||||
}
|
||||
|
||||
if (APPLICATION_SIZE != MBED_APP_SIZE) {
|
||||
error "APPLICATION_SIZE and MBED_APP_SIZE are not the same!!!";
|
||||
}
|
||||
|
||||
if (APPLICATION_RAM_ADDR != MBED_RAM_APP_START) {
|
||||
error "APPLICATION_RAM_ADDR and MBED_RAM_APP_START are not the same!!!";
|
||||
}
|
||||
|
||||
if (APPLICATION_RAM_SIZE != MBED_RAM_APP_SIZE) {
|
||||
error "APPLICATION_RAM_SIZE and MBED_RAM_APP_SIZE are not the same!!!";
|
||||
}
|
|
@ -35,9 +35,9 @@ StackSize = MBED_CONF_TARGET_BOOT_STACK_SIZE;
|
|||
|
||||
MEMORY
|
||||
{
|
||||
VECTORS (rx) : ORIGIN = MBED_APP_START, LENGTH = 0x00000400
|
||||
FLASH (rx) : ORIGIN = MBED_APP_START + 0x400, LENGTH = MBED_APP_SIZE - 0x00000400
|
||||
RAM_INTERN (rwx) : ORIGIN = MBED_RAM_APP_START, LENGTH = MBED_RAM_APP_SIZE
|
||||
VECTORS (rx) : ORIGIN = MBED_CONFIGURED_ROM_BANK_IROM1_START, LENGTH = 0x00000400
|
||||
FLASH (rx) : ORIGIN = MBED_CONFIGURED_ROM_BANK_IROM1_START + 0x400, LENGTH = MBED_CONFIGURED_ROM_BANK_IROM1_SIZE - 0x00000400
|
||||
RAM_INTERN (rwx) : ORIGIN = MBED_CONFIGURED_RAM_BANK_IRAM1_START, LENGTH = MBED_CONFIGURED_RAM_BANK_IRAM1_SIZE
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -68,14 +68,14 @@ static const flash_algo_t flash_algo_config = {
|
|||
};
|
||||
|
||||
static const sector_info_t sectors_info[] = {
|
||||
{MBED_ROM_START, 0x1000}, // (start, sector size)
|
||||
{MBED_ROM_BANK_IROM1_START, 0x1000}, // (start, sector size)
|
||||
};
|
||||
|
||||
static const flash_target_config_t flash_target_config = {
|
||||
.page_size = 4, // 4 bytes
|
||||
// Here page_size is program unit, which is different than FMC definition.
|
||||
.flash_start = MBED_ROM_START,
|
||||
.flash_size = MBED_ROM_SIZE,
|
||||
.flash_start = MBED_ROM_BANK_IROM1_START,
|
||||
.flash_size = MBED_ROM_BANK_IROM1_SIZE,
|
||||
.sectors = sectors_info,
|
||||
.sector_info_count = sizeof(sectors_info) / sizeof(sector_info_t)
|
||||
};
|
||||
|
|
|
@ -19,115 +19,42 @@
|
|||
#ifndef __NANO100_MEM_H__
|
||||
#define __NANO100_MEM_H__
|
||||
|
||||
/* About NANO100_mem.h/NANO100_mem.icf.h
|
||||
*
|
||||
* 1. NANO100_mem.h is created for centralizing memory configuration. It will be included by C/C++ files
|
||||
* and linker files (except IAR linker file).
|
||||
* 2. IAR linker doesn't support preprocessor, so NANO100_mem.icf.h, duplicate of NANO100_mem.h
|
||||
* is created for IAR linker file.
|
||||
* 3. To continue above, we name NANO100_mem.icf.h instead of NANO100_mem.icf because:
|
||||
* (1) Mbed OS build tool may mis-regard NANO100_mem.icf as the main linker configuration file.
|
||||
* (2) *.icf files may not be present in search directories for "include" directive. Per observation,
|
||||
* the search directories are inconsistent among normal example build and test code build. To address
|
||||
* it, we name NANO100_mem.icf.h instead because *.h files are always present in these builds
|
||||
* (already there or via copy).
|
||||
*/
|
||||
|
||||
/* Default memory specification
|
||||
*
|
||||
* Flash size: 128KiB
|
||||
* SRAM size: 16KiB
|
||||
*/
|
||||
|
||||
/* Resolve ROM start */
|
||||
#ifndef MBED_ROM_START
|
||||
#define MBED_ROM_START (0x0)
|
||||
/* Physical IROM1 start/size */
|
||||
#if !defined(MBED_ROM_BANK_IROM1_START)
|
||||
#define MBED_ROM_BANK_IROM1_START 0x0
|
||||
#endif
|
||||
#if !defined(MBED_ROM_BANK_IROM1_SIZE)
|
||||
#define MBED_ROM_BANK_IROM1_SIZE 0x20000
|
||||
#endif
|
||||
|
||||
/* Physical IRAM1 start/size */
|
||||
#if !defined(MBED_RAM_BANK_IRAM1_START)
|
||||
#define MBED_RAM_BANK_IRAM1_START 0x20000000
|
||||
#endif
|
||||
#if !defined(MBED_RAM_BANK_IRAM1_SIZE)
|
||||
#define MBED_RAM_BANK_IRAM1_SIZE 0x4000
|
||||
#endif
|
||||
|
||||
/* Resolve ROM size */
|
||||
#ifndef MBED_ROM_SIZE
|
||||
#define MBED_ROM_SIZE (0x20000)
|
||||
/* Configured IROM1 start/size */
|
||||
#if !defined(MBED_CONFIGURED_ROM_BANK_IROM1_START)
|
||||
#define MBED_CONFIGURED_ROM_BANK_IROM1_START MBED_ROM_BANK_IROM1_START
|
||||
#endif
|
||||
#if !defined(MBED_CONFIGURED_ROM_BANK_IROM1_SIZE)
|
||||
#define MBED_CONFIGURED_ROM_BANK_IROM1_SIZE MBED_ROM_BANK_IROM1_SIZE
|
||||
#endif
|
||||
|
||||
/* Resolve RAM start */
|
||||
#ifndef MBED_RAM_START
|
||||
#define MBED_RAM_START (0x20000000)
|
||||
/* Configured IRAM1 start/size */
|
||||
#if !defined(MBED_CONFIGURED_RAM_BANK_IRAM1_START)
|
||||
#define MBED_CONFIGURED_RAM_BANK_IRAM1_START MBED_RAM_BANK_IRAM1_START
|
||||
#endif
|
||||
|
||||
/* Resolve RAM size */
|
||||
#ifndef MBED_RAM_SIZE
|
||||
#define MBED_RAM_SIZE (0x4000)
|
||||
#endif
|
||||
|
||||
|
||||
/* Mbed build tool passes just APPLICATION_xxx macros to C/C++ files and just
|
||||
* MBED_APP_xxx macros to linker files even though they mean the same thing.
|
||||
* Because this file is to include by both C/C++ files and linker files, we add
|
||||
* these macros according to the others for consistency when they are missing
|
||||
* in compile or link stage. */
|
||||
|
||||
#ifndef APPLICATION_ADDR
|
||||
#ifdef MBED_APP_START
|
||||
#define APPLICATION_ADDR MBED_APP_START
|
||||
#else
|
||||
#define APPLICATION_ADDR MBED_ROM_START
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef APPLICATION_SIZE
|
||||
#ifdef MBED_APP_SIZE
|
||||
#define APPLICATION_SIZE MBED_APP_SIZE
|
||||
#else
|
||||
#define APPLICATION_SIZE MBED_ROM_SIZE
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef APPLICATION_RAM_ADDR
|
||||
#ifdef MBED_RAM_APP_START
|
||||
#define APPLICATION_RAM_ADDR MBED_RAM_APP_START
|
||||
#else
|
||||
#define APPLICATION_RAM_ADDR MBED_RAM_START
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef APPLICATION_RAM_SIZE
|
||||
#ifdef MBED_RAM_APP_SIZE
|
||||
#define APPLICATION_RAM_SIZE MBED_RAM_APP_SIZE
|
||||
#else
|
||||
#define APPLICATION_RAM_SIZE MBED_RAM_SIZE
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef MBED_APP_START
|
||||
#define MBED_APP_START APPLICATION_ADDR
|
||||
#endif
|
||||
|
||||
#ifndef MBED_APP_SIZE
|
||||
#define MBED_APP_SIZE APPLICATION_SIZE
|
||||
#endif
|
||||
|
||||
#ifndef MBED_RAM_APP_START
|
||||
#define MBED_RAM_APP_START APPLICATION_RAM_ADDR
|
||||
#endif
|
||||
|
||||
#ifndef MBED_RAM_APP_SIZE
|
||||
#define MBED_RAM_APP_SIZE APPLICATION_RAM_SIZE
|
||||
#endif
|
||||
|
||||
#if (APPLICATION_ADDR != MBED_APP_START)
|
||||
#error("APPLICATION_ADDR and MBED_APP_START are not the same!!!")
|
||||
#endif
|
||||
|
||||
#if (APPLICATION_SIZE != MBED_APP_SIZE)
|
||||
#error("APPLICATION_SIZE and MBED_APP_SIZE are not the same!!!")
|
||||
#endif
|
||||
|
||||
#if (APPLICATION_RAM_ADDR != MBED_RAM_APP_START)
|
||||
#error("APPLICATION_RAM_ADDR and MBED_RAM_APP_START are not the same!!!")
|
||||
#endif
|
||||
|
||||
#if (APPLICATION_RAM_SIZE != MBED_RAM_APP_SIZE)
|
||||
#error("APPLICATION_RAM_SIZE and MBED_RAM_APP_SIZE are not the same!!!")
|
||||
#if !defined(MBED_CONFIGURED_RAM_BANK_IRAM1_SIZE)
|
||||
#define MBED_CONFIGURED_RAM_BANK_IRAM1_SIZE MBED_RAM_BANK_IRAM1_SIZE
|
||||
#endif
|
||||
|
||||
#endif /* __NANO100_MEM_H__ */
|
||||
|
|
|
@ -1,115 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2020, Nuvoton Technology Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/* See NANO100_mem.h for documentation */
|
||||
|
||||
/* Default memory specification
|
||||
*
|
||||
* Flash size: 128KiB
|
||||
* SRAM size: 16KiB
|
||||
*/
|
||||
|
||||
/* Resolve ROM start */
|
||||
if (!isdefinedsymbol(MBED_ROM_START)) {
|
||||
define symbol MBED_ROM_START = 0x0;
|
||||
}
|
||||
|
||||
/* Resolve ROM size */
|
||||
if (!isdefinedsymbol(MBED_ROM_SIZE)) {
|
||||
define symbol MBED_ROM_SIZE = 0x20000;
|
||||
}
|
||||
|
||||
/* Resolve RAM start */
|
||||
if (!isdefinedsymbol(MBED_RAM_START)) {
|
||||
define symbol MBED_RAM_START = 0x20000000;
|
||||
}
|
||||
|
||||
/* Resolve RAM size */
|
||||
if (!isdefinedsymbol(MBED_RAM_SIZE)) {
|
||||
define symbol MBED_RAM_SIZE = 0x4000;
|
||||
}
|
||||
|
||||
/* Mbed build tool passes just APPLICATION_xxx macros to C/C++ files and just
|
||||
* MBED_APP_xxx macros to linker files even though they mean the same thing.
|
||||
* Because this file is to include by both C/C++ files and linker files, we add
|
||||
* these macros according to the others for consistency when they are missing
|
||||
* in compile or link stage. */
|
||||
|
||||
if (!isdefinedsymbol(APPLICATION_ADDR)) {
|
||||
if (isdefinedsymbol(MBED_APP_START)) {
|
||||
define symbol APPLICATION_ADDR = MBED_APP_START;
|
||||
} else {
|
||||
define symbol APPLICATION_ADDR = MBED_ROM_START;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(APPLICATION_SIZE)) {
|
||||
if (isdefinedsymbol(MBED_APP_SIZE)) {
|
||||
define symbol APPLICATION_SIZE = MBED_APP_SIZE;
|
||||
} else {
|
||||
define symbol APPLICATION_SIZE = MBED_ROM_SIZE;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(APPLICATION_RAM_ADDR)) {
|
||||
if (isdefinedsymbol(MBED_RAM_APP_START)) {
|
||||
define symbol APPLICATION_RAM_ADDR = MBED_RAM_APP_START;
|
||||
} else {
|
||||
define symbol APPLICATION_RAM_ADDR = MBED_RAM_START;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(APPLICATION_RAM_SIZE)) {
|
||||
if (isdefinedsymbol(MBED_RAM_APP_SIZE)) {
|
||||
define symbol APPLICATION_RAM_SIZE = MBED_RAM_APP_SIZE;
|
||||
} else {
|
||||
define symbol APPLICATION_RAM_SIZE = MBED_RAM_SIZE;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(MBED_APP_START)) {
|
||||
define symbol MBED_APP_START = APPLICATION_ADDR;
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(MBED_APP_SIZE)) {
|
||||
define symbol MBED_APP_SIZE = APPLICATION_SIZE;
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(MBED_RAM_APP_START)) {
|
||||
define symbol MBED_RAM_APP_START = APPLICATION_RAM_ADDR;
|
||||
}
|
||||
|
||||
if (!isdefinedsymbol(MBED_RAM_APP_SIZE)) {
|
||||
define symbol MBED_RAM_APP_SIZE = APPLICATION_RAM_SIZE;
|
||||
}
|
||||
|
||||
if (APPLICATION_ADDR != MBED_APP_START) {
|
||||
error "APPLICATION_ADDR and MBED_APP_START are not the same!!!";
|
||||
}
|
||||
|
||||
if (APPLICATION_SIZE != MBED_APP_SIZE) {
|
||||
error "APPLICATION_SIZE and MBED_APP_SIZE are not the same!!!";
|
||||
}
|
||||
|
||||
if (APPLICATION_RAM_ADDR != MBED_RAM_APP_START) {
|
||||
error "APPLICATION_RAM_ADDR and MBED_RAM_APP_START are not the same!!!";
|
||||
}
|
||||
|
||||
if (APPLICATION_RAM_SIZE != MBED_RAM_APP_SIZE) {
|
||||
error "APPLICATION_RAM_SIZE and MBED_RAM_APP_SIZE are not the same!!!";
|
||||
}
|
|
@ -34,9 +34,9 @@ StackSize = MBED_CONF_TARGET_BOOT_STACK_SIZE;
|
|||
|
||||
MEMORY
|
||||
{
|
||||
VECTORS (rx) : ORIGIN = MBED_APP_START, LENGTH = 0x400
|
||||
FLASH (rx) : ORIGIN = MBED_APP_START + 0x400, LENGTH = MBED_APP_SIZE - 0x400
|
||||
RAM_INTERN (rwx) : ORIGIN = MBED_RAM_APP_START, LENGTH = MBED_RAM_APP_SIZE
|
||||
VECTORS (rx) : ORIGIN = MBED_CONFIGURED_ROM_BANK_IROM1_START, LENGTH = 0x400
|
||||
FLASH (rx) : ORIGIN = MBED_CONFIGURED_ROM_BANK_IROM1_START + 0x400, LENGTH = MBED_CONFIGURED_ROM_BANK_IROM1_SIZE - 0x400
|
||||
RAM_INTERN (rwx) : ORIGIN = MBED_CONFIGURED_RAM_BANK_IRAM1_START, LENGTH = MBED_CONFIGURED_RAM_BANK_IRAM1_SIZE
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -0,0 +1,76 @@
|
|||
/*
|
||||
* Copyright (c) 2022, Nuvoton Technology Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef __NUC472_MEM_H__
|
||||
#define __NUC472_MEM_H__
|
||||
|
||||
/* Default memory specification
|
||||
*
|
||||
* Flash size: 512KiB
|
||||
* SRAM size: 64KiB
|
||||
*/
|
||||
|
||||
/* Physical IROM1 start/size */
|
||||
#if !defined(MBED_ROM_BANK_IROM1_START)
|
||||
#define MBED_ROM_BANK_IROM1_START 0x0
|
||||
#endif
|
||||
#if !defined(MBED_ROM_BANK_IROM1_SIZE)
|
||||
#define MBED_ROM_BANK_IROM1_SIZE 0x80000
|
||||
#endif
|
||||
|
||||
/* Physical IRAM1 start/size */
|
||||
#if !defined(MBED_RAM_BANK_IRAM1_START)
|
||||
#define MBED_RAM_BANK_IRAM1_START 0x20000000
|
||||
#endif
|
||||
#if !defined(MBED_RAM_BANK_IRAM1_SIZE)
|
||||
#define MBED_RAM_BANK_IRAM1_SIZE 0x10000
|
||||
#endif
|
||||
|
||||
/* Configured IROM1 start/size */
|
||||
#if !defined(MBED_CONFIGURED_ROM_BANK_IROM1_START)
|
||||
#define MBED_CONFIGURED_ROM_BANK_IROM1_START MBED_ROM_BANK_IROM1_START
|
||||
#endif
|
||||
#if !defined(MBED_CONFIGURED_ROM_BANK_IROM1_SIZE)
|
||||
#define MBED_CONFIGURED_ROM_BANK_IROM1_SIZE MBED_ROM_BANK_IROM1_SIZE
|
||||
#endif
|
||||
|
||||
/* Configured IRAM1 start/size */
|
||||
#if !defined(MBED_CONFIGURED_RAM_BANK_IRAM1_START)
|
||||
#define MBED_CONFIGURED_RAM_BANK_IRAM1_START MBED_RAM_BANK_IRAM1_START
|
||||
#endif
|
||||
#if !defined(MBED_CONFIGURED_RAM_BANK_IRAM1_SIZE)
|
||||
#define MBED_CONFIGURED_RAM_BANK_IRAM1_SIZE MBED_RAM_BANK_IRAM1_SIZE
|
||||
#endif
|
||||
|
||||
/* Physical XRAM1 start/size */
|
||||
#if !defined(MBED_RAM_BANK_XRAM1_START)
|
||||
#define MBED_RAM_BANK_XRAM1_START 0x60000000
|
||||
#endif
|
||||
#if !defined(MBED_RAM_BANK_XRAM1_SIZE)
|
||||
#define MBED_RAM_BANK_XRAM1_SIZE 0x100000
|
||||
#endif
|
||||
|
||||
/* Configured XRAM1 start/size */
|
||||
#if !defined(MBED_CONFIGURED_RAM_BANK_XRAM1_START)
|
||||
#define MBED_CONFIGURED_RAM_BANK_XRAM1_START MBED_RAM_BANK_XRAM1_START
|
||||
#endif
|
||||
#if !defined(MBED_CONFIGURED_RAM_BANK_XRAM1_SIZE)
|
||||
#define MBED_CONFIGURED_RAM_BANK_XRAM1_SIZE MBED_RAM_BANK_XRAM1_SIZE
|
||||
#endif
|
||||
|
||||
#endif /* __NUC472_MEM_H__ */
|
|
@ -2,13 +2,7 @@
|
|||
* Nuvoton NUC472 GCC linker script file
|
||||
*/
|
||||
|
||||
#if !defined(MBED_APP_START)
|
||||
#define MBED_APP_START 0x00000000
|
||||
#endif
|
||||
|
||||
#if !defined(MBED_APP_SIZE)
|
||||
#define MBED_APP_SIZE 0x00080000
|
||||
#endif
|
||||
#include "../../NUC472_mem.h"
|
||||
|
||||
#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
|
||||
# if defined(MBED_BOOT_STACK_SIZE)
|
||||
|
@ -24,10 +18,10 @@ StackSize = MBED_CONF_TARGET_BOOT_STACK_SIZE;
|
|||
MEMORY
|
||||
{
|
||||
|
||||
VECTORS (rx) : ORIGIN = MBED_APP_START, LENGTH = 0x00000400
|
||||
FLASH (rx) : ORIGIN = MBED_APP_START + 0x400, LENGTH = MBED_APP_SIZE - 0x00000400
|
||||
RAM_INTERN (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00010000 - 0x00000000
|
||||
RAM_EXTERN (rwx) : ORIGIN = 0x60000000, LENGTH = 0x00100000
|
||||
VECTORS (rx) : ORIGIN = MBED_CONFIGURED_ROM_BANK_IROM1_START, LENGTH = 0x00000400
|
||||
FLASH (rx) : ORIGIN = MBED_CONFIGURED_ROM_BANK_IROM1_START + 0x400, LENGTH = MBED_CONFIGURED_ROM_BANK_IROM1_SIZE - 0x00000400
|
||||
RAM_INTERN (rwx) : ORIGIN = MBED_CONFIGURED_RAM_BANK_IRAM1_START, LENGTH = MBED_CONFIGURED_RAM_BANK_IRAM1_SIZE
|
||||
RAM_EXTERN (rwx) : ORIGIN = MBED_CONFIGURED_RAM_BANK_XRAM1_START, LENGTH = MBED_CONFIGURED_RAM_BANK_XRAM1_SIZE
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -2,13 +2,7 @@
|
|||
* Nuvoton NUC472 GCC linker script file
|
||||
*/
|
||||
|
||||
#if !defined(MBED_APP_START)
|
||||
#define MBED_APP_START 0x00000000
|
||||
#endif
|
||||
|
||||
#if !defined(MBED_APP_SIZE)
|
||||
#define MBED_APP_SIZE 0x00080000
|
||||
#endif
|
||||
#include "../../NUC472_mem.h"
|
||||
|
||||
#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
|
||||
# if defined(MBED_BOOT_STACK_SIZE)
|
||||
|
@ -24,9 +18,9 @@ StackSize = MBED_CONF_TARGET_BOOT_STACK_SIZE;
|
|||
MEMORY
|
||||
{
|
||||
|
||||
VECTORS (rx) : ORIGIN = MBED_APP_START, LENGTH = 0x00000400
|
||||
FLASH (rx) : ORIGIN = MBED_APP_START + 0x400, LENGTH = MBED_APP_SIZE - 0x00000400
|
||||
RAM_INTERN (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00010000 - 0x00000000
|
||||
VECTORS (rx) : ORIGIN = MBED_CONFIGURED_ROM_BANK_IROM1_START, LENGTH = 0x00000400
|
||||
FLASH (rx) : ORIGIN = MBED_CONFIGURED_ROM_BANK_IROM1_START + 0x400, LENGTH = MBED_CONFIGURED_ROM_BANK_IROM1_SIZE - 0x00000400
|
||||
RAM_INTERN (rwx) : ORIGIN = MBED_CONFIGURED_RAM_BANK_IRAM1_START, LENGTH = MBED_CONFIGURED_RAM_BANK_IRAM1_SIZE
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include "flash_api.h"
|
||||
#include "flash_data.h"
|
||||
#include "mbed_critical.h"
|
||||
#include "NUC472_mem.h"
|
||||
|
||||
// This is a flash algo binary blob. It is PIC (position independent code) that should be stored in RAM
|
||||
// NOTE: On ARMv7-M/ARMv8-M, instruction fetches are always little-endian.
|
||||
|
@ -64,14 +65,14 @@ static const flash_algo_t flash_algo_config = {
|
|||
};
|
||||
|
||||
static const sector_info_t sectors_info[] = {
|
||||
{0x0, 0x800}, // (start, sector size)
|
||||
{MBED_ROM_BANK_IROM1_START, 0x800},
|
||||
};
|
||||
|
||||
static const flash_target_config_t flash_target_config = {
|
||||
.page_size = 4, // 4 bytes
|
||||
// Here page_size is program unit, which is different than FMC definition.
|
||||
.flash_start = 0x0,
|
||||
.flash_size = 0x80000, // 512 KB
|
||||
.flash_start = MBED_ROM_BANK_IROM1_START,
|
||||
.flash_size = MBED_ROM_BANK_IROM1_SIZE,
|
||||
.sectors = sectors_info,
|
||||
.sector_info_count = sizeof(sectors_info) / sizeof(sector_info_t)
|
||||
};
|
||||
|
|
|
@ -8203,6 +8203,34 @@
|
|||
"usb-uart-tx": "PA_7",
|
||||
"usb-uart-rx": "PA_6"
|
||||
},
|
||||
"memory_banks": {
|
||||
"NS_CODE": {
|
||||
"access": {
|
||||
"execute": true,
|
||||
"peripheral": false,
|
||||
"read": true,
|
||||
"secure": false,
|
||||
"write": false
|
||||
},
|
||||
"default": false,
|
||||
"size": 0x8D000,
|
||||
"start": 0x10071000,
|
||||
"startup": false
|
||||
},
|
||||
"NS_DATA": {
|
||||
"access": {
|
||||
"execute": false,
|
||||
"peripheral": false,
|
||||
"read": true,
|
||||
"secure": false,
|
||||
"write": true
|
||||
},
|
||||
"default": false,
|
||||
"size": 0x28000,
|
||||
"start": 0x30018000,
|
||||
"startup": false
|
||||
}
|
||||
},
|
||||
"OUTPUT_EXT": "bin",
|
||||
"components_add": [
|
||||
"TFM_S_FW"
|
||||
|
|
Loading…
Reference in New Issue