summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWayne Lin <[email protected]>2021-03-15 15:41:41 +0800
committerWayne Lin <[email protected]>2021-03-15 15:41:41 +0800
commit6ec6285e1be98a667f82d20054c66edb553823bc (patch)
tree0af6d60c303b4c853acd23819777a282681c4880
parent4a0855c276d22c4af3dc6f6bda1437fa69344af6 (diff)
[nuvoton] Update BSP.
1. Add NUC980 Chili board supporting. 2. Correct NuMicro.h including. 3. Implement rt_hw_us_delay system call function. 4. Move board.c to drv_common.c for M480 and M2354 series.
-rw-r--r--bsp/nuvoton/README.md5
-rw-r--r--bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/NuMicro.h1
-rw-r--r--bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/system_M2354.h12
-rw-r--r--bsp/nuvoton/libraries/m2354/StdDriver/lib/libStdDriver.ewp2
-rw-r--r--bsp/nuvoton/libraries/m2354/StdDriver/lib/libStdDriver.uvprojx2
-rw-r--r--bsp/nuvoton/libraries/m2354/rtt_port/drv_bpwm_capture.c2
-rw-r--r--bsp/nuvoton/libraries/m2354/rtt_port/drv_can.c2
-rw-r--r--bsp/nuvoton/libraries/m2354/rtt_port/drv_clk.c2
-rw-r--r--bsp/nuvoton/libraries/m2354/rtt_port/drv_common.c (renamed from bsp/nuvoton/numaker-m2354/board/board.c)39
-rw-r--r--bsp/nuvoton/libraries/m2354/rtt_port/drv_eadc.c2
-rw-r--r--bsp/nuvoton/libraries/m2354/rtt_port/drv_ebi.h2
-rw-r--r--bsp/nuvoton/libraries/m2354/rtt_port/drv_ecap.c2
-rw-r--r--bsp/nuvoton/libraries/m2354/rtt_port/drv_epwm_capture.c2
-rw-r--r--bsp/nuvoton/libraries/m2354/rtt_port/drv_fmc.h2
-rw-r--r--bsp/nuvoton/libraries/m2354/rtt_port/drv_gpio.c2
-rw-r--r--bsp/nuvoton/libraries/m2354/rtt_port/drv_i2c.c2
-rw-r--r--bsp/nuvoton/libraries/m2354/rtt_port/drv_i2s.c3
-rw-r--r--bsp/nuvoton/libraries/m2354/rtt_port/drv_i2s.h2
-rw-r--r--bsp/nuvoton/libraries/m2354/rtt_port/drv_otg.c2
-rw-r--r--bsp/nuvoton/libraries/m2354/rtt_port/drv_pdma.h2
-rw-r--r--bsp/nuvoton/libraries/m2354/rtt_port/drv_rtc.c11
-rw-r--r--bsp/nuvoton/libraries/m2354/rtt_port/drv_scuart.c2
-rw-r--r--bsp/nuvoton/libraries/m2354/rtt_port/drv_sdh.c2
-rw-r--r--bsp/nuvoton/libraries/m2354/rtt_port/drv_slcd.c2
-rw-r--r--bsp/nuvoton/libraries/m2354/rtt_port/drv_slcd.h2
-rw-r--r--bsp/nuvoton/libraries/m2354/rtt_port/drv_softi2c.c44
-rw-r--r--bsp/nuvoton/libraries/m2354/rtt_port/drv_spi.h2
-rw-r--r--bsp/nuvoton/libraries/m2354/rtt_port/drv_spii2s.c3
-rw-r--r--bsp/nuvoton/libraries/m2354/rtt_port/drv_timer.c2
-rw-r--r--bsp/nuvoton/libraries/m2354/rtt_port/drv_timer_capture.c2
-rw-r--r--bsp/nuvoton/libraries/m2354/rtt_port/drv_uart.c2
-rw-r--r--bsp/nuvoton/libraries/m2354/rtt_port/drv_ui2c.c2
-rw-r--r--bsp/nuvoton/libraries/m2354/rtt_port/drv_usbhost.c2
-rw-r--r--bsp/nuvoton/libraries/m2354/rtt_port/drv_uspi.c2
-rw-r--r--bsp/nuvoton/libraries/m2354/rtt_port/drv_uuart.c2
-rw-r--r--bsp/nuvoton/libraries/m2354/rtt_port/drv_wdt.c2
-rw-r--r--bsp/nuvoton/libraries/m480/rtt_port/drv_bpwm_capture.c2
-rw-r--r--bsp/nuvoton/libraries/m480/rtt_port/drv_can.c2
-rw-r--r--bsp/nuvoton/libraries/m480/rtt_port/drv_clk.c2
-rw-r--r--bsp/nuvoton/libraries/m480/rtt_port/drv_common.c (renamed from bsp/nuvoton/numaker-iot-m487/board/board.c)43
-rw-r--r--bsp/nuvoton/libraries/m480/rtt_port/drv_eadc.c2
-rw-r--r--bsp/nuvoton/libraries/m480/rtt_port/drv_ebi.h2
-rw-r--r--bsp/nuvoton/libraries/m480/rtt_port/drv_ecap.c2
-rw-r--r--bsp/nuvoton/libraries/m480/rtt_port/drv_emac.c2
-rw-r--r--bsp/nuvoton/libraries/m480/rtt_port/drv_epwm_capture.c2
-rw-r--r--bsp/nuvoton/libraries/m480/rtt_port/drv_fmc.h2
-rw-r--r--bsp/nuvoton/libraries/m480/rtt_port/drv_gpio.c2
-rw-r--r--bsp/nuvoton/libraries/m480/rtt_port/drv_hsotg.c2
-rw-r--r--bsp/nuvoton/libraries/m480/rtt_port/drv_i2c.c2
-rw-r--r--bsp/nuvoton/libraries/m480/rtt_port/drv_i2s.c3
-rw-r--r--bsp/nuvoton/libraries/m480/rtt_port/drv_i2s.h2
-rw-r--r--bsp/nuvoton/libraries/m480/rtt_port/drv_pdma.h2
-rw-r--r--bsp/nuvoton/libraries/m480/rtt_port/drv_rtc.c2
-rw-r--r--bsp/nuvoton/libraries/m480/rtt_port/drv_scuart.c2
-rw-r--r--bsp/nuvoton/libraries/m480/rtt_port/drv_sdh.c2
-rw-r--r--bsp/nuvoton/libraries/m480/rtt_port/drv_softi2c.c44
-rw-r--r--bsp/nuvoton/libraries/m480/rtt_port/drv_spi.h2
-rw-r--r--bsp/nuvoton/libraries/m480/rtt_port/drv_spii2s.c3
-rw-r--r--bsp/nuvoton/libraries/m480/rtt_port/drv_timer.c2
-rw-r--r--bsp/nuvoton/libraries/m480/rtt_port/drv_timer_capture.c2
-rw-r--r--bsp/nuvoton/libraries/m480/rtt_port/drv_uart.c2
-rw-r--r--bsp/nuvoton/libraries/m480/rtt_port/drv_ui2c.c2
-rw-r--r--bsp/nuvoton/libraries/m480/rtt_port/drv_usbhost.c2
-rw-r--r--bsp/nuvoton/libraries/m480/rtt_port/drv_uspi.c2
-rw-r--r--bsp/nuvoton/libraries/m480/rtt_port/drv_uuart.c2
-rw-r--r--bsp/nuvoton/libraries/m480/rtt_port/drv_wdt.c2
-rw-r--r--bsp/nuvoton/libraries/nu_packages/AudioCodec/acodec_nau88l25.c6
-rw-r--r--bsp/nuvoton/libraries/nu_packages/AudioCodec/audio_test.c8
-rw-r--r--bsp/nuvoton/libraries/nuc980/rtt_port/Kconfig15
-rw-r--r--bsp/nuvoton/libraries/nuc980/rtt_port/drv_adc.c2
-rw-r--r--bsp/nuvoton/libraries/nuc980/rtt_port/drv_can.c2
-rw-r--r--bsp/nuvoton/libraries/nuc980/rtt_port/drv_ebi.h2
-rw-r--r--bsp/nuvoton/libraries/nuc980/rtt_port/drv_emac.c4
-rw-r--r--bsp/nuvoton/libraries/nuc980/rtt_port/drv_etimer.c2
-rw-r--r--bsp/nuvoton/libraries/nuc980/rtt_port/drv_etimer_capture.c2
-rw-r--r--bsp/nuvoton/libraries/nuc980/rtt_port/drv_gpio.c2
-rw-r--r--bsp/nuvoton/libraries/nuc980/rtt_port/drv_i2c.c2
-rw-r--r--bsp/nuvoton/libraries/nuc980/rtt_port/drv_i2s.c2
-rw-r--r--bsp/nuvoton/libraries/nuc980/rtt_port/drv_i2s.h2
-rw-r--r--bsp/nuvoton/libraries/nuc980/rtt_port/drv_pdma.h2
-rw-r--r--bsp/nuvoton/libraries/nuc980/rtt_port/drv_rtc.c2
-rw-r--r--bsp/nuvoton/libraries/nuc980/rtt_port/drv_scuart.c5
-rw-r--r--bsp/nuvoton/libraries/nuc980/rtt_port/drv_sdh.c2
-rw-r--r--bsp/nuvoton/libraries/nuc980/rtt_port/drv_softi2c.c4
-rw-r--r--bsp/nuvoton/libraries/nuc980/rtt_port/drv_spi.h2
-rw-r--r--bsp/nuvoton/libraries/nuc980/rtt_port/drv_sys.c18
-rw-r--r--bsp/nuvoton/libraries/nuc980/rtt_port/drv_systick.c7
-rw-r--r--bsp/nuvoton/libraries/nuc980/rtt_port/drv_uart.c33
-rw-r--r--bsp/nuvoton/libraries/nuc980/rtt_port/drv_uart.h1
-rw-r--r--bsp/nuvoton/libraries/nuc980/rtt_port/drv_usbd.c2
-rw-r--r--bsp/nuvoton/libraries/nuc980/rtt_port/drv_usbhost.c2
-rw-r--r--bsp/nuvoton/libraries/nuc980/rtt_port/drv_wdt.c2
-rw-r--r--bsp/nuvoton/nk-980iot/board/board.h2
-rw-r--r--bsp/nuvoton/nk-rtu980/.config828
-rw-r--r--bsp/nuvoton/nk-rtu980/Kconfig29
-rw-r--r--bsp/nuvoton/nk-rtu980/README.md106
-rw-r--r--bsp/nuvoton/nk-rtu980/SConscript14
-rw-r--r--bsp/nuvoton/nk-rtu980/SConstruct55
-rw-r--r--bsp/nuvoton/nk-rtu980/applications/SConscript11
-rw-r--r--bsp/nuvoton/nk-rtu980/applications/main.c71
-rw-r--r--bsp/nuvoton/nk-rtu980/applications/mnt.c237
-rw-r--r--bsp/nuvoton/nk-rtu980/board/Kconfig48
-rw-r--r--bsp/nuvoton/nk-rtu980/board/SConscript14
-rw-r--r--bsp/nuvoton/nk-rtu980/board/board.h43
-rw-r--r--bsp/nuvoton/nk-rtu980/board/board_dev.c236
-rw-r--r--bsp/nuvoton/nk-rtu980/board/fal_cfg.h46
-rw-r--r--bsp/nuvoton/nk-rtu980/board/nu_pin_init.c85
-rw-r--r--bsp/nuvoton/nk-rtu980/linking_scripts/nuc980.ld114
-rw-r--r--bsp/nuvoton/nk-rtu980/linking_scripts/nuc980.sct11
-rw-r--r--bsp/nuvoton/nk-rtu980/rtconfig.py88
-rw-r--r--bsp/nuvoton/nk-rtu980/template.uvproj394
-rw-r--r--bsp/nuvoton/nk-rtu980/template.uvprojx387
-rw-r--r--bsp/nuvoton/numaker-pfm-m487/board/board.c97
113 files changed, 3068 insertions, 300 deletions
diff --git a/bsp/nuvoton/README.md b/bsp/nuvoton/README.md
index dfa048ab2f..9d0c433984 100644
--- a/bsp/nuvoton/README.md
+++ b/bsp/nuvoton/README.md
@@ -1,4 +1,4 @@
-# Nuvoton BSP descriptions
+�? Nuvoton BSP descriptions
Current supported BSP shown in below table:
| **BSP folder** | **Board name** |
@@ -6,4 +6,5 @@ Current supported BSP shown in below table:
| [numaker-iot-m487](numaker-iot-m487) | Nuvoton NuMaker-IoT-M487 |
| [numaker-pfm-m487](numaker-pfm-m487) | Nuvoton NuMaker-PFM-M487 |
| [nk-980iot](nk-980iot) | Nuvoton NK-980IOT |
-| [numaker-m2354](numaker-m2354) | Nuvoton NuMaker-M2354 | \ No newline at end of file
+| [numaker-m2354](numaker-m2354) | Nuvoton NuMaker-M2354 |
+| [nk-rtu980](nk-rtu980) | Nuvoton NK-RTU980 | \ No newline at end of file
diff --git a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/NuMicro.h b/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/NuMicro.h
index 548ab843cc..cccccd4e7a 100644
--- a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/NuMicro.h
+++ b/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/NuMicro.h
@@ -9,6 +9,7 @@
#ifndef __NUMICRO_H__
#define __NUMICRO_H__
+#include "nutool_clkcfg.h"
#include "M2354.h"
#endif /* __NUMICRO_H__ */
diff --git a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/system_M2354.h b/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/system_M2354.h
index ba5bbc1f4d..edf1e3e6e5 100644
--- a/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/system_M2354.h
+++ b/bsp/nuvoton/libraries/m2354/Device/Nuvoton/M2354/Include/system_M2354.h
@@ -49,11 +49,21 @@ extern "C" {
/*----------------------------------------------------------------------------
Define SYSCLK
*----------------------------------------------------------------------------*/
+#ifndef __HXT
#define __HXT (12000000UL) /*!< External Crystal Clock Frequency */
+#endif
+
#define __LIRC (32000UL) /*!< Internal 32K RC Oscillator Frequency */
#define __HIRC (12000000UL) /*!< Internal 12M RC Oscillator Frequency */
+
+#ifndef __LXT
#define __LXT (32768UL) /*!< External Crystal Clock Frequency 32.768KHz */
+#endif
+
+#ifndef __HSI
#define __HSI (48000000UL) /*!< PLL Output Clock Frequency */
+#endif
+
#define __HIRC48 (48000000UL) /*!< Internal 48M RC Oscillator Frequency */
#define __LIRC32 (32000UL) /*!< Internal 32K RC Oscillator Frequency */
#define __MIRC (4000000UL) /*!< Internal 4M RC Oscillator Frequency */
@@ -93,7 +103,7 @@ extern uint32_t __PC(void); /*!< Return the current program counter valu
*/
#define ASSERT_PARAM(expr) { if (!(expr)) { AssertError((uint8_t*)__FILE__, __LINE__); } }
-void AssertError(uint8_t* file, uint32_t line);
+void AssertError(uint8_t *file, uint32_t line);
#else
#define ASSERT_PARAM(expr)
#endif
diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/lib/libStdDriver.ewp b/bsp/nuvoton/libraries/m2354/StdDriver/lib/libStdDriver.ewp
index 555ab69852..69c44b7d03 100644
--- a/bsp/nuvoton/libraries/m2354/StdDriver/lib/libStdDriver.ewp
+++ b/bsp/nuvoton/libraries/m2354/StdDriver/lib/libStdDriver.ewp
@@ -348,6 +348,7 @@
<state>$PROJ_DIR$\..\..\Device\Nuvoton\M2354\Include</state>
<state>$PROJ_DIR$\..\..\CMSIS\Include</state>
<state>$PROJ_DIR$\..\inc</state>
+ <state>$PROJ_DIR$</state>
</option>
<option>
<name>CCStdIncCheck</name>
@@ -1385,6 +1386,7 @@
<state>$PROJ_DIR$\..\..\Device\Nuvoton\M2354\Include</state>
<state>$PROJ_DIR$\..\..\CMSIS\Include</state>
<state>$PROJ_DIR$\..\inc</state>
+ <state>$PROJ_DIR$</state>
</option>
<option>
<name>CCStdIncCheck</name>
diff --git a/bsp/nuvoton/libraries/m2354/StdDriver/lib/libStdDriver.uvprojx b/bsp/nuvoton/libraries/m2354/StdDriver/lib/libStdDriver.uvprojx
index a847869d1c..b28ca38daf 100644
--- a/bsp/nuvoton/libraries/m2354/StdDriver/lib/libStdDriver.uvprojx
+++ b/bsp/nuvoton/libraries/m2354/StdDriver/lib/libStdDriver.uvprojx
@@ -338,7 +338,7 @@
<MiscControls></MiscControls>
<Define></Define>
<Undefine></Undefine>
- <IncludePath>..\inc;..\..\CMSIS\Include;..\..\Device\Nuvoton\M2354\Include</IncludePath>
+ <IncludePath>..\inc;..\..\CMSIS\Include;..\..\Device\Nuvoton\M2354\Include;.</IncludePath>
</VariousControls>
</Cads>
<Aads>
diff --git a/bsp/nuvoton/libraries/m2354/rtt_port/drv_bpwm_capture.c b/bsp/nuvoton/libraries/m2354/rtt_port/drv_bpwm_capture.c
index d7240768de..5c3b634e5e 100644
--- a/bsp/nuvoton/libraries/m2354/rtt_port/drv_bpwm_capture.c
+++ b/bsp/nuvoton/libraries/m2354/rtt_port/drv_bpwm_capture.c
@@ -14,7 +14,7 @@
#if defined(BSP_USING_BPWM_CAPTURE)
#if ((BSP_USING_BPWM0_CAPTURE_CHMSK+BSP_USING_BPWM1_CAPTURE_CHMSK)!=0)
#include <rtdevice.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
/* Private typedef --------------------------------------------------------------*/
typedef struct _bpwm_dev
diff --git a/bsp/nuvoton/libraries/m2354/rtt_port/drv_can.c b/bsp/nuvoton/libraries/m2354/rtt_port/drv_can.c
index 8bf2a703e1..614705fcc5 100644
--- a/bsp/nuvoton/libraries/m2354/rtt_port/drv_can.c
+++ b/bsp/nuvoton/libraries/m2354/rtt_port/drv_can.c
@@ -16,7 +16,7 @@
#include <rtdevice.h>
#include <rthw.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
/* Private Define ---------------------------------------------------------------*/
#define RX_MSG_ID_INDEX 16
diff --git a/bsp/nuvoton/libraries/m2354/rtt_port/drv_clk.c b/bsp/nuvoton/libraries/m2354/rtt_port/drv_clk.c
index db79a541f9..92de24a86f 100644
--- a/bsp/nuvoton/libraries/m2354/rtt_port/drv_clk.c
+++ b/bsp/nuvoton/libraries/m2354/rtt_port/drv_clk.c
@@ -18,7 +18,7 @@
#include <rtdbg.h>
#include <stdint.h>
#include <string.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
/* Private define ---------------------------------------------------------------*/
diff --git a/bsp/nuvoton/numaker-m2354/board/board.c b/bsp/nuvoton/libraries/m2354/rtt_port/drv_common.c
index 868dd7591f..1dbd98f187 100644
--- a/bsp/nuvoton/numaker-m2354/board/board.c
+++ b/bsp/nuvoton/libraries/m2354/rtt_port/drv_common.c
@@ -12,7 +12,7 @@
#include <rtconfig.h>
#include <rtthread.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
#include <nu_bitutil.h>
#include "drv_uart.h"
#include "board.h"
@@ -24,7 +24,7 @@
/**
* This function will initial M487 board.
*/
-void rt_hw_board_init(void)
+RT_WEAK void rt_hw_board_init(void)
{
/* Init System/modules clock */
nutool_modclkcfg_init();
@@ -68,6 +68,41 @@ void rt_hw_board_init(void)
}
/**
+ * The time delay function.
+ *
+ * @param microseconds.
+ */
+void rt_hw_us_delay(rt_uint32_t us)
+{
+ rt_uint32_t ticks;
+ rt_uint32_t told, tnow, tcnt = 0;
+ rt_uint32_t reload = SysTick->LOAD;
+
+ ticks = us * reload / (1000000 / RT_TICK_PER_SECOND);
+ told = SysTick->VAL;
+ while (1)
+ {
+ tnow = SysTick->VAL;
+ if (tnow != told)
+ {
+ if (tnow < told)
+ {
+ tcnt += told - tnow;
+ }
+ else
+ {
+ tcnt += reload - tnow + told;
+ }
+ told = tnow;
+ if (tcnt >= ticks)
+ {
+ break;
+ }
+ }
+ }
+}
+
+/**
* This is the timer interrupt service routine.
*
*/
diff --git a/bsp/nuvoton/libraries/m2354/rtt_port/drv_eadc.c b/bsp/nuvoton/libraries/m2354/rtt_port/drv_eadc.c
index 99ff8ae46d..3c72536156 100644
--- a/bsp/nuvoton/libraries/m2354/rtt_port/drv_eadc.c
+++ b/bsp/nuvoton/libraries/m2354/rtt_port/drv_eadc.c
@@ -11,7 +11,7 @@
#include <rtconfig.h>
#include <rtdevice.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
#ifdef BSP_USING_EADC
diff --git a/bsp/nuvoton/libraries/m2354/rtt_port/drv_ebi.h b/bsp/nuvoton/libraries/m2354/rtt_port/drv_ebi.h
index 9a2f45fbc3..c58fada77d 100644
--- a/bsp/nuvoton/libraries/m2354/rtt_port/drv_ebi.h
+++ b/bsp/nuvoton/libraries/m2354/rtt_port/drv_ebi.h
@@ -13,7 +13,7 @@
#define __DRV_EBI_H___
#include <rtdevice.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
/**
* @brief Initialize EBI for specify Bank
diff --git a/bsp/nuvoton/libraries/m2354/rtt_port/drv_ecap.c b/bsp/nuvoton/libraries/m2354/rtt_port/drv_ecap.c
index 0e354373af..c9e7c66a8d 100644
--- a/bsp/nuvoton/libraries/m2354/rtt_port/drv_ecap.c
+++ b/bsp/nuvoton/libraries/m2354/rtt_port/drv_ecap.c
@@ -14,7 +14,7 @@
#if defined(BSP_USING_ECAP)
#if ((BSP_USING_ECAP0_CHMSK+BSP_USING_ECAP1_CHMSK)!=0)
#include <rtdevice.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
#define ECAP_CH0_POS (0)
#define ECAP_CH1_POS (1)
diff --git a/bsp/nuvoton/libraries/m2354/rtt_port/drv_epwm_capture.c b/bsp/nuvoton/libraries/m2354/rtt_port/drv_epwm_capture.c
index 355c395583..c98452d44b 100644
--- a/bsp/nuvoton/libraries/m2354/rtt_port/drv_epwm_capture.c
+++ b/bsp/nuvoton/libraries/m2354/rtt_port/drv_epwm_capture.c
@@ -14,7 +14,7 @@
#if defined(BSP_USING_EPWM_CAPTURE)
#if ((BSP_USING_EPWM0_CAPTURE_CHMSK+BSP_USING_EPWM1_CAPTURE_CHMSK)!=0)
#include <rtdevice.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
#define EPWM_CH0CH1_POS (0)
#define EPWM_CH2CH3_POS (2)
diff --git a/bsp/nuvoton/libraries/m2354/rtt_port/drv_fmc.h b/bsp/nuvoton/libraries/m2354/rtt_port/drv_fmc.h
index 9a9ef373c3..d189d1102c 100644
--- a/bsp/nuvoton/libraries/m2354/rtt_port/drv_fmc.h
+++ b/bsp/nuvoton/libraries/m2354/rtt_port/drv_fmc.h
@@ -14,7 +14,7 @@
#define __DRV_FMC_H__
#include <rtthread.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
int nu_fmc_read(long offset, uint8_t *buf, size_t size);
int nu_fmc_write(long offset, const uint8_t *buf, size_t size);
diff --git a/bsp/nuvoton/libraries/m2354/rtt_port/drv_gpio.c b/bsp/nuvoton/libraries/m2354/rtt_port/drv_gpio.c
index c4461694de..727ef964fa 100644
--- a/bsp/nuvoton/libraries/m2354/rtt_port/drv_gpio.c
+++ b/bsp/nuvoton/libraries/m2354/rtt_port/drv_gpio.c
@@ -16,7 +16,7 @@
#include <rtdevice.h>
#include <rthw.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
#include <nu_bitutil.h>
#include <drv_gpio.h>
#include <stdlib.h>
diff --git a/bsp/nuvoton/libraries/m2354/rtt_port/drv_i2c.c b/bsp/nuvoton/libraries/m2354/rtt_port/drv_i2c.c
index b1e314dbc2..eba23ef245 100644
--- a/bsp/nuvoton/libraries/m2354/rtt_port/drv_i2c.c
+++ b/bsp/nuvoton/libraries/m2354/rtt_port/drv_i2c.c
@@ -14,7 +14,7 @@
#ifdef BSP_USING_I2C
#include <rtdevice.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
/* Private define ---------------------------------------------------------------*/
#define LOG_TAG "drv.i2c"
diff --git a/bsp/nuvoton/libraries/m2354/rtt_port/drv_i2s.c b/bsp/nuvoton/libraries/m2354/rtt_port/drv_i2s.c
index d76cb27314..be576e61c6 100644
--- a/bsp/nuvoton/libraries/m2354/rtt_port/drv_i2s.c
+++ b/bsp/nuvoton/libraries/m2354/rtt_port/drv_i2s.c
@@ -220,7 +220,8 @@ static rt_err_t nu_i2s_dai_setup(nu_i2s_t psNuI2s, struct rt_audio_configure *pc
}
/* Set MCLK and enable MCLK */
- I2S_EnableMCLK(psNuI2s->i2s_base, __HXT);
+ /* The target MCLK is related to audio codec setting. */
+ I2S_EnableMCLK(psNuI2s->i2s_base, 12000000);
/* Set unmute */
if (pNuACodecOps->nu_acodec_mixer_control)
diff --git a/bsp/nuvoton/libraries/m2354/rtt_port/drv_i2s.h b/bsp/nuvoton/libraries/m2354/rtt_port/drv_i2s.h
index 3fe99f3e3b..9ee00646b8 100644
--- a/bsp/nuvoton/libraries/m2354/rtt_port/drv_i2s.h
+++ b/bsp/nuvoton/libraries/m2354/rtt_port/drv_i2s.h
@@ -14,7 +14,7 @@
#define __DRV_I2S_H__
#include <rtdevice.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
#include <drv_pdma.h>
#if !defined(NU_I2S_DMA_FIFO_SIZE)
diff --git a/bsp/nuvoton/libraries/m2354/rtt_port/drv_otg.c b/bsp/nuvoton/libraries/m2354/rtt_port/drv_otg.c
index 035051f59d..23cd82f738 100644
--- a/bsp/nuvoton/libraries/m2354/rtt_port/drv_otg.c
+++ b/bsp/nuvoton/libraries/m2354/rtt_port/drv_otg.c
@@ -14,7 +14,7 @@
#if defined(BSP_USING_OTG)
#include <rtdevice.h>
#include <rtdbg.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
/* This delay must be at least 10 us */
static void _usb_init_delay(void)
diff --git a/bsp/nuvoton/libraries/m2354/rtt_port/drv_pdma.h b/bsp/nuvoton/libraries/m2354/rtt_port/drv_pdma.h
index 96cbf2c1e0..954582f943 100644
--- a/bsp/nuvoton/libraries/m2354/rtt_port/drv_pdma.h
+++ b/bsp/nuvoton/libraries/m2354/rtt_port/drv_pdma.h
@@ -15,7 +15,7 @@
#include <rtconfig.h>
#include <rtthread.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
#ifndef NU_PDMA_SGTBL_POOL_SIZE
#define NU_PDMA_SGTBL_POOL_SIZE (16)
diff --git a/bsp/nuvoton/libraries/m2354/rtt_port/drv_rtc.c b/bsp/nuvoton/libraries/m2354/rtt_port/drv_rtc.c
index 876628848b..44c2ee30dd 100644
--- a/bsp/nuvoton/libraries/m2354/rtt_port/drv_rtc.c
+++ b/bsp/nuvoton/libraries/m2354/rtt_port/drv_rtc.c
@@ -14,7 +14,8 @@
#if defined (BSP_USING_RTC)
#include <rtdevice.h>
-#include <NuMicro.h>
+#include <sys/time.h>
+#include "NuMicro.h"
/* Private define ---------------------------------------------------------------*/
@@ -184,8 +185,8 @@ static rt_err_t nu_rtc_is_date_valid(const time_t *const t)
if (!initialised)
{
- t_upper = mktime((struct tm *)&tm_upper);
- t_lower = mktime((struct tm *)&tm_lower);
+ t_upper = timegm((struct tm *)&tm_upper);
+ t_lower = timegm((struct tm *)&tm_lower);
initialised = RT_TRUE;
}
@@ -226,13 +227,13 @@ static rt_err_t nu_rtc_control(rt_device_t dev, int cmd, void *args)
tm_out.tm_hour = hw_time.u32Hour;
tm_out.tm_min = hw_time.u32Minute;
tm_out.tm_sec = hw_time.u32Second;
- *time = mktime(&tm_out);
+ *time = timegm(&tm_out);
break;
case RT_DEVICE_CTRL_RTC_SET_TIME:
time = (time_t *) args;
- tm_in = localtime(time);
+ tm_in = gmtime(time);
if (nu_rtc_is_date_valid(time) != RT_EOK)
return RT_ERROR;
diff --git a/bsp/nuvoton/libraries/m2354/rtt_port/drv_scuart.c b/bsp/nuvoton/libraries/m2354/rtt_port/drv_scuart.c
index 015fbbed01..3d83615002 100644
--- a/bsp/nuvoton/libraries/m2354/rtt_port/drv_scuart.c
+++ b/bsp/nuvoton/libraries/m2354/rtt_port/drv_scuart.c
@@ -14,7 +14,7 @@
#if defined(BSP_USING_SCUART)
-#include <NuMicro.h>
+#include "NuMicro.h"
#include <rtdevice.h>
#include <rthw.h>
diff --git a/bsp/nuvoton/libraries/m2354/rtt_port/drv_sdh.c b/bsp/nuvoton/libraries/m2354/rtt_port/drv_sdh.c
index ef3a45b96a..708f653d36 100644
--- a/bsp/nuvoton/libraries/m2354/rtt_port/drv_sdh.c
+++ b/bsp/nuvoton/libraries/m2354/rtt_port/drv_sdh.c
@@ -15,7 +15,7 @@
#if defined(BSP_USING_SDH)
#include <rtdevice.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
#include <drv_pdma.h>
#include <string.h>
diff --git a/bsp/nuvoton/libraries/m2354/rtt_port/drv_slcd.c b/bsp/nuvoton/libraries/m2354/rtt_port/drv_slcd.c
index d83831bc4a..3a673983a0 100644
--- a/bsp/nuvoton/libraries/m2354/rtt_port/drv_slcd.c
+++ b/bsp/nuvoton/libraries/m2354/rtt_port/drv_slcd.c
@@ -16,7 +16,7 @@
#include <rtdevice.h>
#include <rthw.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
#include <drv_slcd.h>
/* Private define ---------------------------------------------------------------*/
diff --git a/bsp/nuvoton/libraries/m2354/rtt_port/drv_slcd.h b/bsp/nuvoton/libraries/m2354/rtt_port/drv_slcd.h
index b644261c23..46ab04a50f 100644
--- a/bsp/nuvoton/libraries/m2354/rtt_port/drv_slcd.h
+++ b/bsp/nuvoton/libraries/m2354/rtt_port/drv_slcd.h
@@ -14,7 +14,7 @@
#define __DRV_SLCD_H__
#include <rtdevice.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
struct nu_slcd_pixel
{
diff --git a/bsp/nuvoton/libraries/m2354/rtt_port/drv_softi2c.c b/bsp/nuvoton/libraries/m2354/rtt_port/drv_softi2c.c
index ba1dca803e..a2a7ac7cc5 100644
--- a/bsp/nuvoton/libraries/m2354/rtt_port/drv_softi2c.c
+++ b/bsp/nuvoton/libraries/m2354/rtt_port/drv_softi2c.c
@@ -17,7 +17,7 @@
#include <rtthread.h>
#include <rthw.h>
#include <rtdevice.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
/* Private define ---------------------------------------------------------------*/
#define LOG_TAG "drv.softi2c"
@@ -65,7 +65,6 @@ struct nu_soft_i2c
};
/* Private functions ------------------------------------------------------------*/
-static void nu_soft_i2c_udelay(rt_uint32_t us);
static void nu_soft_i2c_set_sda(void *data, rt_int32_t state);
static void nu_soft_i2c_set_scl(void *data, rt_int32_t state);
static rt_int32_t nu_soft_i2c_get_sda(void *data);
@@ -91,7 +90,7 @@ static const struct rt_i2c_bit_ops nu_soft_i2c_bit_ops =
.set_scl = nu_soft_i2c_set_scl,
.get_sda = nu_soft_i2c_get_sda,
.get_scl = nu_soft_i2c_get_scl,
- .udelay = nu_soft_i2c_udelay,
+ .udelay = rt_hw_us_delay,
.delay_us = 1,
.timeout = 100
};
@@ -99,41 +98,6 @@ static const struct rt_i2c_bit_ops nu_soft_i2c_bit_ops =
/* Functions define ------------------------------------------------------------*/
/**
- * The time delay function.
- *
- * @param microseconds.
- */
-static void nu_soft_i2c_udelay(rt_uint32_t us)
-{
- rt_uint32_t ticks;
- rt_uint32_t told, tnow, tcnt = 0;
- rt_uint32_t reload = SysTick->LOAD;
-
- ticks = us * reload / (1000000 / RT_TICK_PER_SECOND);
- told = SysTick->VAL;
- while (1)
- {
- tnow = SysTick->VAL;
- if (tnow != told)
- {
- if (tnow < told)
- {
- tcnt += told - tnow;
- }
- else
- {
- tcnt += reload - tnow + told;
- }
- told = tnow;
- if (tcnt >= ticks)
- {
- break;
- }
- }
- }
-}
-
-/**
* This function initializes the soft i2c pin.
*
* @param soft i2c config class.
@@ -163,9 +127,9 @@ static rt_err_t nu_soft_i2c_bus_unlock(const struct nu_soft_i2c_config *cfg)
while (i++ < 9)
{
rt_pin_write(cfg->scl, PIN_HIGH);
- nu_soft_i2c_udelay(100);
+ rt_hw_us_delay(100);
rt_pin_write(cfg->scl, PIN_LOW);
- nu_soft_i2c_udelay(100);
+ rt_hw_us_delay(100);
}
}
if (PIN_LOW == rt_pin_read(cfg->sda))
diff --git a/bsp/nuvoton/libraries/m2354/rtt_port/drv_spi.h b/bsp/nuvoton/libraries/m2354/rtt_port/drv_spi.h
index bc949cbb95..d4fbe5358f 100644
--- a/bsp/nuvoton/libraries/m2354/rtt_port/drv_spi.h
+++ b/bsp/nuvoton/libraries/m2354/rtt_port/drv_spi.h
@@ -16,7 +16,7 @@
#include <rtconfig.h>
#include <rtdevice.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
#include <nu_bitutil.h>
#if defined(BSP_USING_SPI_PDMA)
diff --git a/bsp/nuvoton/libraries/m2354/rtt_port/drv_spii2s.c b/bsp/nuvoton/libraries/m2354/rtt_port/drv_spii2s.c
index 1e0a8a736c..ba634ea63b 100644
--- a/bsp/nuvoton/libraries/m2354/rtt_port/drv_spii2s.c
+++ b/bsp/nuvoton/libraries/m2354/rtt_port/drv_spii2s.c
@@ -282,7 +282,8 @@ static rt_err_t nu_spii2s_dai_setup(nu_i2s_t psNuSPII2s, struct rt_audio_configu
LOG_I("Open SPII2S.");
/* Set MCLK and enable MCLK */
- SPII2S_EnableMCLK(spii2s_base, __HXT);
+ /* The target MCLK is related to audio codec setting. */
+ SPII2S_EnableMCLK(spii2s_base, 12000000);
/* Set un-mute */
if (pNuACodecOps->nu_acodec_mixer_control)
diff --git a/bsp/nuvoton/libraries/m2354/rtt_port/drv_timer.c b/bsp/nuvoton/libraries/m2354/rtt_port/drv_timer.c
index 5ba7a306ac..b4d5472ee8 100644
--- a/bsp/nuvoton/libraries/m2354/rtt_port/drv_timer.c
+++ b/bsp/nuvoton/libraries/m2354/rtt_port/drv_timer.c
@@ -15,7 +15,7 @@
#if (defined(BSP_USING_TIMER) && defined(RT_USING_HWTIMER))
#include <rtdevice.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
/* Private define ---------------------------------------------------------------*/
#define NU_TIMER_DEVICE(timer) (nu_timer_t *)(timer)
diff --git a/bsp/nuvoton/libraries/m2354/rtt_port/drv_timer_capture.c b/bsp/nuvoton/libraries/m2354/rtt_port/drv_timer_capture.c
index ecb3a197e9..ee1e189307 100644
--- a/bsp/nuvoton/libraries/m2354/rtt_port/drv_timer_capture.c
+++ b/bsp/nuvoton/libraries/m2354/rtt_port/drv_timer_capture.c
@@ -21,7 +21,7 @@
defined(BSP_USING_TIMER5_CAPTURE)
#include <rtdevice.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
/* Private typedef --------------------------------------------------------------*/
typedef struct _timer
diff --git a/bsp/nuvoton/libraries/m2354/rtt_port/drv_uart.c b/bsp/nuvoton/libraries/m2354/rtt_port/drv_uart.c
index 6d5369c3cf..970d918bd1 100644
--- a/bsp/nuvoton/libraries/m2354/rtt_port/drv_uart.c
+++ b/bsp/nuvoton/libraries/m2354/rtt_port/drv_uart.c
@@ -16,7 +16,7 @@
#include <rtdevice.h>
#include <rthw.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
#include <drv_uart.h>
#if defined(RT_SERIAL_USING_DMA)
diff --git a/bsp/nuvoton/libraries/m2354/rtt_port/drv_ui2c.c b/bsp/nuvoton/libraries/m2354/rtt_port/drv_ui2c.c
index 2b80f308b5..a2f2648f1a 100644
--- a/bsp/nuvoton/libraries/m2354/rtt_port/drv_ui2c.c
+++ b/bsp/nuvoton/libraries/m2354/rtt_port/drv_ui2c.c
@@ -15,7 +15,7 @@
#if (defined(BSP_USING_UI2C) && defined(RT_USING_I2C))
#include <rtdevice.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
/* Private define ---------------------------------------------------------------*/
#define LOG_TAG "drv.ui2c"
diff --git a/bsp/nuvoton/libraries/m2354/rtt_port/drv_usbhost.c b/bsp/nuvoton/libraries/m2354/rtt_port/drv_usbhost.c
index c7c2a17b0e..b853ffa1c6 100644
--- a/bsp/nuvoton/libraries/m2354/rtt_port/drv_usbhost.c
+++ b/bsp/nuvoton/libraries/m2354/rtt_port/drv_usbhost.c
@@ -15,7 +15,7 @@
#include <rtdevice.h>
#include <rthw.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
#include "usb.h"
#include "usbh_lib.h"
diff --git a/bsp/nuvoton/libraries/m2354/rtt_port/drv_uspi.c b/bsp/nuvoton/libraries/m2354/rtt_port/drv_uspi.c
index fcb81a38f7..c8efcc81e5 100644
--- a/bsp/nuvoton/libraries/m2354/rtt_port/drv_uspi.c
+++ b/bsp/nuvoton/libraries/m2354/rtt_port/drv_uspi.c
@@ -24,7 +24,7 @@
#include <rtdevice.h>
#include <rtdef.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
#include <nu_bitutil.h>
#if defined(BSP_USING_USPI_PDMA)
diff --git a/bsp/nuvoton/libraries/m2354/rtt_port/drv_uuart.c b/bsp/nuvoton/libraries/m2354/rtt_port/drv_uuart.c
index 59ac9e7833..04019f3463 100644
--- a/bsp/nuvoton/libraries/m2354/rtt_port/drv_uuart.c
+++ b/bsp/nuvoton/libraries/m2354/rtt_port/drv_uuart.c
@@ -16,7 +16,7 @@
#include <rtdevice.h>
#include <rthw.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
#if defined(RT_SERIAL_USING_DMA)
#include <drv_pdma.h>
diff --git a/bsp/nuvoton/libraries/m2354/rtt_port/drv_wdt.c b/bsp/nuvoton/libraries/m2354/rtt_port/drv_wdt.c
index a6a358e5f6..13ff9c13b6 100644
--- a/bsp/nuvoton/libraries/m2354/rtt_port/drv_wdt.c
+++ b/bsp/nuvoton/libraries/m2354/rtt_port/drv_wdt.c
@@ -16,7 +16,7 @@
#include <rthw.h>
#include <rtdevice.h>
#include <rtdbg.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
/*-------------------------------------------------------------------------------*/
/* watchdog timer timeout look up table */
diff --git a/bsp/nuvoton/libraries/m480/rtt_port/drv_bpwm_capture.c b/bsp/nuvoton/libraries/m480/rtt_port/drv_bpwm_capture.c
index a28c1c1d5d..e592196c37 100644
--- a/bsp/nuvoton/libraries/m480/rtt_port/drv_bpwm_capture.c
+++ b/bsp/nuvoton/libraries/m480/rtt_port/drv_bpwm_capture.c
@@ -14,7 +14,7 @@
#if defined(BSP_USING_BPWM_CAPTURE)
#if ((BSP_USING_BPWM0_CAPTURE_CHMSK+BSP_USING_BPWM1_CAPTURE_CHMSK)!=0)
#include <rtdevice.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
/* Private typedef --------------------------------------------------------------*/
typedef struct _bpwm_dev
diff --git a/bsp/nuvoton/libraries/m480/rtt_port/drv_can.c b/bsp/nuvoton/libraries/m480/rtt_port/drv_can.c
index bee0c04219..a667e34979 100644
--- a/bsp/nuvoton/libraries/m480/rtt_port/drv_can.c
+++ b/bsp/nuvoton/libraries/m480/rtt_port/drv_can.c
@@ -16,7 +16,7 @@
#include <rtdevice.h>
#include <rthw.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
/* Private Define ---------------------------------------------------------------*/
#define RX_MSG_ID_INDEX 16
diff --git a/bsp/nuvoton/libraries/m480/rtt_port/drv_clk.c b/bsp/nuvoton/libraries/m480/rtt_port/drv_clk.c
index f61852a0dc..867495804c 100644
--- a/bsp/nuvoton/libraries/m480/rtt_port/drv_clk.c
+++ b/bsp/nuvoton/libraries/m480/rtt_port/drv_clk.c
@@ -18,7 +18,7 @@
#include <rtdbg.h>
#include <stdint.h>
#include <string.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
/* Private define ---------------------------------------------------------------*/
diff --git a/bsp/nuvoton/numaker-iot-m487/board/board.c b/bsp/nuvoton/libraries/m480/rtt_port/drv_common.c
index 01d68aca61..8c8cc0abbf 100644
--- a/bsp/nuvoton/numaker-iot-m487/board/board.c
+++ b/bsp/nuvoton/libraries/m480/rtt_port/drv_common.c
@@ -12,7 +12,7 @@
#include <rtconfig.h>
#include <rtthread.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
#include "drv_uart.h"
#include "board.h"
#include "nutool_pincfg.h"
@@ -20,9 +20,9 @@
/**
- * This function will initial M487 board.
+ * This function will initial.
*/
-void rt_hw_board_init(void)
+RT_WEAK void rt_hw_board_init(void)
{
/* Init System/modules clock */
nutool_modclkcfg_init();
@@ -68,6 +68,41 @@ void rt_hw_board_init(void)
}
/**
+ * The time delay function.
+ *
+ * @param microseconds.
+ */
+void rt_hw_us_delay(rt_uint32_t us)
+{
+ rt_uint32_t ticks;
+ rt_uint32_t told, tnow, tcnt = 0;
+ rt_uint32_t reload = SysTick->LOAD;
+
+ ticks = us * reload / (1000000 / RT_TICK_PER_SECOND);
+ told = SysTick->VAL;
+ while (1)
+ {
+ tnow = SysTick->VAL;
+ if (tnow != told)
+ {
+ if (tnow < told)
+ {
+ tcnt += told - tnow;
+ }
+ else
+ {
+ tcnt += reload - tnow + told;
+ }
+ told = tnow;
+ if (tcnt >= ticks)
+ {
+ break;
+ }
+ }
+ }
+}
+
+/**
* This is the timer interrupt service routine.
*
*/
@@ -89,7 +124,7 @@ void rt_hw_cpu_reset(void)
SYS->IPRST0 |= SYS_IPRST0_CHIPRST_Msk;
}
-int reboot(int argc, char** argv)
+int reboot(int argc, char **argv)
{
rt_hw_cpu_reset();
return 0;
diff --git a/bsp/nuvoton/libraries/m480/rtt_port/drv_eadc.c b/bsp/nuvoton/libraries/m480/rtt_port/drv_eadc.c
index 60fb68e44c..eb14a1dc4e 100644
--- a/bsp/nuvoton/libraries/m480/rtt_port/drv_eadc.c
+++ b/bsp/nuvoton/libraries/m480/rtt_port/drv_eadc.c
@@ -11,7 +11,7 @@
#include <rtconfig.h>
#include <rtdevice.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
#ifdef BSP_USING_EADC
diff --git a/bsp/nuvoton/libraries/m480/rtt_port/drv_ebi.h b/bsp/nuvoton/libraries/m480/rtt_port/drv_ebi.h
index 1b5aa5abd4..f639ec2f3f 100644
--- a/bsp/nuvoton/libraries/m480/rtt_port/drv_ebi.h
+++ b/bsp/nuvoton/libraries/m480/rtt_port/drv_ebi.h
@@ -13,7 +13,7 @@
#define __DRV_EBI_H___
#include <rtdevice.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
/**
* @brief Initialize EBI for specify Bank
diff --git a/bsp/nuvoton/libraries/m480/rtt_port/drv_ecap.c b/bsp/nuvoton/libraries/m480/rtt_port/drv_ecap.c
index 0e354373af..c9e7c66a8d 100644
--- a/bsp/nuvoton/libraries/m480/rtt_port/drv_ecap.c
+++ b/bsp/nuvoton/libraries/m480/rtt_port/drv_ecap.c
@@ -14,7 +14,7 @@
#if defined(BSP_USING_ECAP)
#if ((BSP_USING_ECAP0_CHMSK+BSP_USING_ECAP1_CHMSK)!=0)
#include <rtdevice.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
#define ECAP_CH0_POS (0)
#define ECAP_CH1_POS (1)
diff --git a/bsp/nuvoton/libraries/m480/rtt_port/drv_emac.c b/bsp/nuvoton/libraries/m480/rtt_port/drv_emac.c
index 3729553746..24b5eccc5f 100644
--- a/bsp/nuvoton/libraries/m480/rtt_port/drv_emac.c
+++ b/bsp/nuvoton/libraries/m480/rtt_port/drv_emac.c
@@ -17,7 +17,7 @@
#if defined(RT_USING_LWIP)
#include <rtdevice.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
#include <netif/ethernetif.h>
#include <netif/etharp.h>
#include <lwip/icmp.h>
diff --git a/bsp/nuvoton/libraries/m480/rtt_port/drv_epwm_capture.c b/bsp/nuvoton/libraries/m480/rtt_port/drv_epwm_capture.c
index c95febf8eb..8dcfb92cd7 100644
--- a/bsp/nuvoton/libraries/m480/rtt_port/drv_epwm_capture.c
+++ b/bsp/nuvoton/libraries/m480/rtt_port/drv_epwm_capture.c
@@ -14,7 +14,7 @@
#if defined(BSP_USING_EPWM_CAPTURE)
#if ((BSP_USING_EPWM0_CAPTURE_CHMSK+BSP_USING_EPWM1_CAPTURE_CHMSK)!=0)
#include <rtdevice.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
#define EPWM_CH0CH1_POS (0)
#define EPWM_CH2CH3_POS (2)
diff --git a/bsp/nuvoton/libraries/m480/rtt_port/drv_fmc.h b/bsp/nuvoton/libraries/m480/rtt_port/drv_fmc.h
index 9a9ef373c3..d189d1102c 100644
--- a/bsp/nuvoton/libraries/m480/rtt_port/drv_fmc.h
+++ b/bsp/nuvoton/libraries/m480/rtt_port/drv_fmc.h
@@ -14,7 +14,7 @@
#define __DRV_FMC_H__
#include <rtthread.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
int nu_fmc_read(long offset, uint8_t *buf, size_t size);
int nu_fmc_write(long offset, const uint8_t *buf, size_t size);
diff --git a/bsp/nuvoton/libraries/m480/rtt_port/drv_gpio.c b/bsp/nuvoton/libraries/m480/rtt_port/drv_gpio.c
index d00677392d..d718c5c06d 100644
--- a/bsp/nuvoton/libraries/m480/rtt_port/drv_gpio.c
+++ b/bsp/nuvoton/libraries/m480/rtt_port/drv_gpio.c
@@ -16,7 +16,7 @@
#include <rtdevice.h>
#include <rthw.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
#include <nu_bitutil.h>
#include <drv_gpio.h>
#include <stdlib.h>
diff --git a/bsp/nuvoton/libraries/m480/rtt_port/drv_hsotg.c b/bsp/nuvoton/libraries/m480/rtt_port/drv_hsotg.c
index 17244d5e0a..5859f3244f 100644
--- a/bsp/nuvoton/libraries/m480/rtt_port/drv_hsotg.c
+++ b/bsp/nuvoton/libraries/m480/rtt_port/drv_hsotg.c
@@ -14,7 +14,7 @@
#if defined(BSP_USING_HSOTG)
#include <rtdevice.h>
#include <rtdbg.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
/* This delay must be at least 10 us */
diff --git a/bsp/nuvoton/libraries/m480/rtt_port/drv_i2c.c b/bsp/nuvoton/libraries/m480/rtt_port/drv_i2c.c
index ecf78a5c70..a89bc3156d 100644
--- a/bsp/nuvoton/libraries/m480/rtt_port/drv_i2c.c
+++ b/bsp/nuvoton/libraries/m480/rtt_port/drv_i2c.c
@@ -14,7 +14,7 @@
#ifdef BSP_USING_I2C
#include <rtdevice.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
/* Private define ---------------------------------------------------------------*/
#define LOG_TAG "drv.i2c"
diff --git a/bsp/nuvoton/libraries/m480/rtt_port/drv_i2s.c b/bsp/nuvoton/libraries/m480/rtt_port/drv_i2s.c
index d76cb27314..be576e61c6 100644
--- a/bsp/nuvoton/libraries/m480/rtt_port/drv_i2s.c
+++ b/bsp/nuvoton/libraries/m480/rtt_port/drv_i2s.c
@@ -220,7 +220,8 @@ static rt_err_t nu_i2s_dai_setup(nu_i2s_t psNuI2s, struct rt_audio_configure *pc
}
/* Set MCLK and enable MCLK */
- I2S_EnableMCLK(psNuI2s->i2s_base, __HXT);
+ /* The target MCLK is related to audio codec setting. */
+ I2S_EnableMCLK(psNuI2s->i2s_base, 12000000);
/* Set unmute */
if (pNuACodecOps->nu_acodec_mixer_control)
diff --git a/bsp/nuvoton/libraries/m480/rtt_port/drv_i2s.h b/bsp/nuvoton/libraries/m480/rtt_port/drv_i2s.h
index 3fe99f3e3b..9ee00646b8 100644
--- a/bsp/nuvoton/libraries/m480/rtt_port/drv_i2s.h
+++ b/bsp/nuvoton/libraries/m480/rtt_port/drv_i2s.h
@@ -14,7 +14,7 @@
#define __DRV_I2S_H__
#include <rtdevice.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
#include <drv_pdma.h>
#if !defined(NU_I2S_DMA_FIFO_SIZE)
diff --git a/bsp/nuvoton/libraries/m480/rtt_port/drv_pdma.h b/bsp/nuvoton/libraries/m480/rtt_port/drv_pdma.h
index 35082be311..f8a0169c06 100644
--- a/bsp/nuvoton/libraries/m480/rtt_port/drv_pdma.h
+++ b/bsp/nuvoton/libraries/m480/rtt_port/drv_pdma.h
@@ -15,7 +15,7 @@
#include <rtconfig.h>
#include <rtthread.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
#ifndef NU_PDMA_SGTBL_POOL_SIZE
#define NU_PDMA_SGTBL_POOL_SIZE (16)
diff --git a/bsp/nuvoton/libraries/m480/rtt_port/drv_rtc.c b/bsp/nuvoton/libraries/m480/rtt_port/drv_rtc.c
index a80ac79627..d642d0116e 100644
--- a/bsp/nuvoton/libraries/m480/rtt_port/drv_rtc.c
+++ b/bsp/nuvoton/libraries/m480/rtt_port/drv_rtc.c
@@ -15,7 +15,7 @@
#include <rtdevice.h>
#include <sys/time.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
/* Private define ---------------------------------------------------------------*/
diff --git a/bsp/nuvoton/libraries/m480/rtt_port/drv_scuart.c b/bsp/nuvoton/libraries/m480/rtt_port/drv_scuart.c
index f187690f33..708435fef4 100644
--- a/bsp/nuvoton/libraries/m480/rtt_port/drv_scuart.c
+++ b/bsp/nuvoton/libraries/m480/rtt_port/drv_scuart.c
@@ -14,7 +14,7 @@
#if defined(BSP_USING_SCUART)
-#include <NuMicro.h>
+#include "NuMicro.h"
#include <rtdevice.h>
#include <rthw.h>
diff --git a/bsp/nuvoton/libraries/m480/rtt_port/drv_sdh.c b/bsp/nuvoton/libraries/m480/rtt_port/drv_sdh.c
index d02017d0cf..7c92743bd3 100644
--- a/bsp/nuvoton/libraries/m480/rtt_port/drv_sdh.c
+++ b/bsp/nuvoton/libraries/m480/rtt_port/drv_sdh.c
@@ -15,7 +15,7 @@
#if defined(BSP_USING_SDH)
#include <rtdevice.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
#include <drv_pdma.h>
#include <string.h>
diff --git a/bsp/nuvoton/libraries/m480/rtt_port/drv_softi2c.c b/bsp/nuvoton/libraries/m480/rtt_port/drv_softi2c.c
index 7c8fe84a92..1549bf57f2 100644
--- a/bsp/nuvoton/libraries/m480/rtt_port/drv_softi2c.c
+++ b/bsp/nuvoton/libraries/m480/rtt_port/drv_softi2c.c
@@ -17,7 +17,7 @@
#include <rtthread.h>
#include <rthw.h>
#include <rtdevice.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
/* Private define ---------------------------------------------------------------*/
#define LOG_TAG "drv.softi2c"
@@ -65,7 +65,6 @@ struct nu_soft_i2c
};
/* Private functions ------------------------------------------------------------*/
-static void nu_soft_i2c_udelay(rt_uint32_t us);
static void nu_soft_i2c_set_sda(void *data, rt_int32_t state);
static void nu_soft_i2c_set_scl(void *data, rt_int32_t state);
static rt_int32_t nu_soft_i2c_get_sda(void *data);
@@ -91,7 +90,7 @@ static const struct rt_i2c_bit_ops nu_soft_i2c_bit_ops =
.set_scl = nu_soft_i2c_set_scl,
.get_sda = nu_soft_i2c_get_sda,
.get_scl = nu_soft_i2c_get_scl,
- .udelay = nu_soft_i2c_udelay,
+ .udelay = rt_hw_us_delay,
.delay_us = 1,
.timeout = 100
};
@@ -99,41 +98,6 @@ static const struct rt_i2c_bit_ops nu_soft_i2c_bit_ops =
/* Functions define ------------------------------------------------------------*/
/**
- * The time delay function.
- *
- * @param microseconds.
- */
-static void nu_soft_i2c_udelay(rt_uint32_t us)
-{
- rt_uint32_t ticks;
- rt_uint32_t told, tnow, tcnt = 0;
- rt_uint32_t reload = SysTick->LOAD;
-
- ticks = us * reload / (1000000 / RT_TICK_PER_SECOND);
- told = SysTick->VAL;
- while (1)
- {
- tnow = SysTick->VAL;
- if (tnow != told)
- {
- if (tnow < told)
- {
- tcnt += told - tnow;
- }
- else
- {
- tcnt += reload - tnow + told;
- }
- told = tnow;
- if (tcnt >= ticks)
- {
- break;
- }
- }
- }
-}
-
-/**
* This function initializes the soft i2c pin.
*
* @param soft i2c config class.
@@ -163,9 +127,9 @@ static rt_err_t nu_soft_i2c_bus_unlock(const struct nu_soft_i2c_config *cfg)
while (i++ < 9)
{
rt_pin_write(cfg->scl, PIN_HIGH);
- nu_soft_i2c_udelay(100);
+ rt_hw_us_delay(100);
rt_pin_write(cfg->scl, PIN_LOW);
- nu_soft_i2c_udelay(100);
+ rt_hw_us_delay(100);
}
}
if (PIN_LOW == rt_pin_read(cfg->sda))
diff --git a/bsp/nuvoton/libraries/m480/rtt_port/drv_spi.h b/bsp/nuvoton/libraries/m480/rtt_port/drv_spi.h
index 1e7bd0db44..29a7ec1dce 100644
--- a/bsp/nuvoton/libraries/m480/rtt_port/drv_spi.h
+++ b/bsp/nuvoton/libraries/m480/rtt_port/drv_spi.h
@@ -16,7 +16,7 @@
#include <rtconfig.h>
#include <rtdevice.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
#include <nu_bitutil.h>
#if defined(BSP_USING_SPI_PDMA)
diff --git a/bsp/nuvoton/libraries/m480/rtt_port/drv_spii2s.c b/bsp/nuvoton/libraries/m480/rtt_port/drv_spii2s.c
index 801c6262c0..6495af5c03 100644
--- a/bsp/nuvoton/libraries/m480/rtt_port/drv_spii2s.c
+++ b/bsp/nuvoton/libraries/m480/rtt_port/drv_spii2s.c
@@ -282,7 +282,8 @@ static rt_err_t nu_spii2s_dai_setup(nu_i2s_t psNuSPII2s, struct rt_audio_configu
LOG_I("Open SPII2S.");
/* Set MCLK and enable MCLK */
- SPII2S_EnableMCLK(spii2s_base, __HXT);
+ /* The target MCLK is related to audio codec setting. */
+ SPII2S_EnableMCLK(spii2s_base, 12000000);
/* Set un-mute */
if (pNuACodecOps->nu_acodec_mixer_control)
diff --git a/bsp/nuvoton/libraries/m480/rtt_port/drv_timer.c b/bsp/nuvoton/libraries/m480/rtt_port/drv_timer.c
index 331155e258..456cbbc34a 100644
--- a/bsp/nuvoton/libraries/m480/rtt_port/drv_timer.c
+++ b/bsp/nuvoton/libraries/m480/rtt_port/drv_timer.c
@@ -15,7 +15,7 @@
#if (defined(BSP_USING_TIMER) && defined(RT_USING_HWTIMER))
#include <rtdevice.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
/* Private define ---------------------------------------------------------------*/
#define NU_TIMER_DEVICE(timer) (nu_timer_t *)(timer)
diff --git a/bsp/nuvoton/libraries/m480/rtt_port/drv_timer_capture.c b/bsp/nuvoton/libraries/m480/rtt_port/drv_timer_capture.c
index 4f9543664f..5f6df13e8a 100644
--- a/bsp/nuvoton/libraries/m480/rtt_port/drv_timer_capture.c
+++ b/bsp/nuvoton/libraries/m480/rtt_port/drv_timer_capture.c
@@ -19,7 +19,7 @@
defined(BSP_USING_TIMER3_CAPTURE)
#include <rtdevice.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
/* Private typedef --------------------------------------------------------------*/
typedef struct _timer
diff --git a/bsp/nuvoton/libraries/m480/rtt_port/drv_uart.c b/bsp/nuvoton/libraries/m480/rtt_port/drv_uart.c
index d694ab7d8c..3167bdc9d3 100644
--- a/bsp/nuvoton/libraries/m480/rtt_port/drv_uart.c
+++ b/bsp/nuvoton/libraries/m480/rtt_port/drv_uart.c
@@ -16,7 +16,7 @@
#include <rtdevice.h>
#include <rthw.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
#include <drv_uart.h>
#if defined(RT_SERIAL_USING_DMA)
diff --git a/bsp/nuvoton/libraries/m480/rtt_port/drv_ui2c.c b/bsp/nuvoton/libraries/m480/rtt_port/drv_ui2c.c
index 9130dc878b..2c46f637a4 100644
--- a/bsp/nuvoton/libraries/m480/rtt_port/drv_ui2c.c
+++ b/bsp/nuvoton/libraries/m480/rtt_port/drv_ui2c.c
@@ -15,7 +15,7 @@
#if (defined(BSP_USING_UI2C) && defined(RT_USING_I2C))
#include <rtdevice.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
/* Private define ---------------------------------------------------------------*/
#define LOG_TAG "drv.ui2c"
diff --git a/bsp/nuvoton/libraries/m480/rtt_port/drv_usbhost.c b/bsp/nuvoton/libraries/m480/rtt_port/drv_usbhost.c
index be19dac9e5..65af8ec18c 100644
--- a/bsp/nuvoton/libraries/m480/rtt_port/drv_usbhost.c
+++ b/bsp/nuvoton/libraries/m480/rtt_port/drv_usbhost.c
@@ -17,7 +17,7 @@
#include <rtdevice.h>
#include <rthw.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
#include "usb.h"
#include "usbh_lib.h"
diff --git a/bsp/nuvoton/libraries/m480/rtt_port/drv_uspi.c b/bsp/nuvoton/libraries/m480/rtt_port/drv_uspi.c
index 656750144e..9189ff5f03 100644
--- a/bsp/nuvoton/libraries/m480/rtt_port/drv_uspi.c
+++ b/bsp/nuvoton/libraries/m480/rtt_port/drv_uspi.c
@@ -24,7 +24,7 @@
#include <rtdevice.h>
#include <rtdef.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
#include <nu_bitutil.h>
#if defined(BSP_USING_USPI_PDMA)
diff --git a/bsp/nuvoton/libraries/m480/rtt_port/drv_uuart.c b/bsp/nuvoton/libraries/m480/rtt_port/drv_uuart.c
index 6cd29f79fe..1cd9e5a717 100644
--- a/bsp/nuvoton/libraries/m480/rtt_port/drv_uuart.c
+++ b/bsp/nuvoton/libraries/m480/rtt_port/drv_uuart.c
@@ -16,7 +16,7 @@
#include <rtdevice.h>
#include <rthw.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
#if defined(RT_SERIAL_USING_DMA)
#include <drv_pdma.h>
diff --git a/bsp/nuvoton/libraries/m480/rtt_port/drv_wdt.c b/bsp/nuvoton/libraries/m480/rtt_port/drv_wdt.c
index 15521aace9..ffe5f98a1a 100644
--- a/bsp/nuvoton/libraries/m480/rtt_port/drv_wdt.c
+++ b/bsp/nuvoton/libraries/m480/rtt_port/drv_wdt.c
@@ -16,7 +16,7 @@
#include <rthw.h>
#include <rtdevice.h>
#include <rtdbg.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
/*-------------------------------------------------------------------------------*/
/* watchdog timer timeout look up table */
diff --git a/bsp/nuvoton/libraries/nu_packages/AudioCodec/acodec_nau88l25.c b/bsp/nuvoton/libraries/nu_packages/AudioCodec/acodec_nau88l25.c
index 65b2f4afba..0bd7852e02 100644
--- a/bsp/nuvoton/libraries/nu_packages/AudioCodec/acodec_nau88l25.c
+++ b/bsp/nuvoton/libraries/nu_packages/AudioCodec/acodec_nau88l25.c
@@ -88,10 +88,10 @@ static int I2C_WriteNAU88L25(uint16_t u16addr, uint16_t u16data)
static int I2C_ReadNAU88L25(uint16_t u16addr, uint16_t *pu16data)
{
struct rt_i2c_msg msgs[2];
- uint16_t u16data = 0;
char au8TxData[2];
RT_ASSERT(g_I2cBusDev != NULL);
+ RT_ASSERT(pu16data != NULL);
au8TxData[0] = (uint8_t)((u16addr >> 8) & 0x00FF); //addr [15:8]
au8TxData[1] = (uint8_t)(u16addr & 0x00FF); //addr [ 7:0]
@@ -103,8 +103,8 @@ static int I2C_ReadNAU88L25(uint16_t u16addr, uint16_t *pu16data)
msgs[1].addr = DEF_NAU88L25_ADDR; /* Slave address */
msgs[1].flags = RT_I2C_RD; /* Read flag */
- msgs[1].buf = (rt_uint8_t *)&u16data; /* Read data pointer */
- msgs[1].len = sizeof(u16data); /* Number of bytes read */
+ msgs[1].buf = (rt_uint8_t *)pu16data; /* Read data pointer */
+ msgs[1].len = sizeof(uint16_t); /* Number of bytes read */
if (rt_i2c_transfer(g_I2cBusDev, &msgs[0], 2) != 2)
{
diff --git a/bsp/nuvoton/libraries/nu_packages/AudioCodec/audio_test.c b/bsp/nuvoton/libraries/nu_packages/AudioCodec/audio_test.c
index d82641b0c7..b36db998a8 100644
--- a/bsp/nuvoton/libraries/nu_packages/AudioCodec/audio_test.c
+++ b/bsp/nuvoton/libraries/nu_packages/AudioCodec/audio_test.c
@@ -26,6 +26,8 @@
static int audio_test(int argc, char **argv)
{
#define DEF_MAX_ARGV_NUM 8
+#define DEF_MAX_TEST_SECOND 5
+
int smplrate[] = {8000, 16000, 44100, 48000};
int smplbit[] = {16};
int chnum[] = {1, 2};
@@ -54,9 +56,9 @@ static int audio_test(int argc, char **argv)
info.samplebits = smplbit[j];
info.channels = chnum[k];
wavrecorder_start(&info);
- rt_thread_mdelay(10000);
+ rt_thread_mdelay(DEF_MAX_TEST_SECOND * 1000);
wavrecorder_stop();
- rt_thread_mdelay(1000);
+ rt_thread_mdelay(DEF_MAX_TEST_SECOND * 1000);
}
else
{
@@ -68,7 +70,7 @@ static int audio_test(int argc, char **argv)
rt_kprintf("Replay file at %s\n", strbuf);
wavplayer_play(strbuf);
- rt_thread_mdelay(10000);
+ rt_thread_mdelay(DEF_MAX_TEST_SECOND * 1000);
wavplayer_stop();
}
} // k
diff --git a/bsp/nuvoton/libraries/nuc980/rtt_port/Kconfig b/bsp/nuvoton/libraries/nuc980/rtt_port/Kconfig
index d2c34d6461..e7293b535d 100644
--- a/bsp/nuvoton/libraries/nuc980/rtt_port/Kconfig
+++ b/bsp/nuvoton/libraries/nuc980/rtt_port/Kconfig
@@ -30,21 +30,6 @@ config SOC_SERIES_NUC980
select RT_USING_PIN
default y
- menuconfig BSP_USING_CLK
- bool "Enable Clock Controller(CLK)"
- select RT_USING_PM
- select BSP_USING_TMR
- default y
- help
- Choose this option if you need CLK/PM function.
- Notice: Enable the option will hold timer3 resource
-
- if BSP_USING_CLK
- config NU_CLK_INVOKE_WKTMR
- bool "Enable SPD1 and DPD mode wakeup timer. (About 6.6 Secs)"
- default y
- endif
-
menuconfig BSP_USING_EMAC
bool "Enable Ethernet MAC Controller(EMAC)"
select RT_USING_LWIP
diff --git a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_adc.c b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_adc.c
index a35fe81c8b..721bd5d6c1 100644
--- a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_adc.c
+++ b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_adc.c
@@ -14,7 +14,7 @@
#if defined(BSP_USING_ADC)
#include <rtdevice.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
#include <drv_sys.h>
/* Private define ---------------------------------------------------------------*/
diff --git a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_can.c b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_can.c
index 66d3a8f870..3b48867bb2 100644
--- a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_can.c
+++ b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_can.c
@@ -16,7 +16,7 @@
#include <rtdevice.h>
#include <rthw.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
#include <drv_sys.h>
/* Private Define ---------------------------------------------------------------*/
diff --git a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_ebi.h b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_ebi.h
index c42a85e226..a5427aa278 100644
--- a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_ebi.h
+++ b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_ebi.h
@@ -13,7 +13,7 @@
#define __DRV_EBI_H___
#include <rtdevice.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
#define MAX_BANK EBI_BANK2
diff --git a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_emac.c b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_emac.c
index be0451ec5e..b74189cb84 100644
--- a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_emac.c
+++ b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_emac.c
@@ -17,7 +17,7 @@
#if defined(RT_USING_LWIP)
#include <rtdevice.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
#include <netif/ethernetif.h>
#include <netif/etharp.h>
#include <lwip/icmp.h>
@@ -117,7 +117,7 @@ static struct nu_emac nu_emac_arr[] =
.name = "e1",
.memmgr.psEmac = (EMAC_T *)EMC1_BA,
.irqn_tx = IRQ_EMC1_TX,
- .irqn_rx = IRQ_EMC1_RX
+ .irqn_rx = IRQ_EMC1_RX,
.rstidx = EMAC1RST,
.clkidx = EMAC1CKEN,
},
diff --git a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_etimer.c b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_etimer.c
index c009af16c7..cf7ff232cd 100644
--- a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_etimer.c
+++ b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_etimer.c
@@ -15,7 +15,7 @@
#if defined(BSP_USING_TIMER) && defined(RT_USING_HWTIMER)
#include <rtdevice.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
#include <drv_sys.h>
/* Private define ---------------------------------------------------------------*/
diff --git a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_etimer_capture.c b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_etimer_capture.c
index 0e2ae9384e..761ef73847 100644
--- a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_etimer_capture.c
+++ b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_etimer_capture.c
@@ -15,7 +15,7 @@
#if defined(BSP_USING_TIMER_CAPTURE)
#include <rtdevice.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
#include <drv_sys.h>
/* Private define ---------------------------------------------------------------*/
diff --git a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_gpio.c b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_gpio.c
index 71d8b6f012..ec2b2ac94b 100644
--- a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_gpio.c
+++ b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_gpio.c
@@ -16,7 +16,7 @@
#include <rtdevice.h>
#include <rthw.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
#include <nu_bitutil.h>
#include <drv_gpio.h>
#include <stdlib.h>
diff --git a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_i2c.c b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_i2c.c
index b260b7fc18..30bc34ff66 100644
--- a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_i2c.c
+++ b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_i2c.c
@@ -15,7 +15,7 @@
#if defined( BSP_USING_I2C)
#include <rtdevice.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
#include <drv_i2c.h>
#include <drv_sys.h>
diff --git a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_i2s.c b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_i2s.c
index 4c4a01599f..b8646d46a8 100644
--- a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_i2s.c
+++ b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_i2s.c
@@ -16,7 +16,7 @@
#include <rtdevice.h>
#include <drv_i2s.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
/* Private define ---------------------------------------------------------------*/
#define DBG_ENABLE
diff --git a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_i2s.h b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_i2s.h
index 8f041e4271..2b4c877acb 100644
--- a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_i2s.h
+++ b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_i2s.h
@@ -15,7 +15,7 @@
#include <rtthread.h>
#include <drv_sys.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
#if !defined(NU_I2S_DMA_FIFO_SIZE)
#define NU_I2S_DMA_FIFO_SIZE (2048)
diff --git a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_pdma.h b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_pdma.h
index 66ac50df43..1267dcb9fa 100644
--- a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_pdma.h
+++ b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_pdma.h
@@ -15,7 +15,7 @@
#include <rtconfig.h>
#include <rtthread.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
#include <board.h>
#define NU_PDMA_CAP_NONE (0 << 0)
diff --git a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_rtc.c b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_rtc.c
index 49418316d1..e3866e7d22 100644
--- a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_rtc.c
+++ b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_rtc.c
@@ -15,7 +15,7 @@
#include <rtdevice.h>
#include <sys/time.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
#include <drv_sys.h>
/* Private define ---------------------------------------------------------------*/
diff --git a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_scuart.c b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_scuart.c
index 3b08c224e2..6867eb8827 100644
--- a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_scuart.c
+++ b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_scuart.c
@@ -12,12 +12,9 @@
#include <rtconfig.h>
-#define BSP_USING_SCUART
-#define BSP_USING_SCUART0
-
#if defined(BSP_USING_SCUART)
-#include <NuMicro.h>
+#include "NuMicro.h"
#include <rtdevice.h>
#include <rthw.h>
#include <drv_sys.h>
diff --git a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_sdh.c b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_sdh.c
index 85f4878518..6990ce215c 100644
--- a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_sdh.c
+++ b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_sdh.c
@@ -16,7 +16,7 @@
#include <rtdevice.h>
#include <string.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
#include <drv_pdma.h>
#include <drv_sys.h>
diff --git a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_softi2c.c b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_softi2c.c
index d2e08fbb3b..f638c51ff6 100644
--- a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_softi2c.c
+++ b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_softi2c.c
@@ -17,7 +17,7 @@
#include <rtthread.h>
#include <rthw.h>
#include <rtdevice.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
#include "drv_sys.h"
/* Private define ---------------------------------------------------------------*/
@@ -106,7 +106,7 @@ static const struct rt_i2c_bit_ops nu_soft_i2c_bit_ops =
*/
static void nu_soft_i2c_udelay(rt_uint32_t us)
{
- nu_systick_udelay(us);
+ rt_hw_us_delay(us);
}
/**
diff --git a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_spi.h b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_spi.h
index 30d574528c..32efa3bb0c 100644
--- a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_spi.h
+++ b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_spi.h
@@ -16,7 +16,7 @@
#include <rtconfig.h>
#include <rtdevice.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
#include <nu_bitutil.h>
#if defined(BSP_USING_SPI_PDMA)
diff --git a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_sys.c b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_sys.c
index 97b4fff76c..c19d2dd34a 100644
--- a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_sys.c
+++ b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_sys.c
@@ -348,4 +348,22 @@ int nu_clocks(int argc, char **argv)
MSH_CMD_EXPORT(nu_clocks, Get all system clocks);
#endif
+#ifdef RT_USING_INTERRUPT_INFO
+int list_interrupt(int argc, char **argv)
+{
+ int i;
+
+ for (i = 1; i <= SYS_MAX_INT_SOURCE; i++)
+ {
+ if (irq_desc[i].handler != rt_hw_interrupt_dummy_handler)
+ {
+ rt_kprintf("[%d] %s: %d\n", i, irq_desc[i].name, irq_desc[i].counter);
+ }
+ }
+
+ return 0;
+}
+MSH_CMD_EXPORT(list_interrupt, list registered interrupts);
+#endif
+
#endif
diff --git a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_systick.c b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_systick.c
index 0060ec37a9..f6b0f68ffb 100644
--- a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_systick.c
+++ b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_systick.c
@@ -49,13 +49,13 @@ void rt_hw_systick_init(void)
ETIMER_Start(USE_TIMER);
} /* rt_hw_systick_init */
-void nu_systick_udelay(uint32_t delay_us)
+void rt_hw_us_delay(rt_uint32_t us)
{
rt_uint32_t ticks;
rt_uint32_t told, tnow, tcnt = 0;
rt_uint32_t cmp = ETIMER_GetCompareData(USE_TIMER);
- ticks = delay_us * cmp / (1000000 / RT_TICK_PER_SECOND);
+ ticks = us * cmp / (1000000 / RT_TICK_PER_SECOND);
told = ETIMER_GetCounter(USE_TIMER);
while (1)
{
@@ -82,5 +82,4 @@ void nu_systick_udelay(uint32_t delay_us)
}
}
}
-
-} /* nu_systick_udelay */
+} /* rt_hw_us_delay */
diff --git a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_uart.c b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_uart.c
index c4b7f3a393..fbafecee55 100644
--- a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_uart.c
+++ b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_uart.c
@@ -16,7 +16,7 @@
#include <rtdevice.h>
#include <rthw.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
#include <drv_uart.h>
#include <drv_sys.h>
@@ -25,6 +25,7 @@
#endif
/* Private define ---------------------------------------------------------------*/
+
enum
{
UART_START = -1,
@@ -70,6 +71,7 @@ struct nu_uart
IRQn_Type irqn;
E_SYS_IPRST rstidx;
E_SYS_IPCLK clkidx;
+
#if defined(RT_SERIAL_USING_DMA)
uint32_t dma_flag;
int16_t pdma_perp_tx;
@@ -81,7 +83,6 @@ struct nu_uart
int32_t rxdma_trigger_len;
nu_pdma_desc_t pdma_rx_desc;
-
#endif
};
@@ -396,6 +397,34 @@ static void nu_uart_isr(int vector, void *param)
}
/**
+ * Set RS-485 AUD mode
+ */
+void nu_uart_set_rs485aud(struct rt_serial_device *serial, rt_bool_t bRTSActiveLowLevel)
+{
+ UART_T *uart_base;
+ RT_ASSERT(serial != RT_NULL);
+
+ /* Get base address of uart register */
+ uart_base = ((nu_uart_t)serial)->uart_base;
+
+ /* Set RTS as RS-485 phy direction controlling ping. */
+ UART_SelectRS485Mode(uart_base, UART_ALTCTL_RS485AUD_Msk, 0);
+
+ if (bRTSActiveLowLevel)
+ {
+ /* Set direction pin as active-low. */
+ uart_base->MODEM |= UART_MODEM_RTSACTLV_Msk;
+ }
+ else
+ {
+ /* Set direction pin as active-high. */
+ uart_base->MODEM &= ~UART_MODEM_RTSACTLV_Msk;
+ }
+
+ rt_kprintf("Set %s to RS-485 AUD function mode. ActiveLowLevel-%s\n", ((nu_uart_t)serial)->name, bRTSActiveLowLevel ? "YES" : "NO");
+}
+
+/**
* Configure uart port
*/
static rt_err_t nu_uart_configure(struct rt_serial_device *serial, struct serial_configure *cfg)
diff --git a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_uart.h b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_uart.h
index 2596c9be0a..cda8e7fb85 100644
--- a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_uart.h
+++ b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_uart.h
@@ -16,5 +16,6 @@
#include <rtdevice.h>
rt_err_t rt_hw_uart_init(void);
+void nu_uart_set_rs485aud(struct rt_serial_device *serial, rt_bool_t bRTSActiveLowLevel);
#endif /* __DRV_UART_H__ */
diff --git a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_usbd.c b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_usbd.c
index 2065ba35a1..ae563d1a1e 100644
--- a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_usbd.c
+++ b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_usbd.c
@@ -829,7 +829,7 @@ static rt_err_t _init(rt_device_t device)
nu_sys_ip_reset(nu_usbd.rstidx);
- nu_systick_udelay(1000);
+ rt_hw_us_delay(1000);
/* USBD Open */
USBD_ENABLE_USB();
diff --git a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_usbhost.c b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_usbhost.c
index 0fbb6d24c8..cd6f837c88 100644
--- a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_usbhost.c
+++ b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_usbhost.c
@@ -15,7 +15,7 @@
#include <rtdevice.h>
#include <rthw.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
#include "usb.h"
#include "usbh_lib.h"
diff --git a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_wdt.c b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_wdt.c
index 5564c5885d..d5b696c59f 100644
--- a/bsp/nuvoton/libraries/nuc980/rtt_port/drv_wdt.c
+++ b/bsp/nuvoton/libraries/nuc980/rtt_port/drv_wdt.c
@@ -16,7 +16,7 @@
#include <rthw.h>
#include <rtdevice.h>
#include <rtdbg.h>
-#include <NuMicro.h>
+#include "NuMicro.h"
#include <drv_sys.h>
/* Private define ---------------------------------------------------------------*/
diff --git a/bsp/nuvoton/nk-980iot/board/board.h b/bsp/nuvoton/nk-980iot/board/board.h
index 38762245cd..d361487629 100644
--- a/bsp/nuvoton/nk-980iot/board/board.h
+++ b/bsp/nuvoton/nk-980iot/board/board.h
@@ -13,7 +13,7 @@
#ifndef __BOARD_H__
#define __BOARD_H__
-#include <NuMicro.h>
+#include "NuMicro.h"
#include "drv_sys.h"
#if defined(__CC_ARM)
diff --git a/bsp/nuvoton/nk-rtu980/.config b/bsp/nuvoton/nk-rtu980/.config
new file mode 100644
index 0000000000..01cafd396d
--- /dev/null
+++ b/bsp/nuvoton/nk-rtu980/.config
@@ -0,0 +1,828 @@
+#
+# Automatically generated file; DO NOT EDIT.
+# RT-Thread Configuration
+#
+
+#
+# RT-Thread Kernel
+#
+CONFIG_RT_NAME_MAX=16
+# CONFIG_RT_USING_ARCH_DATA_TYPE is not set
+# CONFIG_RT_USING_SMP is not set
+CONFIG_RT_ALIGN_SIZE=4
+# CONFIG_RT_THREAD_PRIORITY_8 is not set
+CONFIG_RT_THREAD_PRIORITY_32=y
+# CONFIG_RT_THREAD_PRIORITY_256 is not set
+CONFIG_RT_THREAD_PRIORITY_MAX=32
+CONFIG_RT_TICK_PER_SECOND=1000
+CONFIG_RT_USING_OVERFLOW_CHECK=y
+CONFIG_RT_USING_HOOK=y
+CONFIG_RT_USING_IDLE_HOOK=y
+CONFIG_RT_IDLE_HOOK_LIST_SIZE=4
+CONFIG_IDLE_THREAD_STACK_SIZE=2048
+# CONFIG_RT_USING_TIMER_SOFT is not set
+CONFIG_RT_DEBUG=y
+CONFIG_RT_DEBUG_COLOR=y
+# CONFIG_RT_DEBUG_INIT_CONFIG is not set
+# CONFIG_RT_DEBUG_THREAD_CONFIG is not set
+# CONFIG_RT_DEBUG_SCHEDULER_CONFIG is not set
+# CONFIG_RT_DEBUG_IPC_CONFIG is not set
+# CONFIG_RT_DEBUG_TIMER_CONFIG is not set
+# CONFIG_RT_DEBUG_IRQ_CONFIG is not set
+# CONFIG_RT_DEBUG_MEM_CONFIG is not set
+# CONFIG_RT_DEBUG_SLAB_CONFIG is not set
+# CONFIG_RT_DEBUG_MEMHEAP_CONFIG is not set
+# CONFIG_RT_DEBUG_MODULE_CONFIG is not set
+
+#
+# Inter-Thread communication
+#
+CONFIG_RT_USING_SEMAPHORE=y
+CONFIG_RT_USING_MUTEX=y
+CONFIG_RT_USING_EVENT=y
+CONFIG_RT_USING_MAILBOX=y
+CONFIG_RT_USING_MESSAGEQUEUE=y
+CONFIG_RT_USING_SIGNALS=y
+
+#
+# Memory Management
+#
+CONFIG_RT_USING_MEMPOOL=y
+CONFIG_RT_USING_MEMHEAP=y
+# CONFIG_RT_USING_NOHEAP is not set
+CONFIG_RT_USING_SMALL_MEM=y
+# CONFIG_RT_USING_SLAB is not set
+# CONFIG_RT_USING_MEMHEAP_AS_HEAP is not set
+# CONFIG_RT_USING_USERHEAP is not set
+CONFIG_RT_USING_MEMTRACE=y
+CONFIG_RT_USING_HEAP=y
+
+#
+# Kernel Device Object
+#
+CONFIG_RT_USING_DEVICE=y
+# CONFIG_RT_USING_DEVICE_OPS is not set
+# CONFIG_RT_USING_INTERRUPT_INFO is not set
+CONFIG_RT_USING_CONSOLE=y
+CONFIG_RT_CONSOLEBUF_SIZE=256
+CONFIG_RT_CONSOLE_DEVICE_NAME="uart0"
+CONFIG_RT_VER_NUM=0x40003
+CONFIG_ARCH_ARM=y
+# CONFIG_RT_USING_CPU_FFS is not set
+CONFIG_ARCH_ARM_ARM9=y
+# CONFIG_ARCH_CPU_STACK_GROWS_UPWARD is not set
+
+#
+# RT-Thread Components
+#
+CONFIG_RT_USING_COMPONENTS_INIT=y
+CONFIG_RT_USING_USER_MAIN=y
+CONFIG_RT_MAIN_THREAD_STACK_SIZE=2048
+CONFIG_RT_MAIN_THREAD_PRIORITY=10
+
+#
+# C++ features
+#
+# CONFIG_RT_USING_CPLUSPLUS is not set
+
+#
+# Command shell
+#
+CONFIG_RT_USING_FINSH=y
+CONFIG_FINSH_THREAD_NAME="tshell"
+CONFIG_FINSH_USING_HISTORY=y
+CONFIG_FINSH_HISTORY_LINES=5
+CONFIG_FINSH_USING_SYMTAB=y
+CONFIG_FINSH_USING_DESCRIPTION=y
+# CONFIG_FINSH_ECHO_DISABLE_DEFAULT is not set
+CONFIG_FINSH_THREAD_PRIORITY=20
+CONFIG_FINSH_THREAD_STACK_SIZE=4096
+CONFIG_FINSH_CMD_SIZE=80
+# CONFIG_FINSH_USING_AUTH is not set
+CONFIG_FINSH_USING_MSH=y
+CONFIG_FINSH_USING_MSH_DEFAULT=y
+# CONFIG_FINSH_USING_MSH_ONLY is not set
+CONFIG_FINSH_ARG_MAX=10
+
+#
+# Device virtual file system
+#
+CONFIG_RT_USING_DFS=y
+CONFIG_DFS_USING_WORKDIR=y
+CONFIG_DFS_FILESYSTEMS_MAX=16
+CONFIG_DFS_FILESYSTEM_TYPES_MAX=16
+CONFIG_DFS_FD_MAX=64
+CONFIG_RT_USING_DFS_MNTTABLE=y
+CONFIG_RT_USING_DFS_ELMFAT=y
+
+#
+# elm-chan's FatFs, Generic FAT Filesystem Module
+#
+CONFIG_RT_DFS_ELM_CODE_PAGE=437
+CONFIG_RT_DFS_ELM_WORD_ACCESS=y
+# CONFIG_RT_DFS_ELM_USE_LFN_0 is not set
+# CONFIG_RT_DFS_ELM_USE_LFN_1 is not set
+# CONFIG_RT_DFS_ELM_USE_LFN_2 is not set
+CONFIG_RT_DFS_ELM_USE_LFN_3=y
+CONFIG_RT_DFS_ELM_USE_LFN=3
+CONFIG_RT_DFS_ELM_LFN_UNICODE_0=y
+# CONFIG_RT_DFS_ELM_LFN_UNICODE_1 is not set
+# CONFIG_RT_DFS_ELM_LFN_UNICODE_2 is not set
+# CONFIG_RT_DFS_ELM_LFN_UNICODE_3 is not set
+CONFIG_RT_DFS_ELM_LFN_UNICODE=0
+CONFIG_RT_DFS_ELM_MAX_LFN=255
+CONFIG_RT_DFS_ELM_DRIVES=8
+CONFIG_RT_DFS_ELM_MAX_SECTOR_SIZE=4096
+# CONFIG_RT_DFS_ELM_USE_ERASE is not set
+CONFIG_RT_DFS_ELM_REENTRANT=y
+CONFIG_RT_USING_DFS_DEVFS=y
+# CONFIG_RT_USING_DFS_ROMFS is not set
+# CONFIG_RT_USING_DFS_RAMFS is not set
+# CONFIG_RT_USING_DFS_UFFS is not set
+# CONFIG_RT_USING_DFS_JFFS2 is not set
+# CONFIG_RT_USING_DFS_NFS is not set
+
+#
+# Device Drivers
+#
+CONFIG_RT_USING_DEVICE_IPC=y
+CONFIG_RT_PIPE_BUFSZ=512
+CONFIG_RT_USING_SYSTEM_WORKQUEUE=y
+CONFIG_RT_SYSTEM_WORKQUEUE_STACKSIZE=2048
+CONFIG_RT_SYSTEM_WORKQUEUE_PRIORITY=23
+CONFIG_RT_USING_SERIAL=y
+CONFIG_RT_SERIAL_USING_DMA=y
+CONFIG_RT_SERIAL_RB_BUFSZ=2048
+CONFIG_RT_USING_CAN=y
+CONFIG_RT_CAN_USING_HDR=y
+CONFIG_RT_USING_HWTIMER=y
+CONFIG_RT_USING_CPUTIME=y
+CONFIG_RT_USING_I2C=y
+# CONFIG_RT_I2C_DEBUG is not set
+CONFIG_RT_USING_I2C_BITOPS=y
+# CONFIG_RT_I2C_BITOPS_DEBUG is not set
+# CONFIG_RT_USING_PHY is not set
+CONFIG_RT_USING_PIN=y
+CONFIG_RT_USING_ADC=y
+# CONFIG_RT_USING_DAC is not set
+# CONFIG_RT_USING_PWM is not set
+# CONFIG_RT_USING_MTD_NOR is not set
+# CONFIG_RT_USING_MTD_NAND is not set
+# CONFIG_RT_USING_PM is not set
+# CONFIG_RT_USING_RTC is not set
+# CONFIG_RT_USING_SDIO is not set
+CONFIG_RT_USING_SPI=y
+CONFIG_RT_USING_QSPI=y
+# CONFIG_RT_USING_SPI_MSD is not set
+CONFIG_RT_USING_SFUD=y
+CONFIG_RT_SFUD_USING_SFDP=y
+CONFIG_RT_SFUD_USING_FLASH_INFO_TABLE=y
+CONFIG_RT_SFUD_USING_QSPI=y
+CONFIG_RT_SFUD_SPI_MAX_HZ=50000000
+CONFIG_RT_DEBUG_SFUD=y
+# CONFIG_RT_USING_ENC28J60 is not set
+# CONFIG_RT_USING_SPI_WIFI is not set
+CONFIG_RT_USING_WDT=y
+# CONFIG_RT_USING_AUDIO is not set
+# CONFIG_RT_USING_SENSOR is not set
+# CONFIG_RT_USING_TOUCH is not set
+CONFIG_RT_USING_HWCRYPTO=y
+CONFIG_RT_HWCRYPTO_DEFAULT_NAME="hwcryto"
+CONFIG_RT_HWCRYPTO_IV_MAX_SIZE=16
+CONFIG_RT_HWCRYPTO_KEYBIT_MAX_SIZE=256
+# CONFIG_RT_HWCRYPTO_USING_GCM is not set
+CONFIG_RT_HWCRYPTO_USING_AES=y
+CONFIG_RT_HWCRYPTO_USING_AES_ECB=y
+CONFIG_RT_HWCRYPTO_USING_AES_CBC=y
+CONFIG_RT_HWCRYPTO_USING_AES_CFB=y
+CONFIG_RT_HWCRYPTO_USING_AES_CTR=y
+CONFIG_RT_HWCRYPTO_USING_AES_OFB=y
+# CONFIG_RT_HWCRYPTO_USING_DES is not set
+# CONFIG_RT_HWCRYPTO_USING_3DES is not set
+# CONFIG_RT_HWCRYPTO_USING_RC4 is not set
+# CONFIG_RT_HWCRYPTO_USING_MD5 is not set
+CONFIG_RT_HWCRYPTO_USING_SHA1=y
+CONFIG_RT_HWCRYPTO_USING_SHA2=y
+CONFIG_RT_HWCRYPTO_USING_SHA2_224=y
+CONFIG_RT_HWCRYPTO_USING_SHA2_256=y
+CONFIG_RT_HWCRYPTO_USING_SHA2_384=y
+CONFIG_RT_HWCRYPTO_USING_SHA2_512=y
+CONFIG_RT_HWCRYPTO_USING_RNG=y
+# CONFIG_RT_HWCRYPTO_USING_CRC is not set
+# CONFIG_RT_HWCRYPTO_USING_BIGNUM is not set
+# CONFIG_RT_USING_PULSE_ENCODER is not set
+# CONFIG_RT_USING_INPUT_CAPTURE is not set
+# CONFIG_RT_USING_WIFI is not set
+
+#
+# Using USB
+#
+CONFIG_RT_USING_USB_HOST=y
+CONFIG_RT_USBH_MSTORAGE=y
+CONFIG_UDISK_MOUNTPOINT="/mnt/udisk"
+CONFIG_RT_USING_USB_DEVICE=y
+CONFIG_RT_USBD_THREAD_STACK_SZ=4096
+CONFIG_USB_VENDOR_ID=0x0FFE
+CONFIG_USB_PRODUCT_ID=0x0001
+CONFIG_RT_USB_DEVICE_COMPOSITE=y
+CONFIG_RT_USB_DEVICE_CDC=y
+CONFIG_RT_USB_DEVICE_NONE=y
+CONFIG_RT_USB_DEVICE_MSTORAGE=y
+# CONFIG_RT_USB_DEVICE_HID is not set
+# CONFIG_RT_USB_DEVICE_RNDIS is not set
+# CONFIG_RT_USB_DEVICE_ECM is not set
+# CONFIG_RT_USB_DEVICE_WINUSB is not set
+# CONFIG_RT_USB_DEVICE_AUDIO is not set
+CONFIG_RT_VCOM_TASK_STK_SIZE=2048
+CONFIG_RT_CDC_RX_BUFSIZE=128
+# CONFIG_RT_VCOM_TX_USE_DMA is not set
+CONFIG_RT_VCOM_SERNO="32021919830108"
+CONFIG_RT_VCOM_SER_LEN=14
+CONFIG_RT_VCOM_TX_TIMEOUT=1000
+CONFIG_RT_USB_MSTORAGE_DISK_NAME="ramdisk1"
+
+#
+# POSIX layer and C standard library
+#
+CONFIG_RT_USING_LIBC=y
+# CONFIG_RT_USING_PTHREADS is not set
+CONFIG_RT_USING_POSIX=y
+# CONFIG_RT_USING_POSIX_MMAP is not set
+# CONFIG_RT_USING_POSIX_TERMIOS is not set
+# CONFIG_RT_USING_POSIX_GETLINE is not set
+# CONFIG_RT_USING_POSIX_AIO is not set
+# CONFIG_RT_USING_MODULE is not set
+
+#
+# Network
+#
+
+#
+# Socket abstraction layer
+#
+CONFIG_RT_USING_SAL=y
+CONFIG_SAL_INTERNET_CHECK=y
+
+#
+# protocol stack implement
+#
+CONFIG_SAL_USING_LWIP=y
+CONFIG_SAL_USING_POSIX=y
+
+#
+# Network interface device
+#
+CONFIG_RT_USING_NETDEV=y
+CONFIG_NETDEV_USING_IFCONFIG=y
+CONFIG_NETDEV_USING_PING=y
+CONFIG_NETDEV_USING_NETSTAT=y
+CONFIG_NETDEV_USING_AUTO_DEFAULT=y
+# CONFIG_NETDEV_USING_IPV6 is not set
+CONFIG_NETDEV_IPV4=1
+CONFIG_NETDEV_IPV6=0
+# CONFIG_NETDEV_IPV6_SCOPES is not set
+
+#
+# light weight TCP/IP stack
+#
+CONFIG_RT_USING_LWIP=y
+# CONFIG_RT_USING_LWIP141 is not set
+CONFIG_RT_USING_LWIP202=y
+# CONFIG_RT_USING_LWIP212 is not set
+# CONFIG_RT_USING_LWIP_IPV6 is not set
+CONFIG_RT_LWIP_MEM_ALIGNMENT=4
+CONFIG_RT_LWIP_IGMP=y
+CONFIG_RT_LWIP_ICMP=y
+# CONFIG_RT_LWIP_SNMP is not set
+CONFIG_RT_LWIP_DNS=y
+CONFIG_RT_LWIP_DHCP=y
+CONFIG_IP_SOF_BROADCAST=1
+CONFIG_IP_SOF_BROADCAST_RECV=1
+
+#
+# Static IPv4 Address
+#
+CONFIG_RT_LWIP_IPADDR="192.168.1.30"
+CONFIG_RT_LWIP_GWADDR="192.168.1.1"
+CONFIG_RT_LWIP_MSKADDR="255.255.255.0"
+CONFIG_RT_LWIP_UDP=y
+CONFIG_RT_LWIP_TCP=y
+CONFIG_RT_LWIP_RAW=y
+# CONFIG_RT_LWIP_PPP is not set
+CONFIG_RT_MEMP_NUM_NETCONN=32
+CONFIG_RT_LWIP_PBUF_NUM=256
+CONFIG_RT_LWIP_RAW_PCB_NUM=32
+CONFIG_RT_LWIP_UDP_PCB_NUM=32
+CONFIG_RT_LWIP_TCP_PCB_NUM=32
+CONFIG_RT_LWIP_TCP_SEG_NUM=256
+CONFIG_RT_LWIP_TCP_SND_BUF=32768
+CONFIG_RT_LWIP_TCP_WND=10240
+CONFIG_RT_LWIP_TCPTHREAD_PRIORITY=10
+CONFIG_RT_LWIP_TCPTHREAD_MBOX_SIZE=32
+CONFIG_RT_LWIP_TCPTHREAD_STACKSIZE=4096
+# CONFIG_LWIP_NO_RX_THREAD is not set
+# CONFIG_LWIP_NO_TX_THREAD is not set
+CONFIG_RT_LWIP_ETHTHREAD_PRIORITY=12
+CONFIG_RT_LWIP_ETHTHREAD_STACKSIZE=1024
+CONFIG_RT_LWIP_ETHTHREAD_MBOX_SIZE=32
+# CONFIG_RT_LWIP_REASSEMBLY_FRAG is not set
+CONFIG_LWIP_NETIF_STATUS_CALLBACK=1
+CONFIG_LWIP_NETIF_LINK_CALLBACK=1
+CONFIG_SO_REUSE=1
+CONFIG_LWIP_SO_RCVTIMEO=1
+CONFIG_LWIP_SO_SNDTIMEO=1
+CONFIG_LWIP_SO_RCVBUF=1
+CONFIG_LWIP_SO_LINGER=0
+CONFIG_RT_LWIP_NETIF_LOOPBACK=y
+CONFIG_LWIP_NETIF_LOOPBACK=1
+CONFIG_RT_LWIP_STATS=y
+# CONFIG_RT_LWIP_USING_HW_CHECKSUM is not set
+CONFIG_RT_LWIP_USING_PING=y
+# CONFIG_RT_LWIP_DEBUG is not set
+
+#
+# AT commands
+#
+# CONFIG_RT_USING_AT is not set
+# CONFIG_LWIP_USING_DHCPD is not set
+
+#
+# VBUS(Virtual Software BUS)
+#
+# CONFIG_RT_USING_VBUS is not set
+
+#
+# Utilities
+#
+# CONFIG_RT_USING_RYM is not set
+# CONFIG_RT_USING_ULOG is not set
+CONFIG_RT_USING_UTEST=y
+CONFIG_UTEST_THR_STACK_SIZE=4096
+CONFIG_UTEST_THR_PRIORITY=20
+# CONFIG_RT_USING_LWP is not set
+
+#
+# RT-Thread online packages
+#
+
+#
+# IoT - internet of things
+#
+# CONFIG_PKG_USING_LORAWAN_DRIVER is not set
+# CONFIG_PKG_USING_PAHOMQTT is not set
+# CONFIG_PKG_USING_UMQTT is not set
+# CONFIG_PKG_USING_WEBCLIENT is not set
+# CONFIG_PKG_USING_WEBNET is not set
+# CONFIG_PKG_USING_MONGOOSE is not set
+# CONFIG_PKG_USING_MYMQTT is not set
+# CONFIG_PKG_USING_KAWAII_MQTT is not set
+# CONFIG_PKG_USING_BC28_MQTT is not set
+# CONFIG_PKG_USING_WEBTERMINAL is not set
+# CONFIG_PKG_USING_CJSON is not set
+# CONFIG_PKG_USING_JSMN is not set
+# CONFIG_PKG_USING_LIBMODBUS is not set
+# CONFIG_PKG_USING_FREEMODBUS is not set
+# CONFIG_PKG_USING_LJSON is not set
+# CONFIG_PKG_USING_EZXML is not set
+# CONFIG_PKG_USING_NANOPB is not set
+
+#
+# Wi-Fi
+#
+
+#
+# Marvell WiFi
+#
+# CONFIG_PKG_USING_WLANMARVELL is not set
+
+#
+# Wiced WiFi
+#
+# CONFIG_PKG_USING_WLAN_WICED is not set
+# CONFIG_PKG_USING_RW007 is not set
+# CONFIG_PKG_USING_COAP is not set
+# CONFIG_PKG_USING_NOPOLL is not set
+CONFIG_PKG_USING_NETUTILS=y
+CONFIG_PKG_NETUTILS_PATH="/packages/iot/netutils"
+CONFIG_PKG_NETUTILS_TFTP=y
+CONFIG_PKG_NETUTILS_IPERF=y
+# CONFIG_PKG_NETUTILS_NETIO is not set
+CONFIG_PKG_NETUTILS_NTP=y
+CONFIG_NETUTILS_NTP_TIMEZONE=8
+CONFIG_NETUTILS_NTP_HOSTNAME="0.tw.pool.ntp.org"
+CONFIG_NETUTILS_NTP_HOSTNAME2="1.tw.pool.ntp.org"
+CONFIG_NETUTILS_NTP_HOSTNAME3="2.tw.pool.ntp.org"
+# CONFIG_PKG_NETUTILS_TELNET is not set
+# CONFIG_PKG_NETUTILS_TCPDUMP is not set
+CONFIG_PKG_USING_NETUTILS_V120=y
+# CONFIG_PKG_USING_NETUTILS_V110 is not set
+# CONFIG_PKG_USING_NETUTILS_V100 is not set
+# CONFIG_PKG_USING_NETUTILS_LATEST_VERSION is not set
+CONFIG_PKG_NETUTILS_VER="v1.2.0"
+# CONFIG_PKG_USING_CMUX is not set
+# CONFIG_PKG_USING_PPP_DEVICE is not set
+# CONFIG_PKG_USING_AT_DEVICE is not set
+# CONFIG_PKG_USING_ATSRV_SOCKET is not set
+# CONFIG_PKG_USING_WIZNET is not set
+
+#
+# IoT Cloud
+#
+# CONFIG_PKG_USING_ONENET is not set
+# CONFIG_PKG_USING_GAGENT_CLOUD is not set
+# CONFIG_PKG_USING_ALI_IOTKIT is not set
+# CONFIG_PKG_USING_AZURE is not set
+# CONFIG_PKG_USING_TENCENT_IOT_EXPLORER is not set
+# CONFIG_PKG_USING_JIOT-C-SDK is not set
+# CONFIG_PKG_USING_UCLOUD_IOT_SDK is not set
+# CONFIG_PKG_USING_JOYLINK is not set
+# CONFIG_PKG_USING_NIMBLE is not set
+# CONFIG_PKG_USING_OTA_DOWNLOADER is not set
+# CONFIG_PKG_USING_IPMSG is not set
+# CONFIG_PKG_USING_LSSDP is not set
+# CONFIG_PKG_USING_AIRKISS_OPEN is not set
+# CONFIG_PKG_USING_LIBRWS is not set
+# CONFIG_PKG_USING_TCPSERVER is not set
+# CONFIG_PKG_USING_PROTOBUF_C is not set
+# CONFIG_PKG_USING_ONNX_PARSER is not set
+# CONFIG_PKG_USING_ONNX_BACKEND is not set
+# CONFIG_PKG_USING_DLT645 is not set
+# CONFIG_PKG_USING_QXWZ is not set
+# CONFIG_PKG_USING_SMTP_CLIENT is not set
+# CONFIG_PKG_USING_ABUP_FOTA is not set
+# CONFIG_PKG_USING_LIBCURL2RTT is not set
+# CONFIG_PKG_USING_CAPNP is not set
+# CONFIG_PKG_USING_RT_CJSON_TOOLS is not set
+# CONFIG_PKG_USING_AGILE_TELNET is not set
+# CONFIG_PKG_USING_NMEALIB is not set
+# CONFIG_PKG_USING_AGILE_JSMN is not set
+# CONFIG_PKG_USING_PDULIB is not set
+# CONFIG_PKG_USING_BTSTACK is not set
+# CONFIG_PKG_USING_LORAWAN_ED_STACK is not set
+# CONFIG_PKG_USING_WAYZ_IOTKIT is not set
+
+#
+# security packages
+#
+# CONFIG_PKG_USING_MBEDTLS is not set
+# CONFIG_PKG_USING_libsodium is not set
+# CONFIG_PKG_USING_TINYCRYPT is not set
+# CONFIG_PKG_USING_TFM is not set
+# CONFIG_PKG_USING_YD_CRYPTO is not set
+
+#
+# language packages
+#
+# CONFIG_PKG_USING_LUA is not set
+# CONFIG_PKG_USING_JERRYSCRIPT is not set
+# CONFIG_PKG_USING_MICROPYTHON is not set
+
+#
+# multimedia packages
+#
+# CONFIG_PKG_USING_OPENMV is not set
+# CONFIG_PKG_USING_MUPDF is not set
+# CONFIG_PKG_USING_STEMWIN is not set
+# CONFIG_PKG_USING_WAVPLAYER is not set
+# CONFIG_PKG_USING_TJPGD is not set
+# CONFIG_PKG_USING_HELIX is not set
+# CONFIG_PKG_USING_AZUREGUIX is not set
+# CONFIG_PKG_USING_TOUCHGFX2RTT is not set
+
+#
+# tools packages
+#
+# CONFIG_PKG_USING_CMBACKTRACE is not set
+# CONFIG_PKG_USING_EASYFLASH is not set
+# CONFIG_PKG_USING_EASYLOGGER is not set
+# CONFIG_PKG_USING_SYSTEMVIEW is not set
+# CONFIG_PKG_USING_RDB is not set
+# CONFIG_PKG_USING_QRCODE is not set
+# CONFIG_PKG_USING_ULOG_EASYFLASH is not set
+# CONFIG_PKG_USING_ULOG_FILE is not set
+# CONFIG_PKG_USING_LOGMGR is not set
+# CONFIG_PKG_USING_ADBD is not set
+# CONFIG_PKG_USING_COREMARK is not set
+# CONFIG_PKG_USING_DHRYSTONE is not set
+# CONFIG_PKG_USING_MEMORYPERF is not set
+# CONFIG_PKG_USING_NR_MICRO_SHELL is not set
+# CONFIG_PKG_USING_CHINESE_FONT_LIBRARY is not set
+# CONFIG_PKG_USING_LUNAR_CALENDAR is not set
+# CONFIG_PKG_USING_BS8116A is not set
+# CONFIG_PKG_USING_GPS_RMC is not set
+# CONFIG_PKG_USING_URLENCODE is not set
+# CONFIG_PKG_USING_UMCN is not set
+# CONFIG_PKG_USING_LWRB2RTT is not set
+# CONFIG_PKG_USING_CPU_USAGE is not set
+# CONFIG_PKG_USING_GBK2UTF8 is not set
+# CONFIG_PKG_USING_VCONSOLE is not set
+# CONFIG_PKG_USING_KDB is not set
+# CONFIG_PKG_USING_WAMR is not set
+
+#
+# system packages
+#
+# CONFIG_PKG_USING_GUIENGINE is not set
+# CONFIG_PKG_USING_PERSIMMON is not set
+# CONFIG_PKG_USING_CAIRO is not set
+# CONFIG_PKG_USING_PIXMAN is not set
+# CONFIG_PKG_USING_LWEXT4 is not set
+# CONFIG_PKG_USING_PARTITION is not set
+CONFIG_PKG_USING_FAL=y
+CONFIG_PKG_FAL_PATH="/packages/system/fal"
+CONFIG_FAL_DEBUG_CONFIG=y
+CONFIG_FAL_DEBUG=1
+CONFIG_FAL_PART_HAS_TABLE_CFG=y
+CONFIG_FAL_USING_SFUD_PORT=y
+CONFIG_FAL_USING_NOR_FLASH_DEV_NAME="norflash0"
+# CONFIG_PKG_USING_FAL_V00500 is not set
+# CONFIG_PKG_USING_FAL_V00400 is not set
+# CONFIG_PKG_USING_FAL_V00300 is not set
+# CONFIG_PKG_USING_FAL_V00200 is not set
+# CONFIG_PKG_USING_FAL_V00100 is not set
+CONFIG_PKG_USING_FAL_LATEST_VERSION=y
+CONFIG_PKG_FAL_VER="latest"
+CONFIG_PKG_FAL_VER_NUM=0x99999
+# CONFIG_PKG_USING_FLASHDB is not set
+# CONFIG_PKG_USING_SQLITE is not set
+# CONFIG_PKG_USING_RTI is not set
+# CONFIG_PKG_USING_LITTLEVGL2RTT is not set
+# CONFIG_PKG_USING_CMSIS is not set
+# CONFIG_PKG_USING_DFS_YAFFS is not set
+# CONFIG_PKG_USING_LITTLEFS is not set
+# CONFIG_PKG_USING_THREAD_POOL is not set
+# CONFIG_PKG_USING_ROBOTS is not set
+# CONFIG_PKG_USING_EV is not set
+# CONFIG_PKG_USING_SYSWATCH is not set
+# CONFIG_PKG_USING_SYS_LOAD_MONITOR is not set
+# CONFIG_PKG_USING_PLCCORE is not set
+CONFIG_PKG_USING_RAMDISK=y
+CONFIG_PKG_RAMDISK_PATH="/packages/system/ramdisk"
+# CONFIG_PKG_USING_RAMDISK_V010 is not set
+CONFIG_PKG_USING_RAMDISK_LATEST_VERSION=y
+CONFIG_PKG_RAMDISK_VER="latest"
+# CONFIG_PKG_USING_MININI is not set
+# CONFIG_PKG_USING_QBOOT is not set
+
+#
+# Micrium: Micrium software products porting for RT-Thread
+#
+# CONFIG_PKG_USING_UCOSIII_WRAPPER is not set
+# CONFIG_PKG_USING_UCOSII_WRAPPER is not set
+# CONFIG_PKG_USING_UC_CRC is not set
+# CONFIG_PKG_USING_UC_CLK is not set
+# CONFIG_PKG_USING_UC_COMMON is not set
+# CONFIG_PKG_USING_UC_MODBUS is not set
+# CONFIG_PKG_USING_PPOOL is not set
+# CONFIG_PKG_USING_OPENAMP is not set
+# CONFIG_PKG_USING_RT_PRINTF is not set
+# CONFIG_PKG_USING_RT_MEMCPY_CM is not set
+# CONFIG_PKG_USING_QFPLIB_M0_FULL is not set
+# CONFIG_PKG_USING_QFPLIB_M0_TINY is not set
+# CONFIG_PKG_USING_QFPLIB_M3 is not set
+
+#
+# peripheral libraries and drivers
+#
+# CONFIG_PKG_USING_SENSORS_DRIVERS is not set
+# CONFIG_PKG_USING_REALTEK_AMEBA is not set
+# CONFIG_PKG_USING_SHT2X is not set
+# CONFIG_PKG_USING_SHT3X is not set
+# CONFIG_PKG_USING_AS7341 is not set
+# CONFIG_PKG_USING_STM32_SDIO is not set
+# CONFIG_PKG_USING_ICM20608 is not set
+# CONFIG_PKG_USING_U8G2 is not set
+# CONFIG_PKG_USING_BUTTON is not set
+# CONFIG_PKG_USING_PCF8574 is not set
+# CONFIG_PKG_USING_SX12XX is not set
+# CONFIG_PKG_USING_SIGNAL_LED is not set
+# CONFIG_PKG_USING_LEDBLINK is not set
+# CONFIG_PKG_USING_LITTLED is not set
+# CONFIG_PKG_USING_LKDGUI is not set
+# CONFIG_PKG_USING_NRF5X_SDK is not set
+# CONFIG_PKG_USING_NRFX is not set
+# CONFIG_PKG_USING_WM_LIBRARIES is not set
+# CONFIG_PKG_USING_KENDRYTE_SDK is not set
+# CONFIG_PKG_USING_INFRARED is not set
+# CONFIG_PKG_USING_ROSSERIAL is not set
+# CONFIG_PKG_USING_AGILE_BUTTON is not set
+# CONFIG_PKG_USING_AGILE_LED is not set
+# CONFIG_PKG_USING_AT24CXX is not set
+# CONFIG_PKG_USING_MOTIONDRIVER2RTT is not set
+# CONFIG_PKG_USING_AD7746 is not set
+# CONFIG_PKG_USING_PCA9685 is not set
+# CONFIG_PKG_USING_I2C_TOOLS is not set
+# CONFIG_PKG_USING_NRF24L01 is not set
+# CONFIG_PKG_USING_TOUCH_DRIVERS is not set
+# CONFIG_PKG_USING_MAX17048 is not set
+# CONFIG_PKG_USING_RPLIDAR is not set
+# CONFIG_PKG_USING_AS608 is not set
+# CONFIG_PKG_USING_RC522 is not set
+# CONFIG_PKG_USING_WS2812B is not set
+# CONFIG_PKG_USING_EMBARC_BSP is not set
+# CONFIG_PKG_USING_EXTERN_RTC_DRIVERS is not set
+# CONFIG_PKG_USING_MULTI_RTIMER is not set
+# CONFIG_PKG_USING_MAX7219 is not set
+# CONFIG_PKG_USING_BEEP is not set
+# CONFIG_PKG_USING_EASYBLINK is not set
+# CONFIG_PKG_USING_PMS_SERIES is not set
+# CONFIG_PKG_USING_CAN_YMODEM is not set
+# CONFIG_PKG_USING_LORA_RADIO_DRIVER is not set
+# CONFIG_PKG_USING_QLED is not set
+# CONFIG_PKG_USING_PAJ7620 is not set
+# CONFIG_PKG_USING_AGILE_CONSOLE is not set
+# CONFIG_PKG_USING_LD3320 is not set
+# CONFIG_PKG_USING_WK2124 is not set
+# CONFIG_PKG_USING_LY68L6400 is not set
+# CONFIG_PKG_USING_DM9051 is not set
+# CONFIG_PKG_USING_SSD1306 is not set
+# CONFIG_PKG_USING_QKEY is not set
+# CONFIG_PKG_USING_RS485 is not set
+# CONFIG_PKG_USING_NES is not set
+# CONFIG_PKG_USING_VIRTUAL_SENSOR is not set
+# CONFIG_PKG_USING_VDEVICE is not set
+# CONFIG_PKG_USING_SGM706 is not set
+
+#
+# miscellaneous packages
+#
+# CONFIG_PKG_USING_LIBCSV is not set
+CONFIG_PKG_USING_OPTPARSE=y
+CONFIG_PKG_OPTPARSE_PATH="/packages/misc/optparse"
+CONFIG_PKG_USING_OPTPARSE_V100=y
+# CONFIG_PKG_USING_OPTPARSE_LATEST_VERSION is not set
+CONFIG_PKG_OPTPARSE_VER="v1.0.0"
+# CONFIG_OPTPARSE_USING_DEMO is not set
+# CONFIG_PKG_USING_FASTLZ is not set
+# CONFIG_PKG_USING_MINILZO is not set
+# CONFIG_PKG_USING_QUICKLZ is not set
+# CONFIG_PKG_USING_LZMA is not set
+# CONFIG_PKG_USING_MULTIBUTTON is not set
+# CONFIG_PKG_USING_FLEXIBLE_BUTTON is not set
+# CONFIG_PKG_USING_CANFESTIVAL is not set
+# CONFIG_PKG_USING_ZLIB is not set
+# CONFIG_PKG_USING_DSTR is not set
+# CONFIG_PKG_USING_TINYFRAME is not set
+# CONFIG_PKG_USING_KENDRYTE_DEMO is not set
+# CONFIG_PKG_USING_DIGITALCTRL is not set
+# CONFIG_PKG_USING_UPACKER is not set
+# CONFIG_PKG_USING_UPARAM is not set
+
+#
+# samples: kernel and components samples
+#
+# CONFIG_PKG_USING_KERNEL_SAMPLES is not set
+# CONFIG_PKG_USING_FILESYSTEM_SAMPLES is not set
+# CONFIG_PKG_USING_NETWORK_SAMPLES is not set
+# CONFIG_PKG_USING_PERIPHERAL_SAMPLES is not set
+# CONFIG_PKG_USING_HELLO is not set
+CONFIG_PKG_USING_VI=y
+CONFIG_PKG_VI_PATH="/packages/misc/vi"
+CONFIG_VI_MAX_LEN=4096
+# CONFIG_VI_ENABLE_8BIT is not set
+CONFIG_VI_ENABLE_COLON=y
+CONFIG_VI_ENABLE_YANKMARK=y
+CONFIG_VI_ENABLE_SEARCH=y
+CONFIG_VI_ENABLE_DOT_CMD=y
+CONFIG_VI_ENABLE_READONLY=y
+CONFIG_VI_ENABLE_SETOPTS=y
+CONFIG_VI_ENABLE_SET=y
+CONFIG_VI_ENABLE_VI_ASK_TERMINAL=y
+CONFIG_VI_ENABLE_UNDO=y
+CONFIG_VI_ENABLE_UNDO_QUEUE=y
+CONFIG_VI_UNDO_QUEUE_MAX=256
+CONFIG_PKG_USING_VI_LATEST_VERSION=y
+CONFIG_PKG_VI_VER="latest"
+# CONFIG_PKG_USING_KI is not set
+# CONFIG_PKG_USING_NNOM is not set
+# CONFIG_PKG_USING_LIBANN is not set
+# CONFIG_PKG_USING_ELAPACK is not set
+# CONFIG_PKG_USING_ARMv7M_DWT is not set
+# CONFIG_PKG_USING_VT100 is not set
+# CONFIG_PKG_USING_ULAPACK is not set
+# CONFIG_PKG_USING_UKAL is not set
+# CONFIG_PKG_USING_CRCLIB is not set
+
+#
+# games: games run on RT-Thread console
+#
+# CONFIG_PKG_USING_THREES is not set
+# CONFIG_PKG_USING_2048 is not set
+# CONFIG_PKG_USING_SNAKE is not set
+# CONFIG_PKG_USING_TETRIS is not set
+# CONFIG_PKG_USING_LWGPS is not set
+# CONFIG_PKG_USING_TENSORFLOWLITEMICRO is not set
+# CONFIG_PKG_USING_STATE_MACHINE is not set
+
+#
+# Nuvoton Packages Config
+#
+CONFIG_NU_PKG_USING_UTILS=y
+CONFIG_NU_PKG_USING_DEMO=y
+# CONFIG_NU_PKG_USING_BMX055 is not set
+# CONFIG_NU_PKG_USING_MAX31875 is not set
+# CONFIG_NU_PKG_USING_NAU88L25 is not set
+# CONFIG_NU_PKG_USING_NAU8822 is not set
+# CONFIG_NU_PKG_USING_ILI9341 is not set
+# CONFIG_NU_PKG_USING_SPINAND is not set
+
+#
+# Hardware Drivers Config
+#
+
+#
+# On-chip Peripheral Drivers
+#
+CONFIG_SOC_SERIES_NUC980=y
+CONFIG_BSP_USE_STDDRIVER_SOURCE=y
+CONFIG_BSP_USING_MMU=y
+CONFIG_BSP_USING_PDMA=y
+CONFIG_NU_PDMA_MEMFUN_ACTOR_MAX=2
+CONFIG_BSP_USING_GPIO=y
+CONFIG_BSP_USING_EMAC=y
+# CONFIG_BSP_USING_EMAC0 is not set
+CONFIG_BSP_USING_EMAC1=y
+CONFIG_NU_EMAC_PDMA_MEMCOPY=y
+CONFIG_NU_EMAC_PDMA_MEMCOPY_THRESHOLD=128
+# CONFIG_BSP_USING_RTC is not set
+CONFIG_BSP_USING_ADC=y
+CONFIG_BSP_USING_TMR=y
+CONFIG_BSP_USING_TIMER=y
+CONFIG_BSP_USING_TMR0=y
+CONFIG_BSP_USING_TIMER0=y
+# CONFIG_BSP_USING_TIMER0_CAPTURE is not set
+CONFIG_BSP_USING_TMR1=y
+CONFIG_BSP_USING_TIMER1=y
+# CONFIG_BSP_USING_TIMER1_CAPTURE is not set
+CONFIG_BSP_USING_TMR2=y
+CONFIG_BSP_USING_TIMER2=y
+# CONFIG_BSP_USING_TIMER2_CAPTURE is not set
+CONFIG_BSP_USING_TMR3=y
+CONFIG_BSP_USING_TIMER3=y
+# CONFIG_BSP_USING_TIMER3_CAPTURE is not set
+CONFIG_BSP_USING_TMR4=y
+CONFIG_BSP_USING_TIMER4=y
+# CONFIG_BSP_USING_TIMER4_CAPTURE is not set
+CONFIG_BSP_USING_UART=y
+CONFIG_BSP_USING_UART0=y
+# CONFIG_BSP_USING_UART0_TX_DMA is not set
+# CONFIG_BSP_USING_UART0_RX_DMA is not set
+# CONFIG_BSP_USING_UART1 is not set
+# CONFIG_BSP_USING_UART2 is not set
+# CONFIG_BSP_USING_UART3 is not set
+CONFIG_BSP_USING_UART4=y
+CONFIG_BSP_USING_UART4_TX_DMA=y
+CONFIG_BSP_USING_UART4_RX_DMA=y
+# CONFIG_BSP_USING_UART5 is not set
+# CONFIG_BSP_USING_UART6 is not set
+# CONFIG_BSP_USING_UART7 is not set
+CONFIG_BSP_USING_UART8=y
+CONFIG_BSP_USING_UART8_TX_DMA=y
+CONFIG_BSP_USING_UART8_RX_DMA=y
+# CONFIG_BSP_USING_UART9 is not set
+CONFIG_BSP_USING_I2C=y
+# CONFIG_BSP_USING_I2C0 is not set
+CONFIG_BSP_USING_I2C1=y
+# CONFIG_BSP_USING_I2C2 is not set
+# CONFIG_BSP_USING_I2C3 is not set
+# CONFIG_BSP_USING_SDH is not set
+CONFIG_BSP_USING_CAN=y
+# CONFIG_BSP_USING_CAN0 is not set
+# CONFIG_BSP_USING_CAN1 is not set
+# CONFIG_BSP_USING_CAN2 is not set
+CONFIG_BSP_USING_CAN3=y
+# CONFIG_BSP_USING_PWM is not set
+CONFIG_BSP_USING_SPI=y
+CONFIG_BSP_USING_SPI_PDMA=y
+# CONFIG_BSP_USING_SPI0_NONE is not set
+CONFIG_BSP_USING_SPI0=y
+CONFIG_BSP_USING_SPI0_PDMA=y
+CONFIG_BSP_USING_SPI1_NONE=y
+# CONFIG_BSP_USING_SPI1 is not set
+# CONFIG_BSP_USING_I2S is not set
+CONFIG_BSP_USING_QSPI=y
+CONFIG_BSP_USING_QSPI0=y
+CONFIG_BSP_USING_QSPI0_PDMA=y
+# CONFIG_BSP_USING_SCUART is not set
+CONFIG_BSP_USING_CRYPTO=y
+# CONFIG_NU_PRNG_USE_SEED is not set
+# CONFIG_BSP_USING_SOFT_I2C is not set
+CONFIG_BSP_USING_WDT=y
+# CONFIG_BSP_USING_EBI is not set
+CONFIG_BSP_USING_USBD=y
+CONFIG_BSP_USING_USBH=y
+
+#
+# On-board Peripheral Drivers
+#
+CONFIG_BSP_USING_CONSOLE=y
+CONFIG_BOARD_USING_UART8_RS485=y
+CONFIG_BOARD_USING_STORAGE_SPIFLASH=y
+CONFIG_BOARD_USING_USB0_DEVICE_HOST=y
+
+#
+# Board extended module drivers
+#
+CONFIG_BOARD_USING_IP101GR=y
+CONFIG_BOARD_USE_UTEST=y
+CONFIG_UTEST_CMD_PREFIX="bsp.nuvoton.nk-rtu980.test.utest."
diff --git a/bsp/nuvoton/nk-rtu980/Kconfig b/bsp/nuvoton/nk-rtu980/Kconfig
new file mode 100644
index 0000000000..5c55e87c61
--- /dev/null
+++ b/bsp/nuvoton/nk-rtu980/Kconfig
@@ -0,0 +1,29 @@
+mainmenu "RT-Thread Configuration"
+
+config BSP_DIR
+ string
+ option env="BSP_ROOT"
+ default "."
+
+config RTT_DIR
+ string
+ option env="RTT_ROOT"
+ default "../../.."
+
+# you can change the RTT_ROOT default "../../.." to your rtthread_root,
+# example : default "F:/git_repositories/rt-thread"
+
+config PKGS_DIR
+ string
+ option env="PKGS_ROOT"
+ default "packages"
+
+config NU_PKGS_DIR
+ string
+ option env="NU_PKGS_ROOT"
+ default "../libraries/nu_packages"
+
+source "$RTT_DIR/Kconfig"
+source "$PKGS_DIR/Kconfig"
+source "$NU_PKGS_DIR/Kconfig"
+source "$BSP_DIR/board/Kconfig"
diff --git a/bsp/nuvoton/nk-rtu980/README.md b/bsp/nuvoton/nk-rtu980/README.md
new file mode 100644
index 0000000000..20294482ea
--- /dev/null
+++ b/bsp/nuvoton/nk-rtu980/README.md
@@ -0,0 +1,106 @@
+# NK-RTU980
+## 1. Introduction
+NuMaker-RTU-NUC980, also known as Chili, is a Nuvoton’s development platform that uses NUC980DR61YC microprocessor with a 64-pin package on a 50 mm x 50 mm dimension PCB. Chili board provides a high-end hardware features including a NUC980DR61YC ARM926EJ-S processor with 64 MB DRAM, 32MB SPI NOR Flash, 10/100 Ethernet MAC interface, USB 2.0 High Speed host/device connector, CAN bus, RS-485 and five GPIOs. Crypto engine supports RSA2048, AES256, ECC, SHA512 algorithm and a Pseudo Random Number Generator for communication security protection.
+
+
+[![NK-RTU980](https://i.imgur.com/gCKG4PN.png "NK-RTU980")](https://i.imgur.com/gCKG4PN.png "NK-RTU980")
+
+
+### 1.1 MCU specification
+
+| | Features |
+| -- | -- |
+| Part NO. | NUC980DR61YC |
+| CPU ARCH. | 32-bit ARM926EJ-STM |
+| Operation frequency | 300 MHz |
+| Embedded SDRAM size | Built-in 64MB |
+| Crypto engine | AES, RSA, ECC, HMAC and SHA crypto accelerator |
+| RMII interface | 10/100 Mbps x1 |
+| USB 2.0 | High Speed Host x1, High Speed Host/Device x1 |
+| Extern storage | 32 MB SPI-NOR Flash |
+
+### 1.2 Interface
+
+| Interface |
+| -- |
+| Arduino UNO |
+| A RJ45 Ethernet |
+| An USB 2.0 HS port |
+| An USB 2.0 HS OTG port |
+| A RS-485 |
+| A CAN bus |
+| An ICE connector |
+
+### 1.3 On-board devices
+
+| Device | Description | Driver supporting status |
+| -- | -- | -- |
+|Ethernet PHY | IP101GR | Supported |
+|Button | | Supported |
+|LEDs | | Supported |
+|USB Device | VCOM + MStorage | Supported |
+|USB Host | MStorage | Supported |
+|SPI NOR flash | W25Q256F | Supported |
+|VCOM | For console | Ready.(Need to install VCOM driver) |
+
+## 2. Supported compiler
+Support GCC, MDK4 and MDK5 IDE/compilers. More information of these compiler version as following:
+
+| IDE/Compiler | Tested version |
+| ---------- | ---------------------------- |
+| MDK4 | 4.76 |
+| MDK5 | 5.26.2 |
+| GCC | GCC 5.4.1 20160919 (release) |
+
+Notice: Please install ICE driver for development.
+
+## 3. Program firmware
+### 3.1 SDRAM Downloading using NuWriter
+You can use NuWriter to download rtthread.bin into SDRAM, then run it.
+[![SDRAM Downloading using NuWriter](https://i.imgur.com/NvbzsRp.gif "SDRAM Downloading using NuWriter")](https://i.imgur.com/NvbzsRp.gif "SDRAM Downloading using NuWriter")
+<br>
+Choose type: DDR/SRAM<br>
+<< Press Re-Connect >><br>
+Choose file: Specify your rtthread.bin file.<br>
+Execute Address: 0x0<br>
+Option: Download and run<br>
+<< Press Download >><br>
+Enjoy!! <br>
+<br>
+
+### 3.2 SPI NOR flash using NuWriter
+You can use NuWriter to program rtthread.bin into SPI NOR flash.
+[![SPI NOR flash](https://i.imgur.com/8OtXGSQ.gif "SPI NOR flash")](https://i.imgur.com/8OtXGSQ.gif "SPI NOR flash using NuWriter")
+<br>
+Choose type: SPI<br>
+<< Press Re-Connect >><br>
+Choose file: Specify your rtthread.bin file.<br>
+Image Type: Loader<br>
+Execute Address: 0x0<br>
+<< Press Program >><br>
+<< Press OK & Wait it down >><br>
+<< Set Power-on setting to SPI NOR booting >><br>
+<< Press Reset button on board >><br>
+Enjoy!! <br>
+<br>
+
+## 4. Test
+You can use Tera Term terminate emulator (or other software) to type commands of RTT. All parameters of serial communication are shown in below image. Here, you can find out the corresponding port number of Nuvoton Virtual Com Port in window device manager.
+
+[![Serial settings](https://i.imgur.com/5NYuSNM.png "Serial settings")](https://i.imgur.com/5NYuSNM.png "Serial settings")
+
+## 5. Purchase
+* [Nuvoton Direct][1]
+
+## 6. Resources
+* [Download Board Schematics][2]
+* [Download NK-RTU980 Quick Start Guide][3]
+* [Download TRM][4]
+* [Download NuWriter][5]
+
+ [1]: https://direct.nuvoton.com/tw/numaker-rtu-nuc980
+ [2]: https://www.nuvoton.com/resource-download.jsp?tp_GUID=HL1020200508155209
+ [3]: https://www.nuvoton.com/resource-download.jsp?tp_GUID=UG1320200623183237
+ [4]: https://www.nuvoton.com/resource-download.jsp?tp_GUID=DA05-NUC980-1
+ [5]: https://github.com/OpenNuvoton/NUC980_NuWriter
+ \ No newline at end of file
diff --git a/bsp/nuvoton/nk-rtu980/SConscript b/bsp/nuvoton/nk-rtu980/SConscript
new file mode 100644
index 0000000000..fe0ae941ae
--- /dev/null
+++ b/bsp/nuvoton/nk-rtu980/SConscript
@@ -0,0 +1,14 @@
+# for module compiling
+import os
+Import('RTT_ROOT')
+
+cwd = str(Dir('#'))
+objs = []
+list = os.listdir(cwd)
+
+for d in list:
+ path = os.path.join(cwd, d)
+ if os.path.isfile(os.path.join(path, 'SConscript')):
+ objs = objs + SConscript(os.path.join(d, 'SConscript'))
+
+Return('objs')
diff --git a/bsp/nuvoton/nk-rtu980/SConstruct b/bsp/nuvoton/nk-rtu980/SConstruct
new file mode 100644
index 0000000000..4290749228
--- /dev/null
+++ b/bsp/nuvoton/nk-rtu980/SConstruct
@@ -0,0 +1,55 @@
+import os
+import sys
+import rtconfig
+
+if os.getenv('RTT_ROOT'):
+ RTT_ROOT = os.getenv('RTT_ROOT')
+else:
+ RTT_ROOT = os.path.normpath(os.getcwd() + '/../../..')
+
+sys.path = sys.path + [os.path.join(RTT_ROOT, 'tools')]
+try:
+ from building import *
+except:
+ print('Cannot found RT-Thread root directory, please check RTT_ROOT')
+ print(RTT_ROOT)
+ exit(-1)
+
+TARGET = 'rtthread.' + rtconfig.TARGET_EXT
+
+DefaultEnvironment(tools=[])
+env = Environment(tools = ['mingw'],
+ AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS,
+ CC = rtconfig.CC, CCFLAGS = rtconfig.CFLAGS,
+ CXX = rtconfig.CXX, CXXFLAGS = rtconfig.CFLAGS,
+ AR = rtconfig.AR, ARFLAGS = '-rc',
+ LINK = rtconfig.LINK, LINKFLAGS = rtconfig.LFLAGS)
+env.PrependENVPath('PATH', rtconfig.EXEC_PATH)
+
+Export('RTT_ROOT')
+Export('rtconfig')
+
+SDK_ROOT = os.path.abspath('./')
+
+if os.path.exists(SDK_ROOT + '/libraries'):
+ libraries_path_prefix = SDK_ROOT + '/libraries'
+else:
+ libraries_path_prefix = os.path.dirname(SDK_ROOT) + '/libraries'
+
+SDK_LIB = libraries_path_prefix
+Export('SDK_LIB')
+
+# prepare building environment
+objs = PrepareBuilding(env, RTT_ROOT, has_libcpu=False)
+
+nuvoton_library = 'nuc980'
+rtconfig.BSP_LIBRARY_TYPE = nuvoton_library
+
+# include libraries
+objs.extend(SConscript(os.path.join(libraries_path_prefix, nuvoton_library, 'SConscript')))
+
+# include nu_pkgs
+objs.extend(SConscript(os.path.join(libraries_path_prefix, 'nu_packages', 'SConscript')))
+
+# make a building
+DoBuilding(TARGET, objs)
diff --git a/bsp/nuvoton/nk-rtu980/applications/SConscript b/bsp/nuvoton/nk-rtu980/applications/SConscript
new file mode 100644
index 0000000000..9ffdbcd0f9
--- /dev/null
+++ b/bsp/nuvoton/nk-rtu980/applications/SConscript
@@ -0,0 +1,11 @@
+# RT-Thread building script for component
+
+from building import *
+
+cwd = GetCurrentDir()
+src = Glob('*.c') + Glob('*.cpp')
+CPPPATH = [cwd, str(Dir('#'))]
+
+group = DefineGroup('Applications', src, depend = [''], CPPPATH = CPPPATH)
+
+Return('group')
diff --git a/bsp/nuvoton/nk-rtu980/applications/main.c b/bsp/nuvoton/nk-rtu980/applications/main.c
new file mode 100644
index 0000000000..73992209ed
--- /dev/null
+++ b/bsp/nuvoton/nk-rtu980/applications/main.c
@@ -0,0 +1,71 @@
+/**************************************************************************//**
+*
+* @copyright (C) 2019 Nuvoton Technology Corp. All rights reserved.
+*
+* SPDX-License-Identifier: Apache-2.0
+*
+* Change Logs:
+* Date Author Notes
+* 2020-12-12 Wayne First version
+*
+******************************************************************************/
+
+#include <rtconfig.h>
+#include <rtdevice.h>
+
+#if defined(RT_USING_PIN)
+#include <drv_gpio.h>
+
+/* defined the LED_G1 pin: PC3 */
+#define LED_G1 NU_GET_PININDEX(NU_PC, 3)
+
+/* defined the LED_G2 pin: PC11 */
+#define LED_G2 NU_GET_PININDEX(NU_PC, 11)
+
+/* defined the BUTTON pin: PC15 */
+#define BUTTON NU_GET_PININDEX(NU_PC, 15)
+
+static uint32_t u32Button = BUTTON;
+
+void nu_button_cb(void *args)
+{
+ static int u32ToggleFlag = 0;
+ uint32_t u32Key = *((uint32_t *)(args));
+
+ switch (u32Key)
+ {
+ case BUTTON:
+ u32ToggleFlag = ~u32ToggleFlag;
+ rt_pin_write(LED_G1, u32ToggleFlag);
+ break;
+ }
+}
+#endif
+
+int main(int argc, char **argv)
+{
+#if defined(RT_USING_PIN)
+ int counter = 1000;
+
+ /* set LED_G1 pin mode to output */
+ rt_pin_mode(LED_G1, PIN_MODE_OUTPUT);
+
+ /* set LED_G2 pin mode to output */
+ rt_pin_mode(LED_G2, PIN_MODE_OUTPUT);
+
+ /* set BUTTON pin mode to input */
+ rt_pin_mode(BUTTON, PIN_MODE_INPUT_PULLUP);
+ rt_pin_attach_irq(BUTTON, PIN_IRQ_MODE_FALLING, nu_button_cb, &u32Button);
+ rt_pin_irq_enable(BUTTON, PIN_IRQ_ENABLE);
+
+ while (counter--)
+ {
+ rt_pin_write(LED_G2, PIN_HIGH);
+ rt_thread_mdelay(200);
+ rt_pin_write(LED_G2, PIN_LOW);
+ rt_thread_mdelay(200);
+ }
+#endif
+
+ return 0;
+}
diff --git a/bsp/nuvoton/nk-rtu980/applications/mnt.c b/bsp/nuvoton/nk-rtu980/applications/mnt.c
new file mode 100644
index 0000000000..779db2ffe8
--- /dev/null
+++ b/bsp/nuvoton/nk-rtu980/applications/mnt.c
@@ -0,0 +1,237 @@
+/**************************************************************************//**
+*
+* @copyright (C) 2019 Nuvoton Technology Corp. All rights reserved.
+*
+* SPDX-License-Identifier: Apache-2.0
+*
+* Change Logs:
+* Date Author Notes
+* 2021-3-4 Wayne First version
+*
+******************************************************************************/
+
+#include "rtconfig.h"
+
+#include <rtthread.h>
+
+#define LOG_TAG "mnt"
+#define DBG_ENABLE
+#define DBG_SECTION_NAME "mnt"
+#define DBG_LEVEL DBG_ERROR
+#define DBG_COLOR
+#include <rtdbg.h>
+
+#if defined(RT_USING_DFS)
+ #include <dfs_fs.h>
+ #include <dfs_posix.h>
+#endif
+
+#if defined(PKG_USING_FAL)
+ #include <fal.h>
+#endif
+
+#if defined(PKG_USING_RAMDISK)
+ #define RAMDISK_NAME "ramdisk0"
+ #define RAMDISK_UDC "ramdisk1"
+ #define MOUNT_POINT_RAMDISK0 "/"
+#endif
+
+#if defined(BOARD_USING_STORAGE_SPIFLASH)
+ #define PARTITION_NAME_FILESYSTEM "filesystem"
+ #define MOUNT_POINT_SPIFLASH0 "/mnt/"PARTITION_NAME_FILESYSTEM
+#endif
+
+#ifdef RT_USING_DFS_MNTTABLE
+
+/*
+const char *device_name;
+const char *path;
+const char *filesystemtype;
+unsigned long rwflag;
+const void *data;
+*/
+
+const struct dfs_mount_tbl mount_table[] =
+{
+ { RAMDISK_UDC, "/mnt/ram_usbd", "elm", 0, RT_NULL },
+ {0},
+};
+#endif
+
+
+#if defined(PKG_USING_RAMDISK)
+
+extern rt_err_t ramdisk_init(const char *dev_name, rt_uint8_t *disk_addr, rt_size_t block_size, rt_size_t num_block);
+int ramdisk_device_init(void)
+{
+ rt_err_t result = RT_EOK;
+
+ /* Create a 8MB RAMDISK */
+ result = ramdisk_init(RAMDISK_NAME, NULL, 512, 2 * 8192);
+ RT_ASSERT(result == RT_EOK);
+
+ /* Create a 4MB RAMDISK */
+ result = ramdisk_init(RAMDISK_UDC, NULL, 512, 2 * 4096);
+ RT_ASSERT(result == RT_EOK);
+
+ return 0;
+}
+INIT_DEVICE_EXPORT(ramdisk_device_init);
+
+/* Recursive mkdir */
+static int mkdir_p(const char *dir, const mode_t mode)
+{
+ int ret = -1;
+ char *tmp = NULL;
+ char *p = NULL;
+ struct stat sb;
+ rt_size_t len;
+
+ if (!dir)
+ goto exit_mkdir_p;
+
+ /* Copy path */
+ /* Get the string length */
+ len = strlen(dir);
+ tmp = rt_strdup(dir);
+
+ /* Remove trailing slash */
+ if (tmp[len - 1] == '/')
+ {
+ tmp[len - 1] = '\0';
+ len--;
+ }
+
+ /* check if path exists and is a directory */
+ if (stat(tmp, &sb) == 0)
+ {
+ if (S_ISDIR(sb.st_mode))
+ {
+ ret = 0;
+ goto exit_mkdir_p;
+ }
+ }
+
+ /* Recursive mkdir */
+ for (p = tmp + 1; p - tmp <= len; p++)
+ {
+ if ((*p == '/') || (p - tmp == len))
+ {
+ *p = 0;
+
+ /* Test path */
+ if (stat(tmp, &sb) != 0)
+ {
+ /* Path does not exist - create directory */
+ if (mkdir(tmp, mode) < 0)
+ {
+ goto exit_mkdir_p;
+ }
+ }
+ else if (!S_ISDIR(sb.st_mode))
+ {
+ /* Not a directory */
+ goto exit_mkdir_p;
+ }
+ if (p - tmp != len)
+ *p = '/';
+ }
+ }
+
+ ret = 0;
+
+exit_mkdir_p:
+
+ if (tmp)
+ rt_free(tmp);
+
+ return ret;
+}
+
+/* Initialize the filesystem */
+int filesystem_init(void)
+{
+ rt_err_t result = RT_EOK;
+
+ // ramdisk as root
+ if (!rt_device_find(RAMDISK_NAME))
+ {
+ LOG_E("cannot find %s device", RAMDISK_NAME);
+ goto exit_filesystem_init;
+ }
+ else
+ {
+ /* Format these ramdisk */
+ result = (rt_err_t)dfs_mkfs("elm", RAMDISK_NAME);
+ RT_ASSERT(result == RT_EOK);
+
+ /* mount ramdisk0 as root directory */
+ if (dfs_mount(RAMDISK_NAME, "/", "elm", 0, RT_NULL) == 0)
+ {
+ LOG_I("ramdisk mounted on \"/\".");
+
+ /* now you can create dir dynamically. */
+ mkdir_p("/mnt", 0x777);
+ mkdir_p("/cache", 0x777);
+ mkdir_p("/download", 0x777);
+ mkdir_p("/mnt/ram_usbd", 0x777);
+ mkdir_p("/mnt/filesystem", 0x777);
+#if defined(RT_USBH_MSTORAGE) && defined(UDISK_MOUNTPOINT)
+ mkdir_p(UDISK_MOUNTPOINT, 0x777);
+#endif
+ }
+ else
+ {
+ LOG_E("root folder creation failed!\n");
+ goto exit_filesystem_init;
+ }
+ }
+
+ if (!rt_device_find(RAMDISK_UDC))
+ {
+ LOG_E("cannot find %s device", RAMDISK_UDC);
+ goto exit_filesystem_init;
+ }
+ else
+ {
+ /* Format these ramdisk */
+ result = (rt_err_t)dfs_mkfs("elm", RAMDISK_UDC);
+ RT_ASSERT(result == RT_EOK);
+ }
+
+exit_filesystem_init:
+
+ return -result;
+}
+INIT_ENV_EXPORT(filesystem_init);
+#endif
+
+#if defined(BOARD_USING_STORAGE_SPIFLASH)
+int mnt_init_spiflash0(void)
+{
+#if defined(PKG_USING_FAL)
+ extern int fal_init_check(void);
+ if (!fal_init_check())
+ fal_init();
+#endif
+ struct rt_device *psNorFlash = fal_blk_device_create(PARTITION_NAME_FILESYSTEM);
+ if (!psNorFlash)
+ {
+ rt_kprintf("Failed to create block device for %s.\n", PARTITION_NAME_FILESYSTEM);
+ goto exit_mnt_init_spiflash0;
+ }
+ else if (dfs_mount(psNorFlash->parent.name, MOUNT_POINT_SPIFLASH0, "elm", 0, 0) != 0)
+ {
+ rt_kprintf("Failed to mount elm on %s.\n", MOUNT_POINT_SPIFLASH0);
+ rt_kprintf("Try to execute 'mkfs -t elm %s' first, then reboot.\n", PARTITION_NAME_FILESYSTEM);
+ goto exit_mnt_init_spiflash0;
+ }
+ rt_kprintf("mount %s with elmfat type: ok\n", PARTITION_NAME_FILESYSTEM);
+
+exit_mnt_init_spiflash0:
+
+ return 0;
+}
+INIT_ENV_EXPORT(mnt_init_spiflash0);
+#endif
+
diff --git a/bsp/nuvoton/nk-rtu980/board/Kconfig b/bsp/nuvoton/nk-rtu980/board/Kconfig
new file mode 100644
index 0000000000..2682f8b89f
--- /dev/null
+++ b/bsp/nuvoton/nk-rtu980/board/Kconfig
@@ -0,0 +1,48 @@
+menu "Hardware Drivers Config"
+
+ menu "On-chip Peripheral Drivers"
+ source "$BSP_DIR/../libraries/nuc980/rtt_port/Kconfig"
+ endmenu
+
+ menu "On-board Peripheral Drivers"
+
+ config BSP_USING_CONSOLE
+ bool "Enable UART0 for RTT Console(uart0)"
+ select BSP_USING_UART
+ select BSP_USING_UART0
+ default y
+
+ config BOARD_USING_UART8_RS485
+ bool "Enable UART8 for RS485(AUD) communication(uart8)"
+ select BSP_USING_UART
+ select BSP_USING_UART8
+ default y
+
+ config BOARD_USING_STORAGE_SPIFLASH
+ bool "SPI NOR FLASH supporting(over qspi0)"
+ select BSP_USING_QSPI
+ select BSP_USING_QSPI0
+ default y
+
+ config BOARD_USING_USB0_DEVICE_HOST
+ select BSP_USING_USBH
+ select BSP_USING_USBD
+ bool "Enable USB0 Device/Host"
+ help
+ Choose this option if you need USB device or host function mode.
+ If you need USB host, please remember short to ground on JP1 jumper.
+
+ endmenu
+
+ menu "Board extended module drivers"
+
+ config BOARD_USING_IP101GR
+ bool "Enable ethernet phy supporting(over emac/mdio)"
+ select BSP_USING_EMAC
+ select BSP_USING_EMAC1
+ default n
+
+ endmenu
+
+
+endmenu
diff --git a/bsp/nuvoton/nk-rtu980/board/SConscript b/bsp/nuvoton/nk-rtu980/board/SConscript
new file mode 100644
index 0000000000..3f8e1c167f
--- /dev/null
+++ b/bsp/nuvoton/nk-rtu980/board/SConscript
@@ -0,0 +1,14 @@
+# RT-Thread building script for component
+
+from building import *
+
+
+Import('RTT_ROOT')
+from building import *
+
+cwd = GetCurrentDir()
+src = Glob('*.c') + Glob('*.cpp')
+CPPPATH = [ cwd ]
+
+group = DefineGroup('board', src, depend = [''], CPPPATH = CPPPATH)
+Return('group')
diff --git a/bsp/nuvoton/nk-rtu980/board/board.h b/bsp/nuvoton/nk-rtu980/board/board.h
new file mode 100644
index 0000000000..d361487629
--- /dev/null
+++ b/bsp/nuvoton/nk-rtu980/board/board.h
@@ -0,0 +1,43 @@
+/**************************************************************************//**
+*
+* @copyright (C) 2019 Nuvoton Technology Corp. All rights reserved.
+*
+* SPDX-License-Identifier: Apache-2.0
+*
+* Change Logs:
+* Date Author Notes
+* 2020-1-16 Wayne First version
+*
+******************************************************************************/
+
+#ifndef __BOARD_H__
+#define __BOARD_H__
+
+#include "NuMicro.h"
+#include "drv_sys.h"
+
+#if defined(__CC_ARM)
+ extern int Image$$RW_RAM1$$ZI$$Limit;
+ #define BOARD_HEAP_START (void*)&Image$$RW_RAM1$$ZI$$Limit
+#else
+ extern int __bss_end;
+ #define BOARD_HEAP_START ((void *)&__bss_end)
+#endif
+
+#define BOARD_SDRAM_START 0x0
+#define BOARD_SDRAM_SIZE 0x04000000
+#define BOARD_HEAP_END ((void*)BOARD_SDRAM_SIZE)
+
+#if defined(RT_USING_MTD_NAND)
+ #include <drivers/mtd_nand.h>
+ #define MTD_SPINAND_PARTITION_NUM 3
+ extern struct rt_mtd_nand_device mtd_partitions[MTD_SPINAND_PARTITION_NUM];
+#endif
+
+extern void rt_hw_board_init(void);
+extern void nu_clock_init(void);
+extern void nu_clock_deinit(void);
+extern void nu_pin_init(void);
+extern void nu_pin_deinit(void);
+
+#endif /* BOARD_H_ */
diff --git a/bsp/nuvoton/nk-rtu980/board/board_dev.c b/bsp/nuvoton/nk-rtu980/board/board_dev.c
new file mode 100644
index 0000000000..0086fe4595
--- /dev/null
+++ b/bsp/nuvoton/nk-rtu980/board/board_dev.c
@@ -0,0 +1,236 @@
+/**************************************************************************//**
+*
+* @copyright (C) 2019 Nuvoton Technology Corp. All rights reserved.
+*
+* SPDX-License-Identifier: Apache-2.0
+*
+* Change Logs:
+* Date Author Notes
+* 2020-12-12 Wayne First version
+*
+******************************************************************************/
+
+#include <rtconfig.h>
+#include <rtdevice.h>
+
+#if defined(BOARD_USING_STORAGE_SPIFLASH)
+#if defined(RT_USING_SFUD)
+ #include "spi_flash.h"
+ #include "spi_flash_sfud.h"
+#endif
+
+#include "drv_qspi.h"
+
+#define W25X_REG_READSTATUS (0x05)
+#define W25X_REG_READSTATUS2 (0x35)
+#define W25X_REG_WRITEENABLE (0x06)
+#define W25X_REG_WRITESTATUS (0x01)
+#define W25X_REG_QUADENABLE (0x02)
+
+static rt_uint8_t SpiFlash_ReadStatusReg(struct rt_qspi_device *qspi_device)
+{
+ rt_uint8_t u8Val;
+ rt_err_t result = RT_EOK;
+ rt_uint8_t w25x_txCMD1 = W25X_REG_READSTATUS;
+
+ result = rt_qspi_send_then_recv(qspi_device, &w25x_txCMD1, 1, &u8Val, 1);
+ RT_ASSERT(result > 0);
+
+ return u8Val;
+}
+
+static rt_uint8_t SpiFlash_ReadStatusReg2(struct rt_qspi_device *qspi_device)
+{
+ rt_uint8_t u8Val;
+ rt_err_t result = RT_EOK;
+ rt_uint8_t w25x_txCMD1 = W25X_REG_READSTATUS2;
+
+ result = rt_qspi_send_then_recv(qspi_device, &w25x_txCMD1, 1, &u8Val, 1);
+ RT_ASSERT(result > 0);
+
+ return u8Val;
+}
+
+static rt_err_t SpiFlash_WriteStatusReg(struct rt_qspi_device *qspi_device, uint8_t u8Value1, uint8_t u8Value2)
+{
+ rt_uint8_t w25x_txCMD1;
+ rt_uint8_t au8Val[2];
+ rt_err_t result;
+ struct rt_qspi_message qspi_message = {0};
+
+ /* Enable WE */
+ w25x_txCMD1 = W25X_REG_WRITEENABLE;
+ result = rt_qspi_send(qspi_device, &w25x_txCMD1, sizeof(w25x_txCMD1));
+ if (result != sizeof(w25x_txCMD1))
+ goto exit_SpiFlash_WriteStatusReg;
+
+ /* Prepare status-1, 2 data */
+ au8Val[0] = u8Value1;
+ au8Val[1] = u8Value2;
+
+ /* 1-bit mode: Instruction+payload */
+ qspi_message.instruction.content = W25X_REG_WRITESTATUS;
+ qspi_message.instruction.qspi_lines = 1;
+
+ qspi_message.qspi_data_lines = 1;
+ qspi_message.parent.cs_take = 1;
+ qspi_message.parent.cs_release = 1;
+ qspi_message.parent.send_buf = &au8Val[0];
+ qspi_message.parent.length = sizeof(au8Val);
+ qspi_message.parent.next = RT_NULL;
+
+ if (rt_qspi_transfer_message(qspi_device, &qspi_message) != sizeof(au8Val))
+ {
+ result = -RT_ERROR;
+ }
+
+ result = RT_EOK;
+
+exit_SpiFlash_WriteStatusReg:
+
+ return result;
+}
+
+static void SpiFlash_WaitReady(struct rt_qspi_device *qspi_device)
+{
+ volatile uint8_t u8ReturnValue;
+
+ do
+ {
+ u8ReturnValue = SpiFlash_ReadStatusReg(qspi_device);
+ u8ReturnValue = u8ReturnValue & 1;
+ }
+ while (u8ReturnValue != 0); // check the BUSY bit
+}
+
+static void SpiFlash_EnterQspiMode(struct rt_qspi_device *qspi_device)
+{
+ rt_err_t result = RT_EOK;
+
+ uint8_t u8Status1 = SpiFlash_ReadStatusReg(qspi_device);
+ uint8_t u8Status2 = SpiFlash_ReadStatusReg2(qspi_device);
+
+ u8Status2 |= W25X_REG_QUADENABLE;
+
+ result = SpiFlash_WriteStatusReg(qspi_device, u8Status1, u8Status2);
+ RT_ASSERT(result == RT_EOK);
+
+ SpiFlash_WaitReady(qspi_device);
+}
+
+static void SpiFlash_ExitQspiMode(struct rt_qspi_device *qspi_device)
+{
+ rt_err_t result = RT_EOK;
+ uint8_t u8Status1 = SpiFlash_ReadStatusReg(qspi_device);
+ uint8_t u8Status2 = SpiFlash_ReadStatusReg2(qspi_device);
+
+ u8Status2 &= ~W25X_REG_QUADENABLE;
+
+ result = SpiFlash_WriteStatusReg(qspi_device, u8Status1, u8Status2);
+ RT_ASSERT(result == RT_EOK);
+
+ SpiFlash_WaitReady(qspi_device);
+}
+
+static int rt_hw_spiflash_init(void)
+{
+ if (nu_qspi_bus_attach_device("qspi0", "qspi01", 2, SpiFlash_EnterQspiMode, SpiFlash_ExitQspiMode) != RT_EOK)
+ return -1;
+
+#if defined(RT_USING_SFUD)
+ if (rt_sfud_flash_probe(FAL_USING_NOR_FLASH_DEV_NAME, "qspi01") == RT_NULL)
+ {
+ return -(RT_ERROR);
+ }
+#endif
+ return 0;
+}
+INIT_COMPONENT_EXPORT(rt_hw_spiflash_init);
+#endif
+
+#if defined(BOARD_USING_STORAGE_SPINAND) && defined(NU_PKG_USING_SPINAND)
+
+#include "drv_qspi.h"
+#include "spinand.h"
+
+struct rt_mtd_nand_device mtd_partitions[MTD_SPINAND_PARTITION_NUM] =
+{
+ [0] =
+ {
+ .block_start = 0,
+ .block_end = 23,
+ .block_total = 24,
+ },
+ [1] =
+ {
+ .block_start = 24,
+ .block_end = 1023,
+ .block_total = 1000,
+ },
+ [2] =
+ {
+ .block_start = 0,
+ .block_end = 1023,
+ .block_total = 1024,
+ }
+};
+
+static int rt_hw_spinand_init(void)
+{
+ if (nu_qspi_bus_attach_device("qspi0", "qspi01", 4, RT_NULL, RT_NULL) != RT_EOK)
+ return -1;
+
+ if (rt_hw_mtd_spinand_register("qspi01") != RT_EOK)
+ return -1;
+
+ return 0;
+}
+
+INIT_COMPONENT_EXPORT(rt_hw_spinand_init);
+#endif
+
+#if defined(BOARD_USING_UART8_RS485)
+
+#include <drv_uart.h>
+
+#define NU_UART_DEVNAME "uart8"
+
+int test_rs485(int argc, char **argv)
+{
+ rt_device_t serial;
+ char txbuf[16];
+ rt_err_t ret;
+ int str_len;
+
+ serial = rt_device_find(NU_UART_DEVNAME);
+ if (!serial)
+ {
+ rt_kprintf("Can't find %s. EXIT.\n", NU_UART_DEVNAME);
+ goto exit_test_rs485;
+ }
+
+ /* Interrupt RX */
+ ret = rt_device_open(serial, RT_DEVICE_FLAG_INT_RX);
+ RT_ASSERT(ret == RT_EOK);
+
+ /* Nuvoton private command */
+ nu_uart_set_rs485aud((struct rt_serial_device *)serial, RT_FALSE);
+
+ rt_snprintf(&txbuf[0], sizeof(txbuf), "Hello World!\r\n");
+ str_len = rt_strlen(txbuf);
+
+ /* Say Hello */
+ ret = rt_device_write(serial, 0, &txbuf[0], str_len);
+ RT_ASSERT(ret == str_len);
+
+ ret = rt_device_close(serial);
+ RT_ASSERT(ret == RT_EOK);
+
+exit_test_rs485:
+
+ return 0;
+}
+MSH_CMD_EXPORT(test_rs485, test rs485 communication);
+
+#endif //defined(BOARD_USING_UART8_RS485)
+
diff --git a/bsp/nuvoton/nk-rtu980/board/fal_cfg.h b/bsp/nuvoton/nk-rtu980/board/fal_cfg.h
new file mode 100644
index 0000000000..99ee81b405
--- /dev/null
+++ b/bsp/nuvoton/nk-rtu980/board/fal_cfg.h
@@ -0,0 +1,46 @@
+/**************************************************************************//**
+*
+* @copyright (C) 2020 Nuvoton Technology Corp. All rights reserved.
+*
+* SPDX-License-Identifier: Apache-2.0
+*
+* Change Logs:
+* Date Author Notes
+* 2020-3-03 FYChou First version
+*
+******************************************************************************/
+
+#ifndef _FAL_CFG_H_
+#define _FAL_CFG_H_
+
+#include <rtconfig.h>
+#include <board.h>
+
+/* ===================== Flash device Configuration ========================= */
+#if defined(RT_USING_SFUD)
+extern struct fal_flash_dev nor_flash0;
+
+/* -flash device table------------------------------------------------------- */
+#define FAL_FLASH_DEV_TABLE \
+{ \
+ &nor_flash0, \
+}
+#else
+#define FAL_FLASH_DEV_TABLE \
+{ \
+ 0 \
+}
+#endif
+
+/* ====================== Partition Configuration ============================ */
+#ifdef FAL_PART_HAS_TABLE_CFG
+
+/* partition table------------------------------------------------------------ */
+#define FAL_PART_TABLE \
+{ \
+ {FAL_PART_MAGIC_WORD, "rtthread", FAL_USING_NOR_FLASH_DEV_NAME, 0, 4*1024*1024, 0}, \
+ {FAL_PART_MAGIC_WORD, "filesystem", FAL_USING_NOR_FLASH_DEV_NAME, 4*1024*1024, 28*1024*1024, 0}, \
+}
+#endif /* FAL_PART_HAS_TABLE_CFG */
+
+#endif /* _FAL_CFG_H_ */
diff --git a/bsp/nuvoton/nk-rtu980/board/nu_pin_init.c b/bsp/nuvoton/nk-rtu980/board/nu_pin_init.c
new file mode 100644
index 0000000000..af36b98ccd
--- /dev/null
+++ b/bsp/nuvoton/nk-rtu980/board/nu_pin_init.c
@@ -0,0 +1,85 @@
+/**************************************************************************//**
+*
+* @copyright (C) 2019 Nuvoton Technology Corp. All rights reserved.
+*
+* SPDX-License-Identifier: Apache-2.0
+*
+* Change Logs:
+* Date Author Notes
+* 2020-12-12 Wayne First version
+*
+******************************************************************************/
+
+#include "board.h"
+
+static void nu_pin_uart_init(void)
+{
+ /* UART0: GPF11, GPF12 */
+ outpw(REG_SYS_GPF_MFPH, (inpw(REG_SYS_GPF_MFPH) & 0xFFF00FFF) | 0x00011000);
+
+ /* UART4: GPC9, GPC10 */
+ outpw(REG_SYS_GPC_MFPH, (inpw(REG_SYS_GPC_MFPH) & 0xFFFFF00F) | 0x00000770);
+
+ /* UART8: GPC12, GPC13, GPC14 */
+ outpw(REG_SYS_GPC_MFPH, (inpw(REG_SYS_GPC_MFPH) & 0xF000FFFF) | 0x07770000);
+}
+
+static void nu_pin_emac_init(void)
+{
+ /* EMAC1 */
+ outpw(REG_SYS_GPF_MFPL, 0x11111111);
+ outpw(REG_SYS_GPF_MFPH, (inpw(REG_SYS_GPF_MFPH) & 0xFFFFFF00) | 0x00000011);
+}
+
+static void nu_pin_qspi_init(void)
+{
+ /* QSPI0: PD[2, 5] */
+ outpw(REG_SYS_GPD_MFPL, (inpw(REG_SYS_GPD_MFPL) & 0xFF0000FF) | 0x00111100);
+}
+
+static void nu_pin_spi_init(void)
+{
+ /* SPI0: PC[4, 8] */
+ outpw(REG_SYS_GPC_MFPL, (inpw(REG_SYS_GPC_MFPL) & 0xF000FFFF) | 0x05560000);
+ outpw(REG_SYS_GPC_MFPH, (inpw(REG_SYS_GPC_MFPH) & 0xFFFFFFF0) | 0x00000005);
+}
+
+static void nu_pin_i2c_init(void)
+{
+ /* I2C1: PB4, PB6 */
+ outpw(REG_SYS_GPB_MFPL, (inpw(REG_SYS_GPB_MFPL) & 0xF0F0FFFF) | 0x02020000);
+}
+
+static void nu_pin_can_init(void)
+{
+ /* CAN3: PA0, PA1 */
+ outpw(REG_SYS_GPA_MFPL, (inpw(REG_SYS_GPA_MFPL) & 0xFFFFFF00) | 0x00000077);
+}
+
+static void nu_pin_usbd_init(void)
+{
+ /* USB0_VBUSVLD, PE.11 */
+ outpw(REG_SYS_GPE_MFPH, (inpw(REG_SYS_GPE_MFPH) & 0xFFFF0FFF) | 0x00001000);
+}
+
+static void nu_pin_usbh_init(void)
+{
+}
+
+void nu_pin_init(void)
+{
+ nu_pin_uart_init();
+ nu_pin_emac_init();
+ nu_pin_qspi_init();
+ nu_pin_spi_init();
+ nu_pin_i2c_init();
+ nu_pin_can_init();
+
+ nu_pin_usbd_init();
+ nu_pin_usbh_init();
+}
+
+void nu_pin_deinit(void)
+{
+
+}
diff --git a/bsp/nuvoton/nk-rtu980/linking_scripts/nuc980.ld b/bsp/nuvoton/nk-rtu980/linking_scripts/nuc980.ld
new file mode 100644
index 0000000000..1004f039fb
--- /dev/null
+++ b/bsp/nuvoton/nk-rtu980/linking_scripts/nuc980.ld
@@ -0,0 +1,114 @@
+OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
+OUTPUT_ARCH(arm)
+ENTRY(system_vectors)
+
+MEMORY
+{
+ RAM (rwx) : ORIGIN = 0x000000, LENGTH = 0x04000000
+}
+
+SECTIONS
+{
+ . = 0x0;
+
+ . = ALIGN(4);
+ .text :
+ {
+ *(.vectors)
+ *(.text)
+ *(.gnu.linkonce.t*)
+
+ /* section information for finsh shell */
+ . = ALIGN(4);
+ __fsymtab_start = .;
+ KEEP(*(FSymTab))
+ __fsymtab_end = .;
+ . = ALIGN(4);
+ __vsymtab_start = .;
+ KEEP(*(VSymTab))
+ __vsymtab_end = .;
+ . = ALIGN(4);
+
+ . = ALIGN(4);
+ __rt_init_start = .;
+ KEEP(*(SORT(.rti_fn*)))
+ __rt_init_end = .;
+ . = ALIGN(4);
+
+ /* section information for modules */
+ . = ALIGN(4);
+ __rtmsymtab_start = .;
+ KEEP(*(RTMSymTab))
+ __rtmsymtab_end = .;
+ . = ALIGN(4);
+
+ /* section information for initial. */
+ . = ALIGN(4);
+ __rt_init_start = .;
+ KEEP(*(SORT(.rti_fn*)))
+ __rt_init_end = .;
+ . = ALIGN(4);
+
+ /* section information for utest */
+ . = ALIGN(4);
+ __rt_utest_tc_tab_start = .;
+ KEEP(*(UtestTcTab))
+ __rt_utest_tc_tab_end = .;
+ }
+
+ . = ALIGN(4);
+ .rodata : { *(.rodata) *(.rodata.*) *(.gnu.linkonce.r*) *(.eh_frame) }
+
+ . = ALIGN(4);
+ .ctors :
+ {
+ PROVIDE(__ctors_start__ = .);
+ KEEP(*(SORT(.ctors.*)))
+ KEEP(*(.ctors))
+ PROVIDE(__ctors_end__ = .);
+ }
+
+ .dtors :
+ {
+ PROVIDE(__dtors_start__ = .);
+ KEEP(*(SORT(.dtors.*)))
+ KEEP(*(.dtors))
+ PROVIDE(__dtors_end__ = .);
+ }
+
+ . = ALIGN(4);
+ .data :
+ {
+ *(.data)
+ *(.data.*)
+ *(.gnu.linkonce.d*)
+ }
+
+ . = ALIGN(4);
+ .nobss : { *(.nobss) }
+
+ . = ALIGN(4);
+ __bss_start__ = .;
+ __bss_start = .;
+ .bss : { *(.bss)}
+ . = ALIGN(4);
+ __bss_end = .;
+ __bss_end__ = .;
+ . = ALIGN(4);
+
+ /* stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+ .stab.excl 0 : { *(.stab.excl) }
+ .stab.exclstr 0 : { *(.stab.exclstr) }
+ .stab.index 0 : { *(.stab.index) }
+ .stab.indexstr 0 : { *(.stab.indexstr) }
+ .comment 0 : { *(.comment) }
+ .debug_abbrev 0 : { *(.debug_abbrev) }
+ .debug_info 0 : { *(.debug_info) }
+ .debug_line 0 : { *(.debug_line) }
+ .debug_pubnames 0 : { *(.debug_pubnames) }
+ .debug_aranges 0 : { *(.debug_aranges) }
+
+ _end = .;
+}
diff --git a/bsp/nuvoton/nk-rtu980/linking_scripts/nuc980.sct b/bsp/nuvoton/nk-rtu980/linking_scripts/nuc980.sct
new file mode 100644
index 0000000000..114b346e8c
--- /dev/null
+++ b/bsp/nuvoton/nk-rtu980/linking_scripts/nuc980.sct
@@ -0,0 +1,11 @@
+LR_IROM1 0x00000000 0x800000 { ; load region size_region
+ ER_IROM1 0x00000000 0x800000 { ; load address = execution address
+ *.o (RESET, +First)
+ *(InRoot$$Sections)
+ .ANY (+RO)
+ }
+ RW_RAM1 +0 { ; RW_RAM1 start address is after ER_ROM1
+ .ANY (+RW +ZI)
+ }
+}
+
diff --git a/bsp/nuvoton/nk-rtu980/rtconfig.py b/bsp/nuvoton/nk-rtu980/rtconfig.py
new file mode 100644
index 0000000000..c246b656ad
--- /dev/null
+++ b/bsp/nuvoton/nk-rtu980/rtconfig.py
@@ -0,0 +1,88 @@
+import os
+# toolchains options
+ARCH = 'arm'
+CPU = 'arm926'
+# toolchains options
+CROSS_TOOL = 'gcc'
+
+#------- toolchains path -------------------------------------------------------
+if os.getenv('RTT_CC'):
+ CROSS_TOOL = os.getenv('RTT_CC')
+
+if CROSS_TOOL == 'gcc':
+ PLATFORM = 'gcc'
+ EXEC_PATH = r'C:\Program Files (x86)\GNU Tools ARM Embedded\6 2017-q1-update\bin'
+elif CROSS_TOOL == 'keil':
+ PLATFORM = 'armcc'
+ EXEC_PATH = r'C:\Keil_v5'
+
+if os.getenv('RTT_EXEC_PATH'):
+ EXEC_PATH = os.getenv('RTT_EXEC_PATH')
+
+BUILD = 'debug'
+#BUILD = 'release'
+
+CORE = 'arm926ej-s'
+MAP_FILE = 'rtthread_nuc980.map'
+LINK_FILE = 'linking_scripts/nuc980'
+TARGET_NAME = 'rtthread.bin'
+
+#------- GCC settings ----------------------------------------------------------
+if PLATFORM == 'gcc':
+ # toolchains
+ PREFIX = 'arm-none-eabi-'
+ CC = PREFIX + 'gcc'
+ CXX = PREFIX + 'g++'
+ AS = PREFIX + 'gcc'
+ AR = PREFIX + 'ar'
+ LINK = PREFIX + 'gcc'
+ TARGET_EXT = 'elf'
+ SIZE = PREFIX + 'size'
+ OBJDUMP = PREFIX + 'objdump'
+ OBJCPY = PREFIX + 'objcopy'
+
+ DEVICE = ' -mcpu=arm926ej-s'
+ CFLAGS = DEVICE
+ AFLAGS = '-c'+ DEVICE + ' -x assembler-with-cpp'
+ AFLAGS += ' -Iplatform'
+ LFLAGS = DEVICE
+ LFLAGS += ' -Wl,--gc-sections,-cref,-Map=' + MAP_FILE
+ LFLAGS += ' -T ' + LINK_FILE + '.ld'
+
+ CPATH = ''
+ LPATH = ''
+
+ if BUILD == 'debug':
+ CFLAGS += ' -O2 -gdwarf-2'
+ AFLAGS += ' -gdwarf-2'
+ else:
+ CFLAGS += ' -O2'
+
+ POST_ACTION = OBJCPY + ' -O binary $TARGET ' + TARGET_NAME + '\n'
+ POST_ACTION += SIZE + ' $TARGET\n'
+#------- Keil settings ---------------------------------------------------------
+elif PLATFORM == 'armcc':
+ # toolchains
+ CC = 'armcc'
+ AS = 'armasm'
+ AR = 'armar'
+ LINK = 'armlink'
+ TARGET_EXT = 'axf'
+ EXEC_PATH += '/arm/armcc/bin/'
+
+ DEVICE = ' --cpu=' + CORE
+ CFLAGS = DEVICE + ' --apcs=interwork --diag_suppress=870'
+ AFLAGS = DEVICE + ' -Iplatform'
+ LFLAGS = DEVICE + ' --strict'
+ LFLAGS += ' --info sizes --info totals --info unused --info veneers'
+ LFLAGS += ' --list ' + MAP_FILE
+ LFLAGS += ' --scatter ' + LINK_FILE + '.sct'
+
+ if BUILD == 'debug':
+ CFLAGS += ' -g -O0'
+ AFLAGS += ' -g'
+ else:
+ CFLAGS += ' -O2'
+
+ POST_ACTION = 'fromelf --bin $TARGET --output ' + TARGET_NAME + ' \n'
+ POST_ACTION += 'fromelf -z $TARGET\n' \ No newline at end of file
diff --git a/bsp/nuvoton/nk-rtu980/template.uvproj b/bsp/nuvoton/nk-rtu980/template.uvproj
new file mode 100644
index 0000000000..23e8dd2bcb
--- /dev/null
+++ b/bsp/nuvoton/nk-rtu980/template.uvproj
@@ -0,0 +1,394 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
+<Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_proj.xsd">
+
+ <SchemaVersion>1.1</SchemaVersion>
+
+ <Header>### uVision Project, (C) Keil Software</Header>
+
+ <Targets>
+ <Target>
+ <TargetName>rtthread</TargetName>
+ <ToolsetNumber>0x4</ToolsetNumber>
+ <ToolsetName>ARM-ADS</ToolsetName>
+ <TargetOption>
+ <TargetCommonOption>
+ <Device>Nuvoton_ARM9_Series</Device>
+ <Vendor>Nuvoton</Vendor>
+ <Cpu></Cpu>
+ <FlashUtilSpec></FlashUtilSpec>
+ <StartupFile></StartupFile>
+ <FlashDriverDll></FlashDriverDll>
+ <DeviceId>0</DeviceId>
+ <RegisterFile></RegisterFile>
+ <MemoryEnv></MemoryEnv>
+ <Cmp></Cmp>
+ <Asm></Asm>
+ <Linker></Linker>
+ <OHString></OHString>
+ <InfinionOptionDll></InfinionOptionDll>
+ <SLE66CMisc></SLE66CMisc>
+ <SLE66AMisc></SLE66AMisc>
+ <SLE66LinkerMisc></SLE66LinkerMisc>
+ <SFDFile></SFDFile>
+ <UseEnv>0</UseEnv>
+ <BinPath></BinPath>
+ <IncludePath></IncludePath>
+ <LibPath></LibPath>
+ <RegisterFilePath>Atmel\SAM9260\</RegisterFilePath>
+ <DBRegisterFilePath>Atmel\SAM9260\</DBRegisterFilePath>
+ <TargetStatus>
+ <Error>0</Error>
+ <ExitCodeStop>0</ExitCodeStop>
+ <ButtonStop>0</ButtonStop>
+ <NotGenerated>0</NotGenerated>
+ <InvalidFlash>1</InvalidFlash>
+ </TargetStatus>
+ <OutputDirectory>.\Objects\</OutputDirectory>
+ <OutputName>rtthread</OutputName>
+ <CreateExecutable>1</CreateExecutable>
+ <CreateLib>0</CreateLib>
+ <CreateHexFile>0</CreateHexFile>
+ <DebugInformation>1</DebugInformation>
+ <BrowseInformation>1</BrowseInformation>
+ <ListingPath>.\Listings\</ListingPath>
+ <HexFormatSelection>1</HexFormatSelection>
+ <Merge32K>0</Merge32K>
+ <CreateBatchFile>0</CreateBatchFile>
+ <BeforeCompile>
+ <RunUserProg1>0</RunUserProg1>
+ <RunUserProg2>0</RunUserProg2>
+ <UserProg1Name></UserProg1Name>
+ <UserProg2Name></UserProg2Name>
+ <UserProg1Dos16Mode>0</UserProg1Dos16Mode>
+ <UserProg2Dos16Mode>0</UserProg2Dos16Mode>
+ <nStopU1X>0</nStopU1X>
+ <nStopU2X>0</nStopU2X>
+ </BeforeCompile>
+ <BeforeMake>
+ <RunUserProg1>0</RunUserProg1>
+ <RunUserProg2>0</RunUserProg2>
+ <UserProg1Name></UserProg1Name>
+ <UserProg2Name></UserProg2Name>
+ <UserProg1Dos16Mode>0</UserProg1Dos16Mode>
+ <UserProg2Dos16Mode>0</UserProg2Dos16Mode>
+ </BeforeMake>
+ <AfterMake>
+ <RunUserProg1>0</RunUserProg1>
+ <RunUserProg2>0</RunUserProg2>
+ <UserProg1Name></UserProg1Name>
+ <UserProg2Name></UserProg2Name>
+ <UserProg1Dos16Mode>0</UserProg1Dos16Mode>
+ <UserProg2Dos16Mode>0</UserProg2Dos16Mode>
+ </AfterMake>
+ <SelectedForBatchBuild>0</SelectedForBatchBuild>
+ <SVCSIdString></SVCSIdString>
+ </TargetCommonOption>
+ <CommonProperty>
+ <UseCPPCompiler>0</UseCPPCompiler>
+ <RVCTCodeConst>0</RVCTCodeConst>
+ <RVCTZI>0</RVCTZI>
+ <RVCTOtherData>0</RVCTOtherData>
+ <ModuleSelection>0</ModuleSelection>
+ <IncludeInBuild>1</IncludeInBuild>
+ <AlwaysBuild>0</AlwaysBuild>
+ <GenerateAssemblyFile>0</GenerateAssemblyFile>
+ <AssembleAssemblyFile>0</AssembleAssemblyFile>
+ <PublicsOnly>0</PublicsOnly>
+ <StopOnExitCode>3</StopOnExitCode>
+ <CustomArgument></CustomArgument>
+ <IncludeLibraryModules></IncludeLibraryModules>
+ </CommonProperty>
+ <DllOption>
+ <SimDllName>SARM.DLL</SimDllName>
+ <SimDllArguments>-cAT91SAM9</SimDllArguments>
+ <SimDlgDll>DARMATS9.DLL</SimDlgDll>
+ <SimDlgDllArguments>-p91SAM9260</SimDlgDllArguments>
+ <TargetDllName>SARM.DLL</TargetDllName>
+ <TargetDllArguments></TargetDllArguments>
+ <TargetDlgDll>TARMATS9.DLL</TargetDlgDll>
+ <TargetDlgDllArguments>-p91SAM9260</TargetDlgDllArguments>
+ </DllOption>
+ <DebugOption>
+ <OPTHX>
+ <HexSelection>1</HexSelection>
+ <HexRangeLowAddress>0</HexRangeLowAddress>
+ <HexRangeHighAddress>0</HexRangeHighAddress>
+ <HexOffset>0</HexOffset>
+ <Oh166RecLen>16</Oh166RecLen>
+ </OPTHX>
+ <Simulator>
+ <UseSimulator>0</UseSimulator>
+ <LoadApplicationAtStartup>1</LoadApplicationAtStartup>
+ <RunToMain>1</RunToMain>
+ <RestoreBreakpoints>1</RestoreBreakpoints>
+ <RestoreWatchpoints>1</RestoreWatchpoints>
+ <RestoreMemoryDisplay>1</RestoreMemoryDisplay>
+ <RestoreFunctions>1</RestoreFunctions>
+ <RestoreToolbox>1</RestoreToolbox>
+ <LimitSpeedToRealTime>0</LimitSpeedToRealTime>
+ </Simulator>
+ <Target>
+ <UseTarget>1</UseTarget>
+ <LoadApplicationAtStartup>0</LoadApplicationAtStartup>
+ <RunToMain>0</RunToMain>
+ <RestoreBreakpoints>1</RestoreBreakpoints>
+ <RestoreWatchpoints>1</RestoreWatchpoints>
+ <RestoreMemoryDisplay>1</RestoreMemoryDisplay>
+ <RestoreFunctions>0</RestoreFunctions>
+ <RestoreToolbox>1</RestoreToolbox>
+ <RestoreTracepoints>1</RestoreTracepoints>
+ </Target>
+ <RunDebugAfterBuild>0</RunDebugAfterBuild>
+ <TargetSelection>6</TargetSelection>
+ <SimDlls>
+ <CpuDll></CpuDll>
+ <CpuDllArguments></CpuDllArguments>
+ <PeripheralDll></PeripheralDll>
+ <PeripheralDllArguments></PeripheralDllArguments>
+ <InitializationFile></InitializationFile>
+ </SimDlls>
+ <TargetDlls>
+ <CpuDll></CpuDll>
+ <CpuDllArguments></CpuDllArguments>
+ <PeripheralDll></PeripheralDll>
+ <PeripheralDllArguments></PeripheralDllArguments>
+ <InitializationFile>..\libraries\nuc980\Script\NUC980xx61.ini</InitializationFile>
+ <Driver>Segger\JLTAgdi.dll</Driver>
+ </TargetDlls>
+ </DebugOption>
+ <Utilities>
+ <Flash1>
+ <UseTargetDll>1</UseTargetDll>
+ <UseExternalTool>0</UseExternalTool>
+ <RunIndependent>0</RunIndependent>
+ <UpdateFlashBeforeDebugging>0</UpdateFlashBeforeDebugging>
+ <Capability>1</Capability>
+ <DriverSelection>4098</DriverSelection>
+ </Flash1>
+ <bUseTDR>0</bUseTDR>
+ <Flash2>Segger\JLTAgdi.dll</Flash2>
+ <Flash3>"" ()</Flash3>
+ <Flash4></Flash4>
+ </Utilities>
+ <TargetArmAds>
+ <ArmAdsMisc>
+ <GenerateListings>0</GenerateListings>
+ <asHll>1</asHll>
+ <asAsm>1</asAsm>
+ <asMacX>1</asMacX>
+ <asSyms>1</asSyms>
+ <asFals>1</asFals>
+ <asDbgD>1</asDbgD>
+ <asForm>1</asForm>
+ <ldLst>0</ldLst>
+ <ldmm>1</ldmm>
+ <ldXref>1</ldXref>
+ <BigEnd>0</BigEnd>
+ <AdsALst>1</AdsALst>
+ <AdsACrf>1</AdsACrf>
+ <AdsANop>0</AdsANop>
+ <AdsANot>0</AdsANot>
+ <AdsLLst>1</AdsLLst>
+ <AdsLmap>1</AdsLmap>
+ <AdsLcgr>1</AdsLcgr>
+ <AdsLsym>1</AdsLsym>
+ <AdsLszi>1</AdsLszi>
+ <AdsLtoi>1</AdsLtoi>
+ <AdsLsun>1</AdsLsun>
+ <AdsLven>1</AdsLven>
+ <AdsLsxf>1</AdsLsxf>
+ <RvctClst>0</RvctClst>
+ <GenPPlst>0</GenPPlst>
+ <AdsCpuType></AdsCpuType>
+ <RvctDeviceName></RvctDeviceName>
+ <mOS>0</mOS>
+ <uocRom>0</uocRom>
+ <uocRam>0</uocRam>
+ <hadIROM>0</hadIROM>
+ <hadIRAM>0</hadIRAM>
+ <hadXRAM>0</hadXRAM>
+ <uocXRam>0</uocXRam>
+ <RvdsVP>0</RvdsVP>
+ <hadIRAM2>0</hadIRAM2>
+ <hadIROM2>0</hadIROM2>
+ <StupSel>0</StupSel>
+ <useUlib>0</useUlib>
+ <EndSel>0</EndSel>
+ <uLtcg>0</uLtcg>
+ <RoSelD>3</RoSelD>
+ <RwSelD>3</RwSelD>
+ <CodeSel>0</CodeSel>
+ <OptFeed>0</OptFeed>
+ <NoZi1>0</NoZi1>
+ <NoZi2>0</NoZi2>
+ <NoZi3>0</NoZi3>
+ <NoZi4>0</NoZi4>
+ <NoZi5>0</NoZi5>
+ <Ro1Chk>0</Ro1Chk>
+ <Ro2Chk>0</Ro2Chk>
+ <Ro3Chk>0</Ro3Chk>
+ <Ir1Chk>0</Ir1Chk>
+ <Ir2Chk>0</Ir2Chk>
+ <Ra1Chk>0</Ra1Chk>
+ <Ra2Chk>0</Ra2Chk>
+ <Ra3Chk>0</Ra3Chk>
+ <Im1Chk>0</Im1Chk>
+ <Im2Chk>0</Im2Chk>
+ <OnChipMemories>
+ <Ocm1>
+ <Type>0</Type>
+ <StartAddress>0x0</StartAddress>
+ <Size>0x0</Size>
+ </Ocm1>
+ <Ocm2>
+ <Type>0</Type>
+ <StartAddress>0x0</StartAddress>
+ <Size>0x0</Size>
+ </Ocm2>
+ <Ocm3>
+ <Type>0</Type>
+ <StartAddress>0x0</StartAddress>
+ <Size>0x0</Size>
+ </Ocm3>
+ <Ocm4>
+ <Type>0</Type>
+ <StartAddress>0x0</StartAddress>
+ <Size>0x0</Size>
+ </Ocm4>
+ <Ocm5>
+ <Type>0</Type>
+ <StartAddress>0x0</StartAddress>
+ <Size>0x0</Size>
+ </Ocm5>
+ <Ocm6>
+ <Type>0</Type>
+ <StartAddress>0x0</StartAddress>
+ <Size>0x0</Size>
+ </Ocm6>
+ <IRAM>
+ <Type>0</Type>
+ <StartAddress>0x200000</StartAddress>
+ <Size>0x1000</Size>
+ </IRAM>
+ <IROM>
+ <Type>1</Type>
+ <StartAddress>0x100000</StartAddress>
+ <Size>0x8000</Size>
+ </IROM>
+ <XRAM>
+ <Type>0</Type>
+ <StartAddress>0x0</StartAddress>
+ <Size>0x0</Size>
+ </XRAM>
+ <OCR_RVCT1>
+ <Type>1</Type>
+ <StartAddress>0x0</StartAddress>
+ <Size>0x0</Size>
+ </OCR_RVCT1>
+ <OCR_RVCT2>
+ <Type>1</Type>
+ <StartAddress>0x0</StartAddress>
+ <Size>0x0</Size>
+ </OCR_RVCT2>
+ <OCR_RVCT3>
+ <Type>1</Type>
+ <StartAddress>0x0</StartAddress>
+ <Size>0x0</Size>
+ </OCR_RVCT3>
+ <OCR_RVCT4>
+ <Type>1</Type>
+ <StartAddress>0x0</StartAddress>
+ <Size>0x0</Size>
+ </OCR_RVCT4>
+ <OCR_RVCT5>
+ <Type>1</Type>
+ <StartAddress>0x0</StartAddress>
+ <Size>0x0</Size>
+ </OCR_RVCT5>
+ <OCR_RVCT6>
+ <Type>0</Type>
+ <StartAddress>0x0</StartAddress>
+ <Size>0x0</Size>
+ </OCR_RVCT6>
+ <OCR_RVCT7>
+ <Type>0</Type>
+ <StartAddress>0x0</StartAddress>
+ <Size>0x0</Size>
+ </OCR_RVCT7>
+ <OCR_RVCT8>
+ <Type>0</Type>
+ <StartAddress>0x0</StartAddress>
+ <Size>0x0</Size>
+ </OCR_RVCT8>
+ <OCR_RVCT9>
+ <Type>0</Type>
+ <StartAddress>0x0</StartAddress>
+ <Size>0x0</Size>
+ </OCR_RVCT9>
+ <OCR_RVCT10>
+ <Type>0</Type>
+ <StartAddress>0x0</StartAddress>
+ <Size>0x0</Size>
+ </OCR_RVCT10>
+ </OnChipMemories>
+ <RvctStartVector></RvctStartVector>
+ </ArmAdsMisc>
+ <Cads>
+ <interw>1</interw>
+ <Optim>3</Optim>
+ <oTime>0</oTime>
+ <SplitLS>0</SplitLS>
+ <OneElfS>0</OneElfS>
+ <Strict>0</Strict>
+ <EnumInt>0</EnumInt>
+ <PlainCh>0</PlainCh>
+ <Ropi>0</Ropi>
+ <Rwpi>0</Rwpi>
+ <wLevel>2</wLevel>
+ <uThumb>0</uThumb>
+ <uSurpInc>0</uSurpInc>
+ <VariousControls>
+ <MiscControls>--c99</MiscControls>
+ <Define>RT_USING_INTERRUPT_INFO</Define>
+ <Undefine></Undefine>
+ <IncludePath></IncludePath>
+ </VariousControls>
+ </Cads>
+ <Aads>
+ <interw>1</interw>
+ <Ropi>0</Ropi>
+ <Rwpi>0</Rwpi>
+ <thumb>0</thumb>
+ <SplitLS>0</SplitLS>
+ <SwStkChk>0</SwStkChk>
+ <NoWarn>0</NoWarn>
+ <uSurpInc>0</uSurpInc>
+ <VariousControls>
+ <MiscControls></MiscControls>
+ <Define></Define>
+ <Undefine></Undefine>
+ <IncludePath></IncludePath>
+ </VariousControls>
+ </Aads>
+ <LDads>
+ <umfTarg>0</umfTarg>
+ <Ropi>0</Ropi>
+ <Rwpi>0</Rwpi>
+ <noStLib>0</noStLib>
+ <RepFail>1</RepFail>
+ <useFile>0</useFile>
+ <TextAddressRange>0x20000000</TextAddressRange>
+ <DataAddressRange>0x20800000</DataAddressRange>
+ <ScatterFile>.\linking_scripts\nuc980.sct</ScatterFile>
+ <IncludeLibs></IncludeLibs>
+ <IncludeLibsPath></IncludeLibsPath>
+ <Misc></Misc>
+ <LinkerInputFile></LinkerInputFile>
+ <DisabledWarnings></DisabledWarnings>
+ </LDads>
+ </TargetArmAds>
+ </TargetOption>
+ </Target>
+ </Targets>
+
+</Project>
diff --git a/bsp/nuvoton/nk-rtu980/template.uvprojx b/bsp/nuvoton/nk-rtu980/template.uvprojx
new file mode 100644
index 0000000000..aad158ccc3
--- /dev/null
+++ b/bsp/nuvoton/nk-rtu980/template.uvprojx
@@ -0,0 +1,387 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
+<Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_projx.xsd">
+
+ <SchemaVersion>2.1</SchemaVersion>
+
+ <Header>### uVision Project, (C) Keil Software</Header>
+
+ <Targets>
+ <Target>
+ <TargetName>rtthread</TargetName>
+ <ToolsetNumber>0x4</ToolsetNumber>
+ <ToolsetName>ARM-ADS</ToolsetName>
+ <uAC6>0</uAC6>
+ <TargetOption>
+ <TargetCommonOption>
+ <Device>Nuvoton_ARM9_Series</Device>
+ <Vendor>Nuvoton</Vendor>
+ <Cpu></Cpu>
+ <FlashUtilSpec></FlashUtilSpec>
+ <StartupFile></StartupFile>
+ <FlashDriverDll></FlashDriverDll>
+ <DeviceId>0</DeviceId>
+ <RegisterFile></RegisterFile>
+ <MemoryEnv></MemoryEnv>
+ <Cmp></Cmp>
+ <Asm></Asm>
+ <Linker></Linker>
+ <OHString></OHString>
+ <InfinionOptionDll></InfinionOptionDll>
+ <SLE66CMisc></SLE66CMisc>
+ <SLE66AMisc></SLE66AMisc>
+ <SLE66LinkerMisc></SLE66LinkerMisc>
+ <SFDFile></SFDFile>
+ <bCustSvd>0</bCustSvd>
+ <UseEnv>0</UseEnv>
+ <BinPath></BinPath>
+ <IncludePath></IncludePath>
+ <LibPath></LibPath>
+ <RegisterFilePath>Atmel\SAM9260\</RegisterFilePath>
+ <DBRegisterFilePath>Atmel\SAM9260\</DBRegisterFilePath>
+ <TargetStatus>
+ <Error>0</Error>
+ <ExitCodeStop>0</ExitCodeStop>
+ <ButtonStop>0</ButtonStop>
+ <NotGenerated>0</NotGenerated>
+ <InvalidFlash>1</InvalidFlash>
+ </TargetStatus>
+ <OutputDirectory>.\build\keil5\</OutputDirectory>
+ <OutputName>rtthread</OutputName>
+ <CreateExecutable>1</CreateExecutable>
+ <CreateLib>0</CreateLib>
+ <CreateHexFile>1</CreateHexFile>
+ <DebugInformation>1</DebugInformation>
+ <BrowseInformation>1</BrowseInformation>
+ <ListingPath>.\build\keil5\</ListingPath>
+ <HexFormatSelection>1</HexFormatSelection>
+ <Merge32K>0</Merge32K>
+ <CreateBatchFile>0</CreateBatchFile>
+ <BeforeCompile>
+ <RunUserProg1>0</RunUserProg1>
+ <RunUserProg2>0</RunUserProg2>
+ <UserProg1Name></UserProg1Name>
+ <UserProg2Name></UserProg2Name>
+ <UserProg1Dos16Mode>0</UserProg1Dos16Mode>
+ <UserProg2Dos16Mode>0</UserProg2Dos16Mode>
+ <nStopU1X>0</nStopU1X>
+ <nStopU2X>0</nStopU2X>
+ </BeforeCompile>
+ <BeforeMake>
+ <RunUserProg1>0</RunUserProg1>
+ <RunUserProg2>0</RunUserProg2>
+ <UserProg1Name></UserProg1Name>
+ <UserProg2Name></UserProg2Name>
+ <UserProg1Dos16Mode>0</UserProg1Dos16Mode>
+ <UserProg2Dos16Mode>0</UserProg2Dos16Mode>
+ <nStopB1X>0</nStopB1X>
+ <nStopB2X>0</nStopB2X>
+ </BeforeMake>
+ <AfterMake>
+ <RunUserProg1>1</RunUserProg1>
+ <RunUserProg2>0</RunUserProg2>
+ <UserProg1Name>fromelf.exe --bin --output "[email protected]" "[email protected]"</UserProg1Name>
+ <UserProg2Name></UserProg2Name>
+ <UserProg1Dos16Mode>0</UserProg1Dos16Mode>
+ <UserProg2Dos16Mode>0</UserProg2Dos16Mode>
+ <nStopA1X>0</nStopA1X>
+ <nStopA2X>0</nStopA2X>
+ </AfterMake>
+ <SelectedForBatchBuild>0</SelectedForBatchBuild>
+ <SVCSIdString></SVCSIdString>
+ </TargetCommonOption>
+ <CommonProperty>
+ <UseCPPCompiler>0</UseCPPCompiler>
+ <RVCTCodeConst>0</RVCTCodeConst>
+ <RVCTZI>0</RVCTZI>
+ <RVCTOtherData>0</RVCTOtherData>
+ <ModuleSelection>0</ModuleSelection>
+ <IncludeInBuild>1</IncludeInBuild>
+ <AlwaysBuild>0</AlwaysBuild>
+ <GenerateAssemblyFile>0</GenerateAssemblyFile>
+ <AssembleAssemblyFile>0</AssembleAssemblyFile>
+ <PublicsOnly>0</PublicsOnly>
+ <StopOnExitCode>3</StopOnExitCode>
+ <CustomArgument></CustomArgument>
+ <IncludeLibraryModules></IncludeLibraryModules>
+ <ComprImg>1</ComprImg>
+ </CommonProperty>
+ <DllOption>
+ <SimDllName>SARM.DLL</SimDllName>
+ <SimDllArguments>-cAT91SAM9260</SimDllArguments>
+ <SimDlgDll>DARMATS9.DLL</SimDlgDll>
+ <SimDlgDllArguments>-p91SAM9260</SimDlgDllArguments>
+ <TargetDllName>SARM.DLL</TargetDllName>
+ <TargetDllArguments></TargetDllArguments>
+ <TargetDlgDll>TARMATS9.DLL</TargetDlgDll>
+ <TargetDlgDllArguments>-p91SAM9260</TargetDlgDllArguments>
+ </DllOption>
+ <DebugOption>
+ <OPTHX>
+ <HexSelection>1</HexSelection>
+ <HexRangeLowAddress>0</HexRangeLowAddress>
+ <HexRangeHighAddress>0</HexRangeHighAddress>
+ <HexOffset>0</HexOffset>
+ <Oh166RecLen>16</Oh166RecLen>
+ </OPTHX>
+ </DebugOption>
+ <Utilities>
+ <Flash1>
+ <UseTargetDll>1</UseTargetDll>
+ <UseExternalTool>0</UseExternalTool>
+ <RunIndependent>0</RunIndependent>
+ <UpdateFlashBeforeDebugging>0</UpdateFlashBeforeDebugging>
+ <Capability>1</Capability>
+ <DriverSelection>4098</DriverSelection>
+ </Flash1>
+ <bUseTDR>0</bUseTDR>
+ <Flash2>Segger\JLTAgdi.dll</Flash2>
+ <Flash3>"" ()</Flash3>
+ <Flash4></Flash4>
+ <pFcarmOut></pFcarmOut>
+ <pFcarmGrp></pFcarmGrp>
+ <pFcArmRoot></pFcArmRoot>
+ <FcArmLst>0</FcArmLst>
+ </Utilities>
+ <TargetArmAds>
+ <ArmAdsMisc>
+ <GenerateListings>0</GenerateListings>
+ <asHll>1</asHll>
+ <asAsm>1</asAsm>
+ <asMacX>1</asMacX>
+ <asSyms>1</asSyms>
+ <asFals>1</asFals>
+ <asDbgD>1</asDbgD>
+ <asForm>1</asForm>
+ <ldLst>0</ldLst>
+ <ldmm>1</ldmm>
+ <ldXref>1</ldXref>
+ <BigEnd>0</BigEnd>
+ <AdsALst>1</AdsALst>
+ <AdsACrf>1</AdsACrf>
+ <AdsANop>0</AdsANop>
+ <AdsANot>0</AdsANot>
+ <AdsLLst>1</AdsLLst>
+ <AdsLmap>1</AdsLmap>
+ <AdsLcgr>1</AdsLcgr>
+ <AdsLsym>1</AdsLsym>
+ <AdsLszi>1</AdsLszi>
+ <AdsLtoi>1</AdsLtoi>
+ <AdsLsun>1</AdsLsun>
+ <AdsLven>1</AdsLven>
+ <AdsLsxf>1</AdsLsxf>
+ <RvctClst>0</RvctClst>
+ <GenPPlst>0</GenPPlst>
+ <AdsCpuType>ARM926EJ-S</AdsCpuType>
+ <RvctDeviceName></RvctDeviceName>
+ <mOS>0</mOS>
+ <uocRom>0</uocRom>
+ <uocRam>0</uocRam>
+ <hadIROM>1</hadIROM>
+ <hadIRAM>1</hadIRAM>
+ <hadXRAM>0</hadXRAM>
+ <uocXRam>0</uocXRam>
+ <RvdsVP>0</RvdsVP>
+ <RvdsMve>0</RvdsMve>
+ <hadIRAM2>1</hadIRAM2>
+ <hadIROM2>0</hadIROM2>
+ <StupSel>8</StupSel>
+ <useUlib>0</useUlib>
+ <EndSel>0</EndSel>
+ <uLtcg>0</uLtcg>
+ <nSecure>0</nSecure>
+ <RoSelD>3</RoSelD>
+ <RwSelD>3</RwSelD>
+ <CodeSel>0</CodeSel>
+ <OptFeed>0</OptFeed>
+ <NoZi1>0</NoZi1>
+ <NoZi2>0</NoZi2>
+ <NoZi3>0</NoZi3>
+ <NoZi4>0</NoZi4>
+ <NoZi5>0</NoZi5>
+ <Ro1Chk>0</Ro1Chk>
+ <Ro2Chk>0</Ro2Chk>
+ <Ro3Chk>0</Ro3Chk>
+ <Ir1Chk>0</Ir1Chk>
+ <Ir2Chk>0</Ir2Chk>
+ <Ra1Chk>0</Ra1Chk>
+ <Ra2Chk>0</Ra2Chk>
+ <Ra3Chk>0</Ra3Chk>
+ <Im1Chk>0</Im1Chk>
+ <Im2Chk>0</Im2Chk>
+ <OnChipMemories>
+ <Ocm1>
+ <Type>0</Type>
+ <StartAddress>0x0</StartAddress>
+ <Size>0x0</Size>
+ </Ocm1>
+ <Ocm2>
+ <Type>0</Type>
+ <StartAddress>0x0</StartAddress>
+ <Size>0x0</Size>
+ </Ocm2>
+ <Ocm3>
+ <Type>0</Type>
+ <StartAddress>0x0</StartAddress>
+ <Size>0x0</Size>
+ </Ocm3>
+ <Ocm4>
+ <Type>0</Type>
+ <StartAddress>0x0</StartAddress>
+ <Size>0x0</Size>
+ </Ocm4>
+ <Ocm5>
+ <Type>0</Type>
+ <StartAddress>0x0</StartAddress>
+ <Size>0x0</Size>
+ </Ocm5>
+ <Ocm6>
+ <Type>0</Type>
+ <StartAddress>0x0</StartAddress>
+ <Size>0x0</Size>
+ </Ocm6>
+ <IRAM>
+ <Type>0</Type>
+ <StartAddress>0x200000</StartAddress>
+ <Size>0x1000</Size>
+ </IRAM>
+ <IROM>
+ <Type>1</Type>
+ <StartAddress>0x100000</StartAddress>
+ <Size>0x8000</Size>
+ </IROM>
+ <XRAM>
+ <Type>0</Type>
+ <StartAddress>0x0</StartAddress>
+ <Size>0x0</Size>
+ </XRAM>
+ <OCR_RVCT1>
+ <Type>1</Type>
+ <StartAddress>0x20000000</StartAddress>
+ <Size>0x800000</Size>
+ </OCR_RVCT1>
+ <OCR_RVCT2>
+ <Type>1</Type>
+ <StartAddress>0x0</StartAddress>
+ <Size>0x0</Size>
+ </OCR_RVCT2>
+ <OCR_RVCT3>
+ <Type>1</Type>
+ <StartAddress>0x0</StartAddress>
+ <Size>0x0</Size>
+ </OCR_RVCT3>
+ <OCR_RVCT4>
+ <Type>1</Type>
+ <StartAddress>0x100000</StartAddress>
+ <Size>0x8000</Size>
+ </OCR_RVCT4>
+ <OCR_RVCT5>
+ <Type>1</Type>
+ <StartAddress>0x0</StartAddress>
+ <Size>0x0</Size>
+ </OCR_RVCT5>
+ <OCR_RVCT6>
+ <Type>0</Type>
+ <StartAddress>0x20800000</StartAddress>
+ <Size>0x1800000</Size>
+ </OCR_RVCT6>
+ <OCR_RVCT7>
+ <Type>0</Type>
+ <StartAddress>0x0</StartAddress>
+ <Size>0x0</Size>
+ </OCR_RVCT7>
+ <OCR_RVCT8>
+ <Type>0</Type>
+ <StartAddress>0x0</StartAddress>
+ <Size>0x0</Size>
+ </OCR_RVCT8>
+ <OCR_RVCT9>
+ <Type>0</Type>
+ <StartAddress>0x200000</StartAddress>
+ <Size>0x1000</Size>
+ </OCR_RVCT9>
+ <OCR_RVCT10>
+ <Type>0</Type>
+ <StartAddress>0x300000</StartAddress>
+ <Size>0x1000</Size>
+ </OCR_RVCT10>
+ </OnChipMemories>
+ <RvctStartVector></RvctStartVector>
+ </ArmAdsMisc>
+ <Cads>
+ <interw>1</interw>
+ <Optim>1</Optim>
+ <oTime>0</oTime>
+ <SplitLS>0</SplitLS>
+ <OneElfS>0</OneElfS>
+ <Strict>0</Strict>
+ <EnumInt>0</EnumInt>
+ <PlainCh>0</PlainCh>
+ <Ropi>0</Ropi>
+ <Rwpi>0</Rwpi>
+ <wLevel>2</wLevel>
+ <uThumb>0</uThumb>
+ <uSurpInc>0</uSurpInc>
+ <uC99>0</uC99>
+ <uGnu>0</uGnu>
+ <useXO>0</useXO>
+ <v6Lang>1</v6Lang>
+ <v6LangP>1</v6LangP>
+ <vShortEn>1</vShortEn>
+ <vShortWch>1</vShortWch>
+ <v6Lto>0</v6Lto>
+ <v6WtE>0</v6WtE>
+ <v6Rtti>0</v6Rtti>
+ <VariousControls>
+ <MiscControls>--c99</MiscControls>
+ <Define></Define>
+ <Undefine></Undefine>
+ <IncludePath></IncludePath>
+ </VariousControls>
+ </Cads>
+ <Aads>
+ <interw>1</interw>
+ <Ropi>0</Ropi>
+ <Rwpi>0</Rwpi>
+ <thumb>0</thumb>
+ <SplitLS>0</SplitLS>
+ <SwStkChk>0</SwStkChk>
+ <NoWarn>0</NoWarn>
+ <uSurpInc>0</uSurpInc>
+ <useXO>0</useXO>
+ <uClangAs>0</uClangAs>
+ <VariousControls>
+ <MiscControls></MiscControls>
+ <Define></Define>
+ <Undefine></Undefine>
+ <IncludePath></IncludePath>
+ </VariousControls>
+ </Aads>
+ <LDads>
+ <umfTarg>0</umfTarg>
+ <Ropi>0</Ropi>
+ <Rwpi>0</Rwpi>
+ <noStLib>0</noStLib>
+ <RepFail>1</RepFail>
+ <useFile>0</useFile>
+ <TextAddressRange>0x20000000</TextAddressRange>
+ <DataAddressRange>0x20800000</DataAddressRange>
+ <pXoBase></pXoBase>
+ <ScatterFile>.\linking_scripts\nuc980.sct</ScatterFile>
+ <IncludeLibs></IncludeLibs>
+ <IncludeLibsPath></IncludeLibsPath>
+ <Misc></Misc>
+ <LinkerInputFile></LinkerInputFile>
+ <DisabledWarnings></DisabledWarnings>
+ </LDads>
+ </TargetArmAds>
+ </TargetOption>
+ </Target>
+ </Targets>
+
+ <RTE>
+ <apis/>
+ <components/>
+ <files/>
+ </RTE>
+
+</Project>
diff --git a/bsp/nuvoton/numaker-pfm-m487/board/board.c b/bsp/nuvoton/numaker-pfm-m487/board/board.c
deleted file mode 100644
index 01d68aca61..0000000000
--- a/bsp/nuvoton/numaker-pfm-m487/board/board.c
+++ /dev/null
@@ -1,97 +0,0 @@
-/**************************************************************************//**
-*
-* @copyright (C) 2019 Nuvoton Technology Corp. All rights reserved.
-*
-* SPDX-License-Identifier: Apache-2.0
-*
-* Change Logs:
-* Date Author Notes
-* 2020-1-16 Wayne First version
-*
-******************************************************************************/
-
-#include <rtconfig.h>
-#include <rtthread.h>
-#include <NuMicro.h>
-#include "drv_uart.h"
-#include "board.h"
-#include "nutool_pincfg.h"
-#include "nutool_modclkcfg.h"
-
-
-/**
- * This function will initial M487 board.
- */
-void rt_hw_board_init(void)
-{
- /* Init System/modules clock */
- nutool_modclkcfg_init();
-
- /* Unlock protected registers */
- SYS_UnlockReg();
-
- /* Init all pin function setting */
- nutool_pincfg_init();
-
- /* Configure SysTick */
- SysTick_Config(SystemCoreClock / RT_TICK_PER_SECOND);
-
- /* Update System Core Clock */
- /* User can use SystemCoreClockUpdate() to calculate SystemCoreClock. */
- SystemCoreClockUpdate();
-
-#if defined(BSP_USING_EADC)
- /* Vref connect to internal */
- SYS->VREFCTL = (SYS->VREFCTL & ~SYS_VREFCTL_VREFCTL_Msk) | SYS_VREFCTL_VREF_3_0V;
-#endif
-
- /* Lock protected registers */
- SYS_LockReg();
-
-#ifdef RT_USING_HEAP
- rt_system_heap_init(HEAP_BEGIN, HEAP_END);
-#endif /* RT_USING_HEAP */
-
-#if defined(BSP_USING_UART)
- rt_hw_uart_init();
-#endif
-
-#ifdef RT_USING_CONSOLE
- rt_console_set_device(RT_CONSOLE_DEVICE_NAME);
-#endif
-
- NVIC_SetPriorityGrouping(7);
-
-#ifdef RT_USING_COMPONENTS_INIT
- rt_components_board_init();
-#endif
-}
-
-/**
- * This is the timer interrupt service routine.
- *
- */
-void SysTick_Handler(void)
-{
- /* enter interrupt */
- rt_interrupt_enter();
-
- rt_tick_increase();
-
- /* leave interrupt */
- rt_interrupt_leave();
-}
-
-void rt_hw_cpu_reset(void)
-{
- SYS_UnlockReg();
-
- SYS->IPRST0 |= SYS_IPRST0_CHIPRST_Msk;
-}
-
-int reboot(int argc, char** argv)
-{
- rt_hw_cpu_reset();
- return 0;
-}
-MSH_CMD_EXPORT(reboot, Reboot System);