Skip to content

Commit 4f69795

Browse files
authored
Merge pull request #13770 from OpenNuvoton/nuvoton_m2354_mp
M2354: Upgrade to BSP v3.00.001 (5.15)
2 parents 2cf237e + 2acb3a4 commit 4f69795

File tree

154 files changed

+12443
-12777
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

154 files changed

+12443
-12777
lines changed

targets/TARGET_NUVOTON/TARGET_M2354/PeripheralPins.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ const PinMap PinMap_UART_RX[] = {
246246
{PA_2, UART_4, SYS_GPA_MFPL_PA2MFP_UART4_RXD},
247247
{NU_PINNAME_BIND(PA_2, UART_4), UART_4, SYS_GPA_MFPL_PA2MFP_UART4_RXD},
248248
#endif
249+
{PA_4, UART_0, SYS_GPA_MFPL_PA4MFP_UART0_RXD},
249250
{PA_4, UART_5, SYS_GPA_MFPL_PA4MFP_UART5_RXD},
250251
{PA_6, UART_0, SYS_GPA_MFPL_PA6MFP_UART0_RXD},
251252
{PA_8, UART_1, SYS_GPA_MFPH_PA8MFP_UART1_RXD},
@@ -508,7 +509,6 @@ const PinMap PinMap_SD_CLK[] = {
508509

509510
const PinMap PinMap_SD_CD[] = {
510511
{PB_12, SD_0, SYS_GPB_MFPH_PB12MFP_SD0_nCD},
511-
{PD_13, SD_0, SYS_GPD_MFPH_PD13MFP_SD0_nCD},
512512

513513
{NC, NC, 0}
514514
};

targets/TARGET_NUVOTON/TARGET_M2354/TARGET_M23_NS/TARGET_NU_M2354_NPSA_NS/TARGET_NU_PREBUILD_SECURE/NuMaker-mbed-TZ-secure-example.hex

Lines changed: 1910 additions & 1468 deletions
Large diffs are not rendered by default.

targets/TARGET_NUVOTON/TARGET_M2354/TARGET_M23_NS/device/TOOLCHAIN_ARMC6/M2354.sct

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ LR_IROM1 MBED_APP_START
4242
*
4343
* Vector table base address is required to be 128-byte aligned at a minimum.
4444
* A PE might impose further restrictions on it. */
45-
ER_IRAMVEC AlignExpr(+0, 128) EMPTY (4*(16 + 114))
45+
ER_IRAMVEC AlignExpr(+0, 128) EMPTY (4*(16 + 116))
4646
{
4747
}
4848

targets/TARGET_NUVOTON/TARGET_M2354/TARGET_M23_NS/device/TOOLCHAIN_GCC_ARM/M2354.ld

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ MEMORY
3838
/**
3939
* Must match cmsis_nvic.h
4040
*/
41-
__vector_size = 4 * (16 + 114);
41+
__vector_size = 4 * (16 + 116);
4242

4343

4444
/* Linker script to place sections and symbol values. Should be used together

targets/TARGET_NUVOTON/TARGET_M2354/TARGET_M23_NS/device/TOOLCHAIN_IAR/M2354.icf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ define symbol __ICFEDIT_region_IRAM_end__ = MBED_RAM_APP_START + MBED_RAM_
3636

3737
/*-Sizes-*/
3838
define symbol __ICFEDIT_size_cstack__ = MBED_BOOT_STACK_SIZE;
39-
define symbol __ICFEDIT_size_intvec__ = 4 * (16 + 114);
39+
define symbol __ICFEDIT_size_intvec__ = 4 * (16 + 116);
4040
define symbol __ICFEDIT_size_heap__ = 0x400;
4141

4242
/**** End of ICF editor section. ###ICF###*/

targets/TARGET_NUVOTON/TARGET_M2354/TARGET_M23_S/device/TOOLCHAIN_ARMC6/M2354.sct

Lines changed: 1 addition & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -39,48 +39,19 @@ LR_IROM1 MBED_APP_START
3939
* Secure non-PSA/Non-secure non-PSA/Non-secure PSA requires just one boot stack (MSP).
4040
* Secure PSA(TFM) requires two boot stacks (MSP/PSP).
4141
*/
42-
#if TFM_LVL == 0
4342

4443
ARM_LIB_STACK MBED_RAM_APP_START EMPTY MBED_BOOT_STACK_SIZE
4544
{
4645
}
4746

48-
#else
49-
50-
/* Stack Pointer (SP) configuration with ARM/ARMC6
51-
*
52-
* SP would go through the following configuration sequence:
53-
* (1) SP(MSP) <- Entry 0 of vector table (on H/W reset)
54-
* (2) Switch SP from MSP to PSP in startup file (as TFM requests)
55-
* (3.1) SP(PSP) <- ARM_LIB_STACK (C/C++ runtime initialization)
56-
* (3.2) SP(PSP) reconfigured in __user_setup_stackheap()
57-
*
58-
* S(3.1) or S(3.2) may cause SP(PSP) incorrectly configured. We name ARM_LIB_STACK for
59-
* PSP stack rather than MSP stack to get around this error. MSP stack is named separately
60-
* with ARM_LIB_STACK_MSP.
61-
*/
62-
63-
#warning("Ignore MBED_BOOT_STACK_SIZE in Secure PSA build")
64-
ARM_LIB_STACK_MSP MBED_RAM_APP_START EMPTY 0x800
65-
{
66-
}
67-
68-
ARM_LIB_STACK AlignExpr(+0, 32) EMPTY 0x800
69-
{
70-
}
71-
72-
#endif
73-
7447
/* Reserve for vectors
7548
*
7649
* Vector table base address is required to be 128-byte aligned at a minimum.
7750
* A PE might impose further restrictions on it. */
78-
ER_IRAMVEC AlignExpr(+0, 128) EMPTY (4*(16 + 114))
51+
ER_IRAMVEC AlignExpr(+0, 128) EMPTY (4*(16 + 116))
7952
{
8053
}
8154

82-
#if TFM_LVL == 0
83-
8455
/* 16 byte-aligned */
8556
RW_IRAM1 AlignExpr(+0, 16)
8657
{
@@ -91,32 +62,6 @@ LR_IROM1 MBED_APP_START
9162
{
9263
}
9364

94-
#elif TFM_LVL == 1
95-
96-
TFM_SECURE_STACK AlignExpr(+0, 128) EMPTY 0x1000
97-
{
98-
}
99-
100-
TFM_UNPRIV_SCRATCH AlignExpr(+0, 32) EMPTY 0x400
101-
{
102-
}
103-
104-
/* 16 byte-aligned */
105-
ER_TFM_DATA AlignExpr(+0, 16)
106-
{
107-
.ANY (+RW +ZI)
108-
}
109-
110-
ARM_LIB_HEAP AlignExpr(+0, 16) EMPTY (MBED_RAM_APP_START + MBED_RAM_APP_SIZE - AlignExpr(ImageLimit(ER_TFM_DATA), 16))
111-
{
112-
}
113-
114-
#elif TFM_LVL > 1
115-
116-
#error("TFM level 2/3 are not supported yet")
117-
118-
#endif
119-
12065
}
12166

12267
LR_IROM_NSC NU_TZ_NSC_START NU_TZ_NSC_SIZE
@@ -132,8 +77,3 @@ ScatterAssert(ImageBase(ER_IROM_NSC) >= 0x800)
13277

13378
/* Heap must be allocated in RAM. */
13479
ScatterAssert(ImageLimit(ARM_LIB_HEAP) <= (MBED_RAM_APP_START + MBED_RAM_APP_SIZE))
135-
136-
#if (TFM_LVL > 0)
137-
/* Application ROM code cannot overlap with TDB internal storage area. */
138-
ScatterAssert(LoadLimit(LR_IROM1) <= NU_TDB_INTERNAL_STORAGE_START)
139-
#endif

targets/TARGET_NUVOTON/TARGET_M2354/TARGET_M23_S/device/TOOLCHAIN_GCC_ARM/M2354.ld

Lines changed: 1 addition & 154 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,8 @@
2626
#define MBED_BOOT_STACK_SIZE 0x400
2727
#endif
2828

29-
#if (TFM_LVL == 0)
30-
3129
StackSize = MBED_BOOT_STACK_SIZE;
3230

33-
#else
34-
35-
#warning("Ignore MBED_BOOT_STACK_SIZE in Secure PSA build")
36-
__msp_stack_size__ = 0x00000800;
37-
__psp_stack_size__ = 0x00000800;
38-
39-
#endif
40-
4131
MEMORY
4232
{
4333
VECTORS (rx) : ORIGIN = MBED_APP_START, LENGTH = 0x00000400
@@ -49,7 +39,7 @@ MEMORY
4939
/**
5040
* Must match cmsis_nvic.h
5141
*/
52-
__vector_size = 4 * (16 + 114);
42+
__vector_size = 4 * (16 + 116);
5343

5444

5545
/* Linker script to place sections and symbol values. Should be used together
@@ -89,8 +79,6 @@ SECTIONS
8979
. = ALIGN(8);
9080
} > VECTORS
9181

92-
#if (TFM_LVL == 0)
93-
9482
.copy.table : ALIGN(4)
9583
{
9684
__copy_table_start__ = .;
@@ -108,35 +96,6 @@ SECTIONS
10896
__zero_table_end__ = .;
10997
} > FLASH
11098

111-
#elif (TFM_LVL == 1)
112-
113-
.copy.table : ALIGN(4)
114-
{
115-
__copy_table_start__ = .;
116-
LONG (LOADADDR(.TFM_DATA))
117-
LONG (ADDR(.TFM_DATA))
118-
LONG (SIZEOF(.TFM_DATA))
119-
__copy_table_end__ = .;
120-
} > FLASH
121-
122-
.zero.table : ALIGN(4)
123-
{
124-
__zero_table_start__ = .;
125-
LONG (ADDR(.TFM_BSS))
126-
LONG (SIZEOF(.TFM_BSS))
127-
LONG (ADDR(.TFM_SECURE_STACK))
128-
LONG (SIZEOF(.TFM_SECURE_STACK))
129-
LONG (ADDR(.TFM_UNPRIV_SCRATCH))
130-
LONG (SIZEOF(.TFM_UNPRIV_SCRATCH))
131-
__zero_table_end__ = .;
132-
} > FLASH
133-
134-
#else
135-
136-
#error("TFM level 2/3 are not supported yet")
137-
138-
#endif
139-
14099
.text :
141100
{
142101
*(.text*)
@@ -174,8 +133,6 @@ SECTIONS
174133
* is assigned conditionally according to Secure PSA or not.
175134
*/
176135

177-
#if (TFM_LVL == 0)
178-
179136
.stack (NOLOAD) :
180137
{
181138
. = ALIGN(8);
@@ -186,54 +143,6 @@ SECTIONS
186143

187144
PROVIDE(__stack = __StackTop);
188145

189-
#else
190-
191-
.msp_stack (NOLOAD) :
192-
{
193-
. = ALIGN(32);
194-
. += __msp_stack_size__;
195-
} > RAM_INTERN
196-
Image$$ARM_LIB_STACK_MSP$$ZI$$Base = ADDR(.msp_stack);
197-
Image$$ARM_LIB_STACK_MSP$$ZI$$Limit = ADDR(.msp_stack) + SIZEOF(.msp_stack);
198-
__StackLimit = Image$$ARM_LIB_STACK_MSP$$ZI$$Base;
199-
__StackTop = Image$$ARM_LIB_STACK_MSP$$ZI$$Limit;
200-
201-
.psp_stack (NOLOAD) :
202-
{
203-
. = ALIGN(32);
204-
. += __psp_stack_size__;
205-
} > RAM_INTERN
206-
Image$$ARM_LIB_STACK$$ZI$$Base = ADDR(.psp_stack);
207-
Image$$ARM_LIB_STACK$$ZI$$Limit = ADDR(.psp_stack) + SIZEOF(.psp_stack);
208-
209-
PROVIDE(__stack = Image$$ARM_LIB_STACK$$ZI$$Limit);
210-
211-
#endif
212-
213-
#if (TFM_LVL == 1)
214-
215-
.TFM_SECURE_STACK (NOLOAD) :
216-
{
217-
. = ALIGN(128);
218-
. += 0x1000;
219-
} > RAM_INTERN
220-
Image$$TFM_SECURE_STACK$$ZI$$Base = ADDR(.TFM_SECURE_STACK);
221-
Image$$TFM_SECURE_STACK$$ZI$$Limit = ADDR(.TFM_SECURE_STACK) + SIZEOF(.TFM_SECURE_STACK);
222-
223-
.TFM_UNPRIV_SCRATCH (NOLOAD) :
224-
{
225-
. = ALIGN(32);
226-
. += 0x400;
227-
} > RAM_INTERN
228-
Image$$TFM_UNPRIV_SCRATCH$$ZI$$Base = ADDR(.TFM_UNPRIV_SCRATCH);
229-
Image$$TFM_UNPRIV_SCRATCH$$ZI$$Limit = ADDR(.TFM_UNPRIV_SCRATCH) + SIZEOF(.TFM_UNPRIV_SCRATCH);
230-
231-
#elif (TFM_LVL > 1)
232-
233-
#error("TFM level 2/3 are not supported yet")
234-
235-
#endif
236-
237146
.ARM.extab :
238147
{
239148
*(.ARM.extab* .gnu.linkonce.armextab.*)
@@ -255,8 +164,6 @@ SECTIONS
255164
PROVIDE(__end_vector_table__ = .);
256165
} > RAM_INTERN
257166

258-
#if (TFM_LVL == 0)
259-
260167
.data :
261168
{
262169
PROVIDE( __etext = LOADADDR(.data) );
@@ -299,66 +206,6 @@ SECTIONS
299206
__bss_end__ = .;
300207
} > RAM_INTERN
301208

302-
#else
303-
304-
.TFM_DATA :
305-
{
306-
PROVIDE( __etext = LOADADDR(.TFM_DATA) );
307-
308-
. = ALIGN(4);
309-
310-
__data_start__ = .;
311-
312-
*(.data*)
313-
314-
. = ALIGN(4);
315-
/* preinit data */
316-
PROVIDE_HIDDEN (__preinit_array_start = .);
317-
KEEP(*(.preinit_array))
318-
PROVIDE_HIDDEN (__preinit_array_end = .);
319-
320-
. = ALIGN(4);
321-
/* init data */
322-
PROVIDE_HIDDEN (__init_array_start = .);
323-
KEEP(*(SORT(.init_array.*)))
324-
KEEP(*(.init_array))
325-
PROVIDE_HIDDEN (__init_array_end = .);
326-
327-
. = ALIGN(4);
328-
/* finit data */
329-
PROVIDE_HIDDEN (__fini_array_start = .);
330-
KEEP(*(SORT(.fini_array.*)))
331-
KEEP(*(.fini_array))
332-
PROVIDE_HIDDEN (__fini_array_end = .);
333-
334-
KEEP(*(.jcr*))
335-
. = ALIGN(4);
336-
337-
__data_end__ = .;
338-
339-
} > RAM_INTERN AT>FLASH
340-
Image$$ER_TFM_DATA$$RW$$Base = ADDR(.TFM_DATA);
341-
Image$$ER_TFM_DATA$$RW$$Limit = ADDR(.TFM_DATA) + SIZEOF(.TFM_DATA);
342-
343-
.TFM_BSS (NOLOAD) :
344-
{
345-
. = ALIGN(4);
346-
__bss_start__ = .;
347-
*(.bss*)
348-
*(COMMON)
349-
. = ALIGN(4);
350-
__bss_end__ = .;
351-
} > RAM_INTERN
352-
Image$$ER_TFM_DATA$$ZI$$Base = ADDR(.TFM_BSS);
353-
Image$$ER_TFM_DATA$$ZI$$Limit = ADDR(.TFM_BSS) + SIZEOF(.TFM_BSS);
354-
355-
#endif
356-
357-
#if (TFM_LVL > 0)
358-
/* Application ROM code cannot overlap with TDB internal storage area. */
359-
ASSERT((LOADADDR(.TFM_DATA) + SIZEOF(.TFM_DATA)) <= NU_TDB_INTERNAL_STORAGE_START, "Application ROM code cannot overlap with TDB internal storage area.")
360-
#endif
361-
362209
/* Veneer$$CMSE : */
363210
.gnu.sgstubs NU_TZ_NSC_START :
364211
{

0 commit comments

Comments
 (0)