Skip to content

Commit c0981a3

Browse files
author
Deepika
committed
Addressed review comments from team-nuvoton
1 parent 1d8c00e commit c0981a3

File tree

5 files changed

+48
-32
lines changed

5 files changed

+48
-32
lines changed

targets/TARGET_NUVOTON/TARGET_M2351/device/TOOLCHAIN_ARM_MICRO/M2351.sct

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,33 +12,33 @@
1212
*/
1313

1414
#ifndef MBED_ROM_SIZE_S
15-
#define MBED_ROM_SIZE_S (0x40000)
15+
#define MBED_ROM_SIZE_S (0x40000)
1616
#endif
1717

1818
#ifndef MBED_RAM_SIZE_S
19-
#define MBED_RAM_SIZE_S (0x8000)
19+
#define MBED_RAM_SIZE_S (0x8000)
2020
#endif
2121

2222
#ifndef NU_TZ_NSC_SIZE
23-
#define NU_TZ_NSC_SIZE (0x1000)
23+
#define NU_TZ_NSC_SIZE (0x1000)
2424
#endif
2525

2626
#if defined(DOMAIN_NS) && DOMAIN_NS
2727

2828
#ifndef MBED_APP_START
29-
#define MBED_APP_START (0x10000000 + MBED_ROM_START + MBED_ROM_SIZE_S)
29+
#define MBED_APP_START (0x10000000 + MBED_ROM_START + MBED_ROM_SIZE_S)
3030
#endif
3131

3232
#ifndef MBED_APP_SIZE
33-
#define MBED_APP_SIZE (MBED_ROM_SIZE - MBED_ROM_SIZE_S)
33+
#define MBED_APP_SIZE (MBED_ROM_SIZE - MBED_ROM_SIZE_S)
3434
#endif
3535

3636
#ifndef MBED_RAM_APP_START
37-
#define MBED_RAM_APP_START (0x10000000 + MBED_RAM_START + MBED_RAM_SIZE_S)
37+
#define MBED_RAM_APP_START (0x10000000 + MBED_RAM_START + MBED_RAM_SIZE_S)
3838
#endif
3939

4040
#ifndef MBED_RAM_APP_SIZE
41-
#define MBED_RAM_APP_SIZE (MBED_RAM_SIZE - MBED_RAM_SIZE_S)
41+
#define MBED_RAM_APP_SIZE (MBED_RAM_SIZE - MBED_RAM_SIZE_S)
4242
#endif
4343

4444
#else
@@ -68,14 +68,14 @@
6868
* 3. Greentea NVSTORE uses last 2 sectors or 4KiB x 2 for its test. Avoid this range.
6969
* 4. NSC region size defaults to 4KiB if not defined.
7070
*/
71-
#define NU_TZ_NSC_START (MBED_APP_START + MBED_APP_SIZE - 0x2000 - NU_TZ_NSC_SIZE)
71+
#define NU_TZ_NSC_START (MBED_APP_START + MBED_APP_SIZE - 0x2000 - NU_TZ_NSC_SIZE)
7272

7373
/* Initial/ISR stack size */
7474
#if (! defined(NU_INITIAL_STACK_SIZE))
7575
#if defined(DOMAIN_NS) && DOMAIN_NS
76-
#define NU_INITIAL_STACK_SIZE 0x800
76+
#define NU_INITIAL_STACK_SIZE 0x800
7777
#else
78-
#define NU_INITIAL_STACK_SIZE 0x800
78+
#define NU_INITIAL_STACK_SIZE 0x800
7979
#endif
8080
#endif
8181

targets/TARGET_NUVOTON/TARGET_M2351/device/TOOLCHAIN_ARM_STD/M2351.sct

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,33 +12,33 @@
1212
*/
1313

1414
#ifndef MBED_ROM_SIZE_S
15-
#define MBED_ROM_SIZE_S (0x40000)
15+
#define MBED_ROM_SIZE_S (0x40000)
1616
#endif
1717

1818
#ifndef MBED_RAM_SIZE_S
19-
#define MBED_RAM_SIZE_S (0x8000)
19+
#define MBED_RAM_SIZE_S (0x8000)
2020
#endif
2121

2222
#ifndef NU_TZ_NSC_SIZE
23-
#define NU_TZ_NSC_SIZE (0x1000)
23+
#define NU_TZ_NSC_SIZE (0x1000)
2424
#endif
2525

2626
#if defined(DOMAIN_NS) && DOMAIN_NS
2727

2828
#ifndef MBED_APP_START
29-
#define MBED_APP_START (0x10000000 + MBED_ROM_START + MBED_ROM_SIZE_S)
29+
#define MBED_APP_START (0x10000000 + MBED_ROM_START + MBED_ROM_SIZE_S)
3030
#endif
3131

3232
#ifndef MBED_APP_SIZE
33-
#define MBED_APP_SIZE (MBED_ROM_SIZE - MBED_ROM_SIZE_S)
33+
#define MBED_APP_SIZE (MBED_ROM_SIZE - MBED_ROM_SIZE_S)
3434
#endif
3535

3636
#ifndef MBED_RAM_APP_START
37-
#define MBED_RAM_APP_START (0x10000000 + MBED_RAM_START + MBED_RAM_SIZE_S)
37+
#define MBED_RAM_APP_START (0x10000000 + MBED_RAM_START + MBED_RAM_SIZE_S)
3838
#endif
3939

4040
#ifndef MBED_RAM_APP_SIZE
41-
#define MBED_RAM_APP_SIZE (MBED_RAM_SIZE - MBED_RAM_SIZE_S)
41+
#define MBED_RAM_APP_SIZE (MBED_RAM_SIZE - MBED_RAM_SIZE_S)
4242
#endif
4343

4444
#else
@@ -68,14 +68,14 @@
6868
* 3. Greentea NVSTORE uses last 2 sectors or 4KiB x 2 for its test. Avoid this range.
6969
* 4. NSC region size defaults to 4KiB if not defined.
7070
*/
71-
#define NU_TZ_NSC_START (MBED_APP_START + MBED_APP_SIZE - 0x2000 - NU_TZ_NSC_SIZE)
71+
#define NU_TZ_NSC_START (MBED_APP_START + MBED_APP_SIZE - 0x2000 - NU_TZ_NSC_SIZE)
7272

7373
/* Initial/ISR stack size */
7474
#if (! defined(NU_INITIAL_STACK_SIZE))
7575
#if defined(DOMAIN_NS) && DOMAIN_NS
76-
#define NU_INITIAL_STACK_SIZE 0x800
76+
#define NU_INITIAL_STACK_SIZE 0x800
7777
#else
78-
#define NU_INITIAL_STACK_SIZE 0x800
78+
#define NU_INITIAL_STACK_SIZE 0x800
7979
#endif
8080
#endif
8181

targets/TARGET_NUVOTON/TARGET_M2351/device/TOOLCHAIN_GCC_ARM/M2351.ld

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,6 @@ StackSize = 0x800;
7979
#ifndef NU_TZ_NSC_START
8080
#define NU_TZ_NSC_START (MBED_APP_START + MBED_APP_SIZE - 0x2000 - NU_TZ_NSC_SIZE)
8181
#endif
82-
#ifndef NU_TZ_NSC_SIZE
83-
#define NU_TZ_NSC_SIZE 0x1000
84-
#endif
8582

8683

8784
#if defined(DOMAIN_NS) && DOMAIN_NS

targets/TARGET_NUVOTON/TARGET_M2351/device/TOOLCHAIN_IAR/M2351.icf

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,28 @@ if (! isdefinedsymbol(NU_TZ_NSC_SIZE)) {
1818
if (isdefinedsymbol(DOMAIN_NS)) {
1919

2020
if (! isdefinedsymbol(MBED_APP_START)) {
21-
define symbol MBED_APP_START = 0x10040000;
21+
define symbol MBED_APP_START = (0x10000000 + MBED_ROM_START + MBED_ROM_SIZE_S);
2222
}
2323

2424
if (! isdefinedsymbol(MBED_APP_SIZE)) {
25-
define symbol MBED_APP_SIZE = 0x40000;
25+
define symbol MBED_APP_SIZE = (MBED_ROM_SIZE - MBED_ROM_SIZE_S);
2626
}
2727

28+
if (! isdefinedsymbol(MBED_RAM_APP_START)) {
29+
define symbol MBED_RAM_APP_START = (0x10000000 + MBED_RAM_START + MBED_RAM_SIZE_S);
30+
}
31+
32+
if (! isdefinedsymbol(MBED_RAM_APP_SIZE)) {
33+
define symbol MBED_RAM_APP_SIZE = (MBED_RAM_SIZE - MBED_RAM_SIZE_S);
34+
}
2835

2936
/*-Specials-*/
3037
define symbol __ICFEDIT_intvec_start__ = MBED_APP_START;
3138
/*-Memory Regions-*/
3239
define symbol __ICFEDIT_region_ROM_start__ = MBED_APP_START;
3340
define symbol __ICFEDIT_region_ROM_end__ = MBED_APP_START + MBED_APP_SIZE - 1;
34-
define symbol __ICFEDIT_region_IRAM_start__ = MBED_RAM_START + MBED_RAM_SIZE_S;
35-
define symbol __ICFEDIT_region_IRAM_end__ = MBED_RAM_START + MBED_RAM_SIZE - 1;
41+
define symbol __ICFEDIT_region_IRAM_start__ = MBED_RAM_APP_START;
42+
define symbol __ICFEDIT_region_IRAM_end__ = MBED_RAM_APP_START + MBED_RAM_APP_SIZE - 1;
3643

3744
/*-Sizes-*/
3845
define symbol __ICFEDIT_size_cstack__ = 0x800;
@@ -41,11 +48,19 @@ if (isdefinedsymbol(DOMAIN_NS)) {
4148
} else {
4249

4350
if (! isdefinedsymbol(MBED_APP_START)) {
44-
define symbol MBED_APP_START = 0x0;
51+
define symbol MBED_APP_START = MBED_ROM_START;
4552
}
4653

4754
if (! isdefinedsymbol(MBED_APP_SIZE)) {
48-
define symbol MBED_APP_SIZE = 0x40000;
55+
define symbol MBED_APP_SIZE = MBED_ROM_SIZE_S;
56+
}
57+
58+
if (! isdefinedsymbol(MBED_RAM_APP_START)) {
59+
define symbol MBED_RAM_APP_START = MBED_RAM_START;
60+
}
61+
62+
if (! isdefinedsymbol(MBED_RAM_APP_SIZE)) {
63+
define symbol MBED_RAM_APP_SIZE = MBED_RAM_SIZE_S;
4964
}
5065

5166
/* Requirements for NSC location
@@ -68,8 +83,8 @@ if (isdefinedsymbol(DOMAIN_NS)) {
6883
define symbol __ICFEDIT_region_ROM_end__ = MBED_APP_START + MBED_APP_SIZE - 1;
6984
define symbol __ICFEDIT_region_NSCROM_start__ = NU_TZ_NSC_START;
7085
define symbol __ICFEDIT_region_NSCROM_end__ = NU_TZ_NSC_START + NU_TZ_NSC_SIZE - 1;
71-
define symbol __ICFEDIT_region_IRAM_start__ = MBED_RAM_START;
72-
define symbol __ICFEDIT_region_IRAM_end__ = MBED_RAM_START + MBED_RAM_SIZE_S - 1;
86+
define symbol __ICFEDIT_region_IRAM_start__ = MBED_RAM_APP_START;
87+
define symbol __ICFEDIT_region_IRAM_end__ = MBED_RAM_APP_START + MBED_RAM_APP_SIZE - 1;
7388

7489
/*-Sizes-*/
7590
define symbol __ICFEDIT_size_cstack__ = 0x800;

targets/TARGET_NUVOTON/TARGET_M2351/flash_api.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,12 @@
2525

2626
#if defined (__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
2727

28+
#ifndef MBED_ROM_SIZE_S
29+
#define MBED_ROM_SIZE_S (0x40000)
30+
#endif
31+
2832
#define NU_SECURE_FLASH_START (MBED_ROM_START)
29-
#define NU_SECURE_FLASH_SIZE (MBED_ROM_SIZE / 2)
33+
#define NU_SECURE_FLASH_SIZE (MBED_ROM_SIZE_S)
3034

3135
// This is a flash algo binary blob. It is PIC (position independent code) that should be stored in RAM
3236
// NOTE: On ARMv7-M/ARMv8-M, instruction fetches are always little-endian.

0 commit comments

Comments
 (0)