Skip to content

Commit 1b4a3c3

Browse files
authored
Merge pull request #4008 from OpenNuvoton/nuvoton
[NUC472/M453] Support Bootloader and FlashIAP
2 parents c776eaa + 40a9852 commit 1b4a3c3

File tree

18 files changed

+314
-44
lines changed

18 files changed

+314
-44
lines changed

targets/TARGET_NUVOTON/TARGET_M451/device/TOOLCHAIN_ARM_MICRO/M453.sct

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
1+
#! armcc -E
12

2-
LR_IROM1 0x00000000 {
3-
ER_IROM1 0x00000000 { ; load address = execution address
3+
#if !defined(MBED_APP_START)
4+
#define MBED_APP_START 0x00000000
5+
#endif
6+
7+
#if !defined(MBED_APP_SIZE)
8+
#define MBED_APP_SIZE 0x00040000
9+
#endif
10+
11+
LR_IROM1 MBED_APP_START {
12+
ER_IROM1 MBED_APP_START { ; load address = execution address
413
*(RESET, +First)
514
*(InRoot$$Sections)
615
.ANY (+RO)
@@ -23,6 +32,6 @@ LR_IROM1 0x00000000 {
2332
ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (0x20000000 + 0x8000 - AlignExpr(ImageLimit(RW_IRAM1), 16)) {
2433
}
2534
}
26-
ScatterAssert(LoadLimit(LR_IROM1) <= 0x00040000) ; 256 KB APROM
35+
ScatterAssert(LoadLimit(LR_IROM1) <= (MBED_APP_START + MBED_APP_SIZE)) ; 256 KB APROM
2736
ScatterAssert(ImageLimit(ARM_LIB_HEAP) <= 0x20008000) ; 32 KB SRAM
2837

targets/TARGET_NUVOTON/TARGET_M451/device/TOOLCHAIN_ARM_STD/M453.sct

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
1+
#! armcc -E
12

2-
LR_IROM1 0x00000000 {
3-
ER_IROM1 0x00000000 { ; load address = execution address
3+
#if !defined(MBED_APP_START)
4+
#define MBED_APP_START 0x00000000
5+
#endif
6+
7+
#if !defined(MBED_APP_SIZE)
8+
#define MBED_APP_SIZE 0x00040000
9+
#endif
10+
11+
LR_IROM1 MBED_APP_START {
12+
ER_IROM1 MBED_APP_START { ; load address = execution address
413
*(RESET, +First)
514
*(InRoot$$Sections)
615
.ANY (+RO)
@@ -23,6 +32,6 @@ LR_IROM1 0x00000000 {
2332
ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (0x20000000 + 0x8000 - AlignExpr(ImageLimit(RW_IRAM1), 16)) {
2433
}
2534
}
26-
ScatterAssert(LoadLimit(LR_IROM1) <= 0x00040000) ; 256 KB APROM
35+
ScatterAssert(LoadLimit(LR_IROM1) <= (MBED_APP_START + MBED_APP_SIZE)) ; 256 KB APROM
2736
ScatterAssert(ImageLimit(ARM_LIB_HEAP) <= 0x20008000) ; 32 KB SRAM
2837

targets/TARGET_NUVOTON/TARGET_M451/device/TOOLCHAIN_GCC_ARM/M453.ld

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,20 @@
22
* Nuvoton M453 GCC linker script file
33
*/
44

5+
#if !defined(MBED_APP_START)
6+
#define MBED_APP_START 0x00000000
7+
#endif
8+
9+
#if !defined(MBED_APP_SIZE)
10+
#define MBED_APP_SIZE 0x00040000
11+
#endif
12+
513
StackSize = 0x800;
614

715
MEMORY
816
{
9-
VECTORS (rx) : ORIGIN = 0x00000000, LENGTH = 0x00000400
10-
FLASH (rx) : ORIGIN = 0x00000400, LENGTH = 0x00040000 - 0x00000400
17+
VECTORS (rx) : ORIGIN = MBED_APP_START, LENGTH = 0x00000400
18+
FLASH (rx) : ORIGIN = MBED_APP_START + 0x400, LENGTH = MBED_APP_SIZE - 0x00000400
1119
RAM_INTERN (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00008000 - 0x00000000
1220
}
1321

targets/TARGET_NUVOTON/TARGET_M451/device/TOOLCHAIN_IAR/M453.icf

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
/*###ICF### Section handled by ICF editor, don't touch! ****/
22
/*-Editor annotation file-*/
33
/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
4+
if (!isdefinedsymbol(MBED_APP_START)) { define symbol MBED_APP_START = 0x00000000; }
5+
if (!isdefinedsymbol(MBED_APP_SIZE)) { define symbol MBED_APP_SIZE = 0x00040000; }
46
/*-Specials-*/
5-
define symbol __ICFEDIT_intvec_start__ = 0x00000000;
7+
define symbol __ICFEDIT_intvec_start__ = MBED_APP_START;
68
/*-Memory Regions-*/
7-
define symbol __ICFEDIT_region_ROM_start__ = 0x00000000;
8-
define symbol __ICFEDIT_region_ROM_end__ = 0x00040000;
9+
define symbol __ICFEDIT_region_ROM_start__ = MBED_APP_START;
10+
define symbol __ICFEDIT_region_ROM_end__ = MBED_APP_START + MBED_APP_SIZE - 1;
911
define symbol __ICFEDIT_region_IRAM_start__ = 0x20000000;
1012
define symbol __ICFEDIT_region_IRAM_end__ = 0x20008000;
1113
/*-Sizes-*/

targets/TARGET_NUVOTON/TARGET_M451/device/cmsis_nvic.h

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,18 @@
3232
# define NVIC_RAM_VECTOR_ADDRESS ((uint32_t) &__start_vector_table__)
3333
#endif
3434

35-
36-
#define NVIC_FLASH_VECTOR_ADDRESS 0
35+
#if defined(__CC_ARM)
36+
extern uint32_t Load$$LR$$LR_IROM1$$Base[];
37+
#define NVIC_FLASH_VECTOR_ADDRESS ((uint32_t)Load$$LR$$LR_IROM1$$Base)
38+
#elif defined(__ICCARM__)
39+
#pragma section=".intvec"
40+
#define NVIC_FLASH_VECTOR_ADDRESS ((uint32_t)__section_begin(".intvec"))
41+
#elif defined(__GNUC__)
42+
extern uint32_t __vector_table;
43+
#define NVIC_FLASH_VECTOR_ADDRESS ((uint32_t)&__vector_table)
44+
#else
45+
#error "Flash vector address not set for this toolchain"
46+
#endif
3747

3848
#ifdef __cplusplus
3949
extern "C" {
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
/* mbed Microcontroller Library
2+
* Copyright (c) 2015-2016 Nuvoton
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
#include "flash_api.h"
18+
#include "flash_data.h"
19+
#include "mbed_critical.h"
20+
21+
// This is a flash algo binary blob. It is PIC (position independent code) that should be stored in RAM
22+
// NOTE: On ARMv7-M/ARMv8-M, instruction fetches are always little-endian.
23+
static uint32_t FLASH_ALGO[] = {
24+
0x4603b530, 0x2164460c, 0x4dd72059, 0x20166028, 0xf8c5070d, 0x20880100, 0x0100f8c5, 0xf8d006c0,
25+
0xf0000100, 0xb9080001, 0xbd302001, 0x680048cf, 0x0004f040, 0x4580f04f, 0x0200f8c5, 0xf8d04628,
26+
0xf0400204, 0xf8c50004, 0xbf000204, 0xf1a11e08, 0xd1fb0101, 0x680048c6, 0x002df040, 0x60284dc4,
27+
0x68004628, 0x0001f000, 0x2001b908, 0x48c0e7dd, 0xf0406800, 0x4dbe0040, 0x20006028, 0x4601e7d5,
28+
0x48bbbf00, 0xf0006900, 0x28000001, 0x48b8d1f9, 0xf0206800, 0x4ab6002d, 0x20006010, 0x60104ab2,
29+
0x46014770, 0x48b2bf00, 0xf0006900, 0x28000001, 0x48afd1f9, 0xf0406800, 0x4aad0040, 0x20226010,
30+
0xf02160d0, 0x60500003, 0x61102001, 0x8f60f3bf, 0x48a7bf00, 0xf0006900, 0x28000001, 0x48a4d1f9,
31+
0xf0006800, 0xb1380040, 0x680048a1, 0x0040f040, 0x60104a9f, 0x47702001, 0xe7fc2000, 0x4604b570,
32+
0x4615460b, 0x46292200, 0x000ff103, 0x030ff020, 0x4897bf00, 0xf0006900, 0x28000001, 0x4894d1f9,
33+
0xf0406800, 0x4e920040, 0xf0246030, 0x6070000f, 0x60f02027, 0x1c524610, 0x0020f851, 0x36804e8c,
34+
0x46106030, 0xf8511c52, 0x4e890020, 0x0084f8c6, 0x1c524610, 0x0020f851, 0x36884e85, 0x46106030,
35+
0xf8511c52, 0x1d360020, 0x20016030, 0x61304e80, 0xe02c3b10, 0x487ebf00, 0x680030c0, 0x0030f000,
36+
0xd1f82800, 0x1c524610, 0x0020f851, 0x36804e78, 0x46106030, 0xf8511c52, 0x4e750020, 0x0084f8c6,
37+
0x4873bf00, 0x680030c0, 0x00c0f000, 0xd1f82800, 0x1c524610, 0x0020f851, 0x36884e6d, 0x46106030,
38+
0xf8511c52, 0x4e6a0020, 0x008cf8c6, 0x2b003b10, 0xbf00d1d0, 0x69004866, 0x0001f000, 0xd1f92800,
39+
0xb510bd70, 0x1cc84603, 0x0103f020, 0x4860bf00, 0xf0006900, 0x28000001, 0x485dd1f9, 0xf0406800,
40+
0x4c5b0040, 0x20216020, 0xe02060e0, 0x0003f023, 0x60604c57, 0x60a06810, 0x61202001, 0x8f60f3bf,
41+
0x4853bf00, 0xf0006900, 0x28000001, 0x4850d1f9, 0xf0006800, 0xb1380040, 0x6800484d, 0x0040f040,
42+
0x60204c4b, 0xbd102001, 0x1d121d1b, 0x29001f09, 0x2000d1dc, 0xe92de7f7, 0x460547f0, 0x4616460c,
43+
0x0800f04f, 0xbf0046c2, 0x69004841, 0x0001f000, 0xd1f92800, 0x6800483e, 0x0040f040, 0x6008493c,
44+
0xf0201ce0, 0xe02d0403, 0xb958b2e8, 0xd9092cff, 0x7780f44f, 0x0208eb06, 0x46284639, 0xff2ef7ff,
45+
0xe0164682, 0x0008f3c5, 0x2c10b958, 0xf024d309, 0xeb06070f, 0x46390208, 0xf7ff4628, 0x4682ff1f,
46+
0x4627e007, 0x0208eb06, 0x46284639, 0xff89f7ff, 0x443d4682, 0x1be444b8, 0x0f00f1ba, 0x2001d002,
47+
0x87f0e8bd, 0xd1cf2c00, 0xe7f92000, 0x1ccbb510, 0x0103f023, 0x4b1ebf00, 0xf003691b, 0x2b000301,
48+
0x4b1bd1f9, 0xf043681b, 0x4c190340, 0x23006023, 0xe02560e3, 0x0303f020, 0x60634c15, 0x60a32300,
49+
0x61232301, 0x8f60f3bf, 0x4b11bf00, 0xf003691b, 0x2b000301, 0x4b0ed1f9, 0xf003681b, 0xb1330340,
50+
0x681b4b0b, 0x0340f043, 0x60234c09, 0x4b08bd10, 0x6814689b, 0xd00042a3, 0x1d00e7f8, 0x1f091d12,
51+
0xd1d72900, 0xe7f1bf00, 0x40000100, 0x40000200, 0x4000c000, 0x00000000,
52+
};
53+
54+
static const flash_algo_t flash_algo_config = {
55+
.init = 0x00000001,
56+
.uninit = 0x0000007f,
57+
.erase_sector = 0x000000a3,
58+
.program_page = 0x00000257,
59+
.static_base = 0x00000374,
60+
.algo_blob = FLASH_ALGO
61+
};
62+
63+
static const sector_info_t sectors_info[] = {
64+
{0x0, 0x800}, // (start, sector size)
65+
};
66+
67+
static const flash_target_config_t flash_target_config = {
68+
.page_size = 0x800, // 2 KB
69+
.flash_start = 0x0,
70+
.flash_size = 0x40000, // 256 KB
71+
.sectors = sectors_info,
72+
.sector_info_count = sizeof(sectors_info) / sizeof(sector_info_t)
73+
};
74+
75+
void flash_set_target_config(flash_t *obj)
76+
{
77+
obj->flash_algo = &flash_algo_config;
78+
obj->target_config = &flash_target_config;
79+
}

targets/TARGET_NUVOTON/TARGET_NUC472/device/TOOLCHAIN_ARM_MICRO/TARGET_NU_XRAM_SUPPORTED/NUC472.sct

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
1+
#! armcc -E
12

2-
LR_IROM1 0x00000000 {
3-
ER_IROM1 0x00000000 { ; load address = execution address
3+
#if !defined(MBED_APP_START)
4+
#define MBED_APP_START 0x00000000
5+
#endif
6+
7+
#if !defined(MBED_APP_SIZE)
8+
#define MBED_APP_SIZE 0x00080000
9+
#endif
10+
11+
LR_IROM1 MBED_APP_START {
12+
ER_IROM1 MBED_APP_START { ; load address = execution address
413
*(RESET, +First)
514
*(InRoot$$Sections)
615
.ANY (+RO)
@@ -29,7 +38,7 @@ LR_IROM1 0x00000000 {
2938
ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (0x60000000 + 0x100000 - AlignExpr(ImageLimit(ER_XRAM1), 16)) {
3039
}
3140
}
32-
ScatterAssert(LoadLimit(LR_IROM1) <= 0x00080000) ; 512 KB APROM
41+
ScatterAssert(LoadLimit(LR_IROM1) <= (MBED_APP_START + MBED_APP_SIZE)) ; 512 KB APROM
3342
ScatterAssert(ImageLimit(RW_IRAM1) <= 0x20010000) ; 64 KB SRAM (internal)
3443
ScatterAssert(ImageLimit(ARM_LIB_HEAP) <= 0x60100000) ; 1 MB SRAM (external)
3544

targets/TARGET_NUVOTON/TARGET_NUC472/device/TOOLCHAIN_ARM_MICRO/TARGET_NU_XRAM_UNSUPPORTED/NUC472.sct

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
1+
#! armcc -E
12

2-
LR_IROM1 0x00000000 {
3-
ER_IROM1 0x00000000 { ; load address = execution address
3+
#if !defined(MBED_APP_START)
4+
#define MBED_APP_START 0x00000000
5+
#endif
6+
7+
#if !defined(MBED_APP_SIZE)
8+
#define MBED_APP_SIZE 0x00080000
9+
#endif
10+
11+
LR_IROM1 MBED_APP_START {
12+
ER_IROM1 MBED_APP_START { ; load address = execution address
413
*(RESET, +First)
514
*(InRoot$$Sections)
615
.ANY (+RO)
@@ -24,6 +33,6 @@ LR_IROM1 0x00000000 {
2433
ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (0x20000000 + 0x10000 - AlignExpr(ImageLimit(RW_IRAM1), 16)) {
2534
}
2635
}
27-
ScatterAssert(LoadLimit(LR_IROM1) <= 0x00080000) ; 512 KB APROM
36+
ScatterAssert(LoadLimit(LR_IROM1) <= (MBED_APP_START + MBED_APP_SIZE)) ; 512 KB APROM
2837
ScatterAssert(ImageLimit(RW_IRAM1) <= 0x20010000) ; 64 KB SRAM (internal)
2938

targets/TARGET_NUVOTON/TARGET_NUC472/device/TOOLCHAIN_ARM_STD/TARGET_NU_XRAM_SUPPORTED/NUC472.sct

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
1+
#! armcc -E
12

2-
LR_IROM1 0x00000000 {
3-
ER_IROM1 0x00000000 { ; load address = execution address
3+
#if !defined(MBED_APP_START)
4+
#define MBED_APP_START 0x00000000
5+
#endif
6+
7+
#if !defined(MBED_APP_SIZE)
8+
#define MBED_APP_SIZE 0x00080000
9+
#endif
10+
11+
LR_IROM1 MBED_APP_START {
12+
ER_IROM1 MBED_APP_START { ; load address = execution address
413
*(RESET, +First)
514
*(InRoot$$Sections)
615
.ANY (+RO)
@@ -31,7 +40,7 @@ LR_IROM1 0x00000000 {
3140
ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (0x60000000 + 0x100000 - AlignExpr(ImageLimit(ER_XRAM1), 16)) {
3241
}
3342
}
34-
ScatterAssert(LoadLimit(LR_IROM1) <= 0x00080000) ; 512 KB APROM
43+
ScatterAssert(LoadLimit(LR_IROM1) <= (MBED_APP_START + MBED_APP_SIZE)) ; 512 KB APROM
3544
ScatterAssert(ImageLimit(RW_IRAM1) <= 0x20010000) ; 64 KB SRAM (internal)
3645
ScatterAssert(ImageLimit(ARM_LIB_HEAP) <= 0x60100000) ; 1 MB SRAM (external)
3746

targets/TARGET_NUVOTON/TARGET_NUC472/device/TOOLCHAIN_ARM_STD/TARGET_NU_XRAM_UNSUPPORTED/NUC472.sct

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
1+
#! armcc -E
12

2-
LR_IROM1 0x00000000 {
3-
ER_IROM1 0x00000000 { ; load address = execution address
3+
#if !defined(MBED_APP_START)
4+
#define MBED_APP_START 0x00000000
5+
#endif
6+
7+
#if !defined(MBED_APP_SIZE)
8+
#define MBED_APP_SIZE 0x00080000
9+
#endif
10+
11+
LR_IROM1 MBED_APP_START {
12+
ER_IROM1 MBED_APP_START { ; load address = execution address
413
*(RESET, +First)
514
*(InRoot$$Sections)
615
.ANY (+RO)
@@ -24,6 +33,6 @@ LR_IROM1 0x00000000 {
2433
ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (0x20000000 + 0x10000 - AlignExpr(ImageLimit(RW_IRAM1), 16)) {
2534
}
2635
}
27-
ScatterAssert(LoadLimit(LR_IROM1) <= 0x00080000) ; 512 KB APROM
36+
ScatterAssert(LoadLimit(LR_IROM1) <= (MBED_APP_START + MBED_APP_SIZE)) ; 512 KB APROM
2837
ScatterAssert(ImageLimit(RW_IRAM1) <= 0x20010000) ; 64 KB SRAM (internal)
2938

targets/TARGET_NUVOTON/TARGET_NUC472/device/TOOLCHAIN_GCC_ARM/TARGET_NU_XRAM_SUPPORTED/NUC472.ld

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,21 @@
22
* Nuvoton NUC472 GCC linker script file
33
*/
44

5+
#if !defined(MBED_APP_START)
6+
#define MBED_APP_START 0x00000000
7+
#endif
8+
9+
#if !defined(MBED_APP_SIZE)
10+
#define MBED_APP_SIZE 0x00080000
11+
#endif
12+
513
StackSize = 0x800;
614

715
MEMORY
816
{
917

10-
VECTORS (rx) : ORIGIN = 0x00000000, LENGTH = 0x00000400
11-
FLASH (rx) : ORIGIN = 0x00000400, LENGTH = 0x00080000 - 0x00000400
18+
VECTORS (rx) : ORIGIN = MBED_APP_START, LENGTH = 0x00000400
19+
FLASH (rx) : ORIGIN = MBED_APP_START + 0x400, LENGTH = MBED_APP_SIZE - 0x00000400
1220
RAM_INTERN (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00010000 - 0x00000000
1321
RAM_EXTERN (rwx) : ORIGIN = 0x60000000, LENGTH = 0x00100000
1422
}

targets/TARGET_NUVOTON/TARGET_NUC472/device/TOOLCHAIN_GCC_ARM/TARGET_NU_XRAM_UNSUPPORTED/NUC472.ld

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,21 @@
22
* Nuvoton NUC472 GCC linker script file
33
*/
44

5+
#if !defined(MBED_APP_START)
6+
#define MBED_APP_START 0x00000000
7+
#endif
8+
9+
#if !defined(MBED_APP_SIZE)
10+
#define MBED_APP_SIZE 0x00080000
11+
#endif
12+
513
StackSize = 0x800;
614

715
MEMORY
816
{
917

10-
VECTORS (rx) : ORIGIN = 0x00000000, LENGTH = 0x00000400
11-
FLASH (rx) : ORIGIN = 0x00000400, LENGTH = 0x00080000 - 0x00000400
18+
VECTORS (rx) : ORIGIN = MBED_APP_START, LENGTH = 0x00000400
19+
FLASH (rx) : ORIGIN = MBED_APP_START + 0x400, LENGTH = MBED_APP_SIZE - 0x00000400
1220
RAM_INTERN (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00010000 - 0x00000000
1321
}
1422

targets/TARGET_NUVOTON/TARGET_NUC472/device/TOOLCHAIN_IAR/TARGET_NU_XRAM_SUPPORTED/NUC472_442.icf

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
/*###ICF### Section handled by ICF editor, don't touch! ****/
22
/*-Editor annotation file-*/
33
/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
4+
if (!isdefinedsymbol(MBED_APP_START)) { define symbol MBED_APP_START = 0x00000000; }
5+
if (!isdefinedsymbol(MBED_APP_SIZE)) { define symbol MBED_APP_SIZE = 0x00080000; }
46
/*-Specials-*/
5-
define symbol __ICFEDIT_intvec_start__ = 0x00000000;
7+
define symbol __ICFEDIT_intvec_start__ = MBED_APP_START;
68
/*-Memory Regions-*/
7-
define symbol __ICFEDIT_region_ROM_start__ = 0x00000000;
8-
define symbol __ICFEDIT_region_ROM_end__ = 0x00080000;
9+
define symbol __ICFEDIT_region_ROM_start__ = MBED_APP_START;
10+
define symbol __ICFEDIT_region_ROM_end__ = MBED_APP_START + MBED_APP_SIZE - 1;
911
define symbol __ICFEDIT_region_IRAM_start__ = 0x20000000;
1012
define symbol __ICFEDIT_region_IRAM_end__ = 0x20010000;
1113
define symbol __ICFEDIT_region_XRAM_start__ = 0x60000000;

targets/TARGET_NUVOTON/TARGET_NUC472/device/TOOLCHAIN_IAR/TARGET_NU_XRAM_UNSUPPORTED/NUC472_442.icf

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
/*###ICF### Section handled by ICF editor, don't touch! ****/
22
/*-Editor annotation file-*/
33
/* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
4+
if (!isdefinedsymbol(MBED_APP_START)) { define symbol MBED_APP_START = 0x00000000; }
5+
if (!isdefinedsymbol(MBED_APP_SIZE)) { define symbol MBED_APP_SIZE = 0x00080000; }
46
/*-Specials-*/
5-
define symbol __ICFEDIT_intvec_start__ = 0x00000000;
7+
define symbol __ICFEDIT_intvec_start__ = MBED_APP_START;
68
/*-Memory Regions-*/
7-
define symbol __ICFEDIT_region_ROM_start__ = 0x00000000;
8-
define symbol __ICFEDIT_region_ROM_end__ = 0x00080000;
9+
define symbol __ICFEDIT_region_ROM_start__ = MBED_APP_START;
10+
define symbol __ICFEDIT_region_ROM_end__ = MBED_APP_START + MBED_APP_SIZE - 1;
911
define symbol __ICFEDIT_region_IRAM_start__ = 0x20000000;
1012
define symbol __ICFEDIT_region_IRAM_end__ = 0x20010000;
1113
/*-Sizes-*/

0 commit comments

Comments
 (0)