nuclei: Rename board name

Signed-off-by: Huaqi Fang <578567190@qq.com>
This commit is contained in:
Huaqi Fang 2020-04-08 15:43:00 +08:00
parent d780138a1a
commit ad81c1d3bf
16 changed files with 49 additions and 98 deletions

View File

@ -1,4 +1,7 @@
# Generated by Kconfiglib (https://github.com/ulfalizer/Kconfiglib)
#
# Automatically generated file; DO NOT EDIT.
# RT-Thread Configuration
#
#
# RT-Thread Kernel
@ -43,7 +46,6 @@ CONFIG_RT_USING_EVENT=y
CONFIG_RT_USING_MAILBOX=y
CONFIG_RT_USING_MESSAGEQUEUE=y
# CONFIG_RT_USING_SIGNALS is not set
# end of Inter-Thread communication
#
# Memory Management
@ -55,7 +57,6 @@ CONFIG_RT_USING_SMALL_MEM=y
# CONFIG_RT_USING_SLAB is not set
# CONFIG_RT_USING_MEMTRACE is not set
CONFIG_RT_USING_HEAP=y
# end of Memory Management
#
# Kernel Device Object
@ -66,10 +67,12 @@ CONFIG_RT_USING_DEVICE=y
CONFIG_RT_USING_CONSOLE=y
CONFIG_RT_CONSOLEBUF_SIZE=128
CONFIG_RT_CONSOLE_DEVICE_NAME="uart4"
# end of Kernel Device Object
CONFIG_RT_VER_NUM=0x40003
# end of RT-Thread Kernel
# CONFIG_RT_USING_CPU_FFS is not set
CONFIG_ARCH_RISCV=y
CONFIG_ARCH_RISCV32=y
CONFIG_ARCH_NUCLEI=y
# CONFIG_ARCH_CPU_STACK_GROWS_UPWARD is not set
#
# RT-Thread Components
@ -83,7 +86,6 @@ CONFIG_RT_MAIN_THREAD_PRIORITY=10
# C++ features
#
# CONFIG_RT_USING_CPLUSPLUS is not set
# end of C++ features
#
# Command shell
@ -103,7 +105,6 @@ CONFIG_FINSH_USING_MSH=y
CONFIG_FINSH_USING_MSH_DEFAULT=y
CONFIG_FINSH_USING_MSH_ONLY=y
CONFIG_FINSH_ARG_MAX=10
# end of Command shell
#
# Device virtual file system
@ -120,7 +121,6 @@ CONFIG_RT_USING_DFS_DEVFS=y
# CONFIG_RT_USING_DFS_RAMFS is not set
# CONFIG_RT_USING_DFS_UFFS is not set
# CONFIG_RT_USING_DFS_JFFS2 is not set
# end of Device virtual file system
#
# Device Drivers
@ -141,7 +141,9 @@ CONFIG_RT_SERIAL_RB_BUFSZ=64
# 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_RTC=y
# CONFIG_RT_USING_ALARM is not set
# CONFIG_RT_USING_SOFT_RTC is not set
# CONFIG_RT_USING_SDIO is not set
# CONFIG_RT_USING_SPI is not set
# CONFIG_RT_USING_WDT is not set
@ -158,8 +160,6 @@ CONFIG_RT_SERIAL_RB_BUFSZ=64
#
# CONFIG_RT_USING_USB_HOST is not set
# CONFIG_RT_USING_USB_DEVICE is not set
# end of Using USB
# end of Device Drivers
#
# POSIX layer and C standard library
@ -171,7 +171,6 @@ CONFIG_RT_USING_POSIX=y
# CONFIG_RT_USING_POSIX_TERMIOS is not set
# CONFIG_RT_USING_POSIX_AIO is not set
# CONFIG_RT_USING_MODULE is not set
# end of POSIX layer and C standard library
#
# Network
@ -181,32 +180,26 @@ CONFIG_RT_USING_POSIX=y
# Socket abstraction layer
#
# CONFIG_RT_USING_SAL is not set
# end of Socket abstraction layer
#
# Network interface device
#
# CONFIG_RT_USING_NETDEV is not set
# end of Network interface device
#
# light weight TCP/IP stack
#
# CONFIG_RT_USING_LWIP is not set
# end of light weight TCP/IP stack
#
# AT commands
#
# CONFIG_RT_USING_AT is not set
# end of AT commands
# end of Network
#
# VBUS(Virtual Software BUS)
#
# CONFIG_RT_USING_VBUS is not set
# end of VBUS(Virtual Software BUS)
#
# Utilities
@ -214,8 +207,6 @@ CONFIG_RT_USING_POSIX=y
# CONFIG_RT_USING_RYM is not set
# CONFIG_RT_USING_ULOG is not set
# CONFIG_RT_USING_UTEST is not set
# end of Utilities
# end of RT-Thread Components
#
# RT-Thread online packages
@ -247,17 +238,12 @@ CONFIG_RT_USING_POSIX=y
# Marvell WiFi
#
# CONFIG_PKG_USING_WLANMARVELL is not set
# end of Marvell WiFi
#
# Wiced WiFi
#
# CONFIG_PKG_USING_WLAN_WICED is not set
# end of Wiced WiFi
# CONFIG_PKG_USING_RW007 is not set
# end of Wi-Fi
# CONFIG_PKG_USING_COAP is not set
# CONFIG_PKG_USING_NOPOLL is not set
# CONFIG_PKG_USING_NETUTILS is not set
@ -277,8 +263,6 @@ CONFIG_RT_USING_POSIX=y
# 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
# end of IoT Cloud
# CONFIG_PKG_USING_NIMBLE is not set
# CONFIG_PKG_USING_OTA_DOWNLOADER is not set
# CONFIG_PKG_USING_IPMSG is not set
@ -297,7 +281,6 @@ CONFIG_RT_USING_POSIX=y
# CONFIG_PKG_USING_CAPNP is not set
# CONFIG_PKG_USING_RT_CJSON_TOOLS is not set
# CONFIG_PKG_USING_AGILE_TELNET is not set
# end of IoT - internet of things
#
# security packages
@ -306,7 +289,6 @@ CONFIG_RT_USING_POSIX=y
# CONFIG_PKG_USING_libsodium is not set
# CONFIG_PKG_USING_TINYCRYPT is not set
# CONFIG_PKG_USING_TFM is not set
# end of security packages
#
# language packages
@ -314,7 +296,6 @@ CONFIG_RT_USING_POSIX=y
# CONFIG_PKG_USING_LUA is not set
# CONFIG_PKG_USING_JERRYSCRIPT is not set
# CONFIG_PKG_USING_MICROPYTHON is not set
# end of language packages
#
# multimedia packages
@ -324,7 +305,6 @@ CONFIG_RT_USING_POSIX=y
# CONFIG_PKG_USING_STEMWIN is not set
# CONFIG_PKG_USING_WAVPLAYER is not set
# CONFIG_PKG_USING_TJPGD is not set
# end of multimedia packages
#
# tools packages
@ -343,7 +323,6 @@ CONFIG_RT_USING_POSIX=y
# CONFIG_PKG_USING_CHINESE_FONT_LIBRARY is not set
# CONFIG_PKG_USING_LUNAR_CALENDAR is not set
# CONFIG_PKG_USING_BS8116A is not set
# end of tools packages
#
# system packages
@ -366,7 +345,6 @@ CONFIG_RT_USING_POSIX=y
# CONFIG_PKG_USING_SYSWATCH is not set
# CONFIG_PKG_USING_SYS_LOAD_MONITOR is not set
# CONFIG_PKG_USING_PLCCORE is not set
# end of system packages
#
# peripheral libraries and drivers
@ -407,7 +385,11 @@ CONFIG_RT_USING_POSIX=y
# CONFIG_PKG_USING_MAX7219 is not set
# CONFIG_PKG_USING_BEEP is not set
# CONFIG_PKG_USING_EASYBLINK is not set
# end of peripheral libraries and drivers
CONFIG_PKG_USING_NUCLEI_SDK=y
CONFIG_PKG_NUCLEI_SDK_PATH="/packages/peripherals/nuclei_sdk"
# CONFIG_PKG_USING_NUCLEI_SDK_V022 is not set
CONFIG_PKG_USING_NUCLEI_SDK_LATEST_VERSION=y
CONFIG_PKG_NUCLEI_SDK_VER="latest"
#
# miscellaneous packages
@ -435,8 +417,6 @@ CONFIG_RT_USING_POSIX=y
# CONFIG_PKG_USING_FILESYSTEM_SAMPLES is not set
# CONFIG_PKG_USING_NETWORK_SAMPLES is not set
# CONFIG_PKG_USING_PERIPHERAL_SAMPLES is not set
# end of samples: kernel and components samples
# CONFIG_PKG_USING_HELLO is not set
# CONFIG_PKG_USING_VI is not set
# CONFIG_PKG_USING_NNOM is not set
@ -446,8 +426,6 @@ CONFIG_RT_USING_POSIX=y
# CONFIG_PKG_USING_VT100 is not set
# CONFIG_PKG_USING_ULAPACK is not set
# CONFIG_PKG_USING_UKAL is not set
# end of miscellaneous packages
# end of RT-Thread online packages
#
# Hardware Drivers Config
@ -458,18 +436,14 @@ CONFIG_SOC_GD32VF103V=y
# Onboard Peripheral Drivers
#
CONFIG_BSP_USING_USART=y
# end of Onboard Peripheral Drivers
#
# On-chip Peripheral Drivers
#
CONFIG_BSP_USING_UART=y
CONFIG_BSP_USING_UART4=y
# end of On-chip Peripheral Drivers
#
# Board extended module Drivers
#
# end of Hardware Drivers Config
CONFIG_SOC_GD32VF103=y

View File

@ -21,6 +21,9 @@ source "board/Kconfig"
config SOC_GD32VF103
bool
select ARCH_NUCLEI
select ARCH_RISCV32
select PKG_USING_NUCLEI_SDK
select RT_USING_COMPONENTS_INIT
select RT_USING_USER_MAIN
default y

View File

@ -33,17 +33,11 @@ Export('RTT_ROOT')
Export('rtconfig')
GDB = rtconfig.GDB
nuclei_sdk_root = rtconfig.NUCLEI_SDK_ROOT
openocd_cfg = rtconfig.OPENOCD_CFG.replace('\\', '/')
# prepare building environment
objs = PrepareBuilding(env, RTT_ROOT)
# include libraries
objs.extend(SConscript(os.path.join(nuclei_sdk_root, 'SConscript')))
openocd_cfg = rtconfig.NUCLEI_SDK_OPENOCD_CFG.replace('\\', '/')
# make a building
DoBuilding(TARGET, objs)

View File

@ -10,8 +10,9 @@
#include <rtthread.h>
#include <rtdevice.h>
#include <nuclei_sdk_hal.h>
#define THREAD_PRIORITY 20
#define THREAD_PRIORITY 19
#define THREAD_STACK_SIZE 396
#define THREAD_TIMESLICE 5
#define THREAD_NUM 2
@ -32,6 +33,9 @@ static void thread_entry(void *parameter)
rt_kprintf("thread %d count: %d\n", (rt_uint32_t)parameter, count++);
#endif
rt_thread_mdelay(500);
if ((rt_uint32_t)parameter < (LEDn-1)) {
gd_rvstar_led_toggle((rt_uint32_t)parameter);
}
}
}
@ -63,12 +67,17 @@ int main(void)
rt_uint32_t count = 0;
create_thread_demo();
for (int i = 0; i < LEDn; i ++) {
gd_rvstar_led_init(i);
}
while (1) {
#ifdef APP_DEBUG_PRINT
rt_kprintf("Main thread count: %d\n", count++);
#endif
rt_thread_mdelay(1000);
gd_rvstar_led_toggle(LED3);
}
}

View File

@ -1,7 +1,8 @@
#ifndef RT_CONFIG_H__
#define RT_CONFIG_H__
/* Generated by Kconfiglib (https://github.com/ulfalizer/Kconfiglib) */
/* Automatically generated file; DO NOT EDIT. */
/* RT-Thread Configuration */
/* RT-Thread Kernel */
@ -29,14 +30,12 @@
#define RT_USING_EVENT
#define RT_USING_MAILBOX
#define RT_USING_MESSAGEQUEUE
/* end of Inter-Thread communication */
/* Memory Management */
#define RT_USING_MEMPOOL
#define RT_USING_SMALL_MEM
#define RT_USING_HEAP
/* end of Memory Management */
/* Kernel Device Object */
@ -44,9 +43,10 @@
#define RT_USING_CONSOLE
#define RT_CONSOLEBUF_SIZE 128
#define RT_CONSOLE_DEVICE_NAME "uart4"
/* end of Kernel Device Object */
#define RT_VER_NUM 0x40003
/* end of RT-Thread Kernel */
#define ARCH_RISCV
#define ARCH_RISCV32
#define ARCH_NUCLEI
/* RT-Thread Components */
@ -57,7 +57,6 @@
/* C++ features */
/* end of C++ features */
/* Command shell */
@ -74,7 +73,6 @@
#define FINSH_USING_MSH_DEFAULT
#define FINSH_USING_MSH_ONLY
#define FINSH_ARG_MAX 10
/* end of Command shell */
/* Device virtual file system */
@ -84,7 +82,6 @@
#define DFS_FILESYSTEM_TYPES_MAX 2
#define DFS_FD_MAX 16
#define RT_USING_DFS_DEVFS
/* end of Device virtual file system */
/* Device Drivers */
@ -92,45 +89,35 @@
#define RT_PIPE_BUFSZ 512
#define RT_USING_SERIAL
#define RT_SERIAL_RB_BUFSZ 64
#define RT_USING_RTC
/* Using USB */
/* end of Using USB */
/* end of Device Drivers */
/* POSIX layer and C standard library */
#define RT_USING_LIBC
#define RT_USING_POSIX
/* end of POSIX layer and C standard library */
/* Network */
/* Socket abstraction layer */
/* end of Socket abstraction layer */
/* Network interface device */
/* end of Network interface device */
/* light weight TCP/IP stack */
/* end of light weight TCP/IP stack */
/* AT commands */
/* end of AT commands */
/* end of Network */
/* VBUS(Virtual Software BUS) */
/* end of VBUS(Virtual Software BUS) */
/* Utilities */
/* end of Utilities */
/* end of RT-Thread Components */
/* RT-Thread online packages */
@ -141,50 +128,38 @@
/* Marvell WiFi */
/* end of Marvell WiFi */
/* Wiced WiFi */
/* end of Wiced WiFi */
/* end of Wi-Fi */
/* IoT Cloud */
/* end of IoT Cloud */
/* end of IoT - internet of things */
/* security packages */
/* end of security packages */
/* language packages */
/* end of language packages */
/* multimedia packages */
/* end of multimedia packages */
/* tools packages */
/* end of tools packages */
/* system packages */
/* end of system packages */
/* peripheral libraries and drivers */
/* end of peripheral libraries and drivers */
#define PKG_USING_NUCLEI_SDK
#define PKG_USING_NUCLEI_SDK_LATEST_VERSION
/* miscellaneous packages */
/* samples: kernel and components samples */
/* end of samples: kernel and components samples */
/* end of miscellaneous packages */
/* end of RT-Thread online packages */
/* Hardware Drivers Config */
@ -193,17 +168,14 @@
/* Onboard Peripheral Drivers */
#define BSP_USING_USART
/* end of Onboard Peripheral Drivers */
/* On-chip Peripheral Drivers */
#define BSP_USING_UART
#define BSP_USING_UART4
/* end of On-chip Peripheral Drivers */
/* Board extended module Drivers */
/* end of Hardware Drivers Config */
#define SOC_GD32VF103
#endif

View File

@ -18,10 +18,11 @@ else:
# EXEC_PATH = os.getenv('RTT_EXEC_PATH')
BUILD = 'debug'
NUCLEI_SDK_ROOT = os.path.abspath("../nuclei_sdk")
SOC_LIBRARY_ROOT = os.path.join(NUCLEI_SDK_ROOT, "SoC", "gd32vf103")
LINK_FILE = os.path.join(SOC_LIBRARY_ROOT, "Board", "gd32vf103v_rvstar", "Source", "GCC", "gcc_gd32vf103_flashxip.ld")
OPENOCD_CFG = os.path.join(SOC_LIBRARY_ROOT, "Board", "gd32vf103v_rvstar", "openocd_gd32vf103.cfg")
# Fixed configurations below
NUCLEI_SDK_SOC = "gd32vf103"
NUCLEI_SDK_BOARD = "gd32vf103v_rvstar"
NUCLEI_SDK_DOWNLOAD = "flashxip"
NUCLEI_SDK_CORE = "n205"
if PLATFORM == 'gcc':
# toolchains
@ -37,12 +38,10 @@ if PLATFORM == 'gcc':
OBJDUMP = PREFIX + 'objdump'
OBJCPY = PREFIX + 'objcopy'
DEVICE = '-march=rv32imac -mabi=ilp32 -mcmodel=medany '
CFLAGS = DEVICE + ' -ffunction-sections -fdata-sections -fno-common '
CFLAGS = ' -ffunction-sections -fdata-sections -fno-common '
AFLAGS = CFLAGS
LFLAGS = DEVICE + ' --specs=nano.specs --specs=nosys.specs -nostartfiles -Wl,--gc-sections '
LFLAGS += ' -Wl,-cref,-Map=rtthread.map -u _printf_float'
LFLAGS += ' -T ' + LINK_FILE
LFLAGS = ' --specs=nano.specs --specs=nosys.specs -nostartfiles -Wl,--gc-sections '
LFLAGS += ' -Wl,-cref,-Map=rtthread.map'
LFLAGS += ' -u _isatty -u _write -u _sbrk -u _read -u _close -u _fstat -u _lseek '
CPATH = ''
LPATH = ''