Skip to content

Commit 73f1edd

Browse files
author
Cruz Monrreal
authored
Merge pull request #10004 from OpenNuvoton/nuvoton_m2351_fix-memory-partition
M2351: Support memory custom partition
2 parents 803f5fd + 8ca16c4 commit 73f1edd

File tree

9 files changed

+321
-268
lines changed

9 files changed

+321
-268
lines changed

targets/TARGET_NUVOTON/TARGET_M2351/device/TOOLCHAIN_ARM_MICRO/M2351.sct renamed to targets/TARGET_NUVOTON/TARGET_M2351/device/TOOLCHAIN_ARMC6/M2351.sct

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
1-
#! armcc -E
1+
#! armclang -E
22

3-
/* Default flash/SRAM partition
3+
/*
4+
* Copyright (c) 2019-2020, Nuvoton Technology Corporation
45
*
5-
* Default flash partition:
6-
* Secure: 256KiB
7-
* Non-secure: 256KiB
8-
*
9-
* Default SRAM partition:
10-
* Secure: 32KiB
11-
* Non-secure: 64KiB
6+
* SPDX-License-Identifier: Apache-2.0
7+
*
8+
* Licensed under the Apache License, Version 2.0 (the "License");
9+
* you may not use this file except in compliance with the License.
10+
* You may obtain a copy of the License at
11+
*
12+
* http://www.apache.org/licenses/LICENSE-2.0
13+
*
14+
* Unless required by applicable law or agreed to in writing, software
15+
* distributed under the License is distributed on an "AS IS" BASIS,
16+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
* See the License for the specific language governing permissions and
18+
* limitations under the License.
1219
*/
1320

14-
#ifndef MBED_ROM_SIZE_S
15-
#define MBED_ROM_SIZE_S (0x40000)
16-
#endif
17-
18-
#ifndef MBED_RAM_SIZE_S
19-
#define MBED_RAM_SIZE_S (0x8000)
20-
#endif
21+
#include "../partition_M2351_mem.h"
2122

2223
#ifndef NU_TZ_NSC_SIZE
2324
#define NU_TZ_NSC_SIZE (0x1000)
@@ -26,19 +27,19 @@
2627
#if defined(DOMAIN_NS) && DOMAIN_NS
2728

2829
#ifndef MBED_APP_START
29-
#define MBED_APP_START (0x10000000 + MBED_ROM_START + MBED_ROM_SIZE_S)
30+
#define MBED_APP_START NU_ROM_START_NS
3031
#endif
3132

3233
#ifndef MBED_APP_SIZE
33-
#define MBED_APP_SIZE (MBED_ROM_SIZE - MBED_ROM_SIZE_S)
34+
#define MBED_APP_SIZE NU_ROM_SIZE_NS
3435
#endif
3536

3637
#ifndef MBED_RAM_APP_START
37-
#define MBED_RAM_APP_START (0x10000000 + MBED_RAM_START + MBED_RAM_SIZE_S)
38+
#define MBED_RAM_APP_START NU_RAM_START_NS
3839
#endif
3940

4041
#ifndef MBED_RAM_APP_SIZE
41-
#define MBED_RAM_APP_SIZE (MBED_RAM_SIZE - MBED_RAM_SIZE_S)
42+
#define MBED_RAM_APP_SIZE NU_RAM_SIZE_NS
4243
#endif
4344

4445
#if !defined(MBED_BOOT_STACK_SIZE)
@@ -48,19 +49,19 @@
4849
#else
4950

5051
#ifndef MBED_APP_START
51-
#define MBED_APP_START MBED_ROM_START
52+
#define MBED_APP_START NU_ROM_START_S
5253
#endif
5354

5455
#ifndef MBED_APP_SIZE
55-
#define MBED_APP_SIZE MBED_ROM_SIZE_S
56+
#define MBED_APP_SIZE NU_ROM_SIZE_S
5657
#endif
5758

5859
#ifndef MBED_RAM_APP_START
59-
#define MBED_RAM_APP_START MBED_RAM_START
60+
#define MBED_RAM_APP_START NU_RAM_START_S
6061
#endif
6162

6263
#ifndef MBED_RAM_APP_SIZE
63-
#define MBED_RAM_APP_SIZE MBED_RAM_SIZE_S
64+
#define MBED_RAM_APP_SIZE NU_RAM_SIZE_S
6465
#endif
6566

6667
#if !defined(MBED_BOOT_STACK_SIZE)

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

Lines changed: 0 additions & 172 deletions
This file was deleted.

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

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,47 @@
11
/*
2-
* Nuvoton M2351 GCC linker script file
3-
*/
4-
5-
/* Default flash/SRAM partition
2+
* Copyright (c) 2019-2020, Nuvoton Technology Corporation
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
611
*
7-
* Default flash partition:
8-
* Secure: 256KiB
9-
* Non-secure: 256KiB
10-
*
11-
* Default SRAM partition:
12-
* Secure: 32KiB
13-
* Non-secure: 64KiB
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
1417
*/
1518

16-
#ifndef MBED_ROM_SIZE_S
17-
#define MBED_ROM_SIZE_S (0x40000)
18-
#endif
19+
/*
20+
* Nuvoton M2351 GCC linker script file
21+
*/
1922

20-
#ifndef MBED_RAM_SIZE_S
21-
#define MBED_RAM_SIZE_S (0x8000)
22-
#endif
23+
#include "../partition_M2351_mem.h"
2324

2425
#ifndef NU_TZ_NSC_SIZE
25-
#define NU_TZ_NSC_SIZE (0x1000)
26+
#define NU_TZ_NSC_SIZE (0x1000)
2627
#endif
2728

2829
#if defined(DOMAIN_NS) && DOMAIN_NS
2930

3031
#ifndef MBED_APP_START
31-
#define MBED_APP_START (0x10000000 + MBED_ROM_START + MBED_ROM_SIZE_S)
32+
#define MBED_APP_START NU_ROM_START_NS
3233
#endif
3334

3435
#ifndef MBED_APP_SIZE
35-
#define MBED_APP_SIZE (MBED_ROM_SIZE - MBED_ROM_SIZE_S)
36+
#define MBED_APP_SIZE NU_ROM_SIZE_NS
3637
#endif
3738

3839
#ifndef MBED_RAM_APP_START
39-
#define MBED_RAM_APP_START (0x10000000 + MBED_RAM_START + MBED_RAM_SIZE_S)
40+
#define MBED_RAM_APP_START NU_RAM_START_NS
4041
#endif
4142

4243
#ifndef MBED_RAM_APP_SIZE
43-
#define MBED_RAM_APP_SIZE (MBED_RAM_SIZE - MBED_RAM_SIZE_S)
44+
#define MBED_RAM_APP_SIZE NU_RAM_SIZE_NS
4445
#endif
4546

4647
#if !defined(MBED_BOOT_STACK_SIZE)
@@ -50,19 +51,19 @@
5051
#else
5152

5253
#ifndef MBED_APP_START
53-
#define MBED_APP_START MBED_ROM_START
54+
#define MBED_APP_START NU_ROM_START_S
5455
#endif
5556

5657
#ifndef MBED_APP_SIZE
57-
#define MBED_APP_SIZE MBED_ROM_SIZE_S
58+
#define MBED_APP_SIZE NU_ROM_SIZE_S
5859
#endif
5960

6061
#ifndef MBED_RAM_APP_START
61-
#define MBED_RAM_APP_START MBED_RAM_START
62+
#define MBED_RAM_APP_START NU_RAM_START_S
6263
#endif
6364

6465
#ifndef MBED_RAM_APP_SIZE
65-
#define MBED_RAM_APP_SIZE MBED_RAM_SIZE_S
66+
#define MBED_RAM_APP_SIZE NU_RAM_SIZE_S
6667
#endif
6768

6869
#ifndef MBED_BOOT_STACK_SIZE

0 commit comments

Comments
 (0)