Merge branch 'master' of https://github.com/RT-Thread/rt-thread into nuvoton

This commit is contained in:
Wayne Lin 2021-05-14 13:28:25 +08:00
commit 1008f9e543
22 changed files with 767 additions and 72 deletions

43
.github/workflows/action_utest.yml vendored Normal file
View File

@ -0,0 +1,43 @@
name: AutoTestCI
# Controls when the action will run. Triggers the workflow on push or pull request
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
name: ${{ matrix.legs.UTEST }}
strategy:
fail-fast: false
matrix:
legs:
- {UTEST: "kernel/ipc", RTT_BSP: "bsp/qemu-vexpress-a9", QEMU_ARCH: "vexpress-a9", CONFIG_FILE: "examples/utest/configs/utest_self/config.h"}
- {UTEST: "components/utest", RTT_BSP: "bsp/qemu-vexpress-a9", QEMU_ARCH: "vexpress-a9", CONFIG_FILE: "examples/utest/configs/utest_self/config.h"}
env:
TEST_BSP_ROOT: ${{ matrix.legs.RTT_BSP }}
TEST_CONFIG_FILE: ${{ matrix.legs.CONFIG_FILE }}
steps:
- uses: actions/checkout@v1
- name: Prepare env
run: |
sudo apt-get update > /dev/null
sudo apt-get -yqq install scons qemu-system-arm git
wget -q https://github.com/RT-Thread/toolchains-ci/releases/download/arm-2017q2-v6/gcc-arm-none-eabi-6-2017-q2-update-linux.tar.bz2
sudo tar xjf gcc-arm-none-eabi-6-2017-q2-update-linux.tar.bz2 -C /opt
- name: Build bsp
run: |
export RTT_EXEC_PATH=/opt/gcc-arm-none-eabi-6-2017-q2-update/bin
/opt/gcc-arm-none-eabi-6-2017-q2-update/bin/arm-none-eabi-gcc --version
cp $TEST_CONFIG_FILE $TEST_BSP_ROOT/rtconfig.h
scons -j$(nproc) -C $TEST_BSP_ROOT
- name: Start test
run: |
git clone https://github.com/armink/UtestRunner.git
pushd $TEST_BSP_ROOT
dd if=/dev/zero of=sd.bin bs=1024 count=65536
popd
pushd UtestRunner
python3 qemu_runner.py --elf ../$TEST_BSP_ROOT/rtthread.elf --sd ../$TEST_BSP_ROOT/sd.bin
cat rtt_console.log
popd

View File

@ -1,3 +1,4 @@
source "$RTT_DIR/src/Kconfig" source "$RTT_DIR/src/Kconfig"
source "$RTT_DIR/libcpu/Kconfig" source "$RTT_DIR/libcpu/Kconfig"
source "$RTT_DIR/components/Kconfig" source "$RTT_DIR/components/Kconfig"
source "$RTT_DIR/examples/utest/testcases/Kconfig"

View File

@ -41,7 +41,6 @@ Support GCC, MDK5, IAR IDE/compilers. More information of these compiler version
Notice: Notice:
(1) Please install Nu-Link_Keil_Driver or Nu-Link_IAR_Driver for development. (1) Please install Nu-Link_Keil_Driver or Nu-Link_IAR_Driver for development.
(2) You must remove '--c99' flag in <path/to/rtt>/components/drivers/spi/SConscript before generating MDK5 project file.
## 3. Program firmware ## 3. Program firmware
### Step 1: ### Step 1:

View File

@ -15,7 +15,7 @@ if CROSS_TOOL == 'gcc':
PLATFORM = 'gcc' PLATFORM = 'gcc'
EXEC_PATH = r'C:\Program Files (x86)\GNU Tools ARM Embedded\6 2017-q1-update\bin' EXEC_PATH = r'C:\Program Files (x86)\GNU Tools ARM Embedded\6 2017-q1-update\bin'
elif CROSS_TOOL == 'keil': elif CROSS_TOOL == 'keil':
PLATFORM = 'armcc' PLATFORM = 'armclang'
EXEC_PATH = r'C:\Keil_v5' EXEC_PATH = r'C:\Keil_v5'
elif CROSS_TOOL == 'iar': elif CROSS_TOOL == 'iar':
PLATFORM = 'iar' PLATFORM = 'iar'
@ -56,9 +56,9 @@ if PLATFORM == 'gcc':
POST_ACTION = OBJCPY + ' -O binary $TARGET rtthread.bin\n' + SIZE + ' $TARGET \n' POST_ACTION = OBJCPY + ' -O binary $TARGET rtthread.bin\n' + SIZE + ' $TARGET \n'
elif PLATFORM == 'armcc': elif PLATFORM == 'armclang':
# toolchains # toolchains
CC = 'armcc' CC = 'armclang'
AS = 'armasm' AS = 'armasm'
AR = 'armar' AR = 'armar'
LINK = 'armlink' LINK = 'armlink'

View File

@ -24,6 +24,12 @@ CONFIG_IDLE_THREAD_STACK_SIZE=1024
CONFIG_RT_USING_TIMER_SOFT=y CONFIG_RT_USING_TIMER_SOFT=y
CONFIG_RT_TIMER_THREAD_PRIO=4 CONFIG_RT_TIMER_THREAD_PRIO=4
CONFIG_RT_TIMER_THREAD_STACK_SIZE=1024 CONFIG_RT_TIMER_THREAD_STACK_SIZE=1024
#
# kservice optimization
#
# CONFIG_RT_KSERVICE_USING_STDLIB is not set
# CONFIG_RT_KSERVICE_USING_TINY_SIZE is not set
CONFIG_RT_DEBUG=y CONFIG_RT_DEBUG=y
CONFIG_RT_DEBUG_COLOR=y CONFIG_RT_DEBUG_COLOR=y
# CONFIG_RT_DEBUG_INIT_CONFIG is not set # CONFIG_RT_DEBUG_INIT_CONFIG is not set
@ -56,6 +62,7 @@ CONFIG_RT_USING_MEMHEAP=y
CONFIG_RT_USING_SMALL_MEM=y CONFIG_RT_USING_SMALL_MEM=y
# CONFIG_RT_USING_SLAB is not set # CONFIG_RT_USING_SLAB is not set
# CONFIG_RT_USING_MEMHEAP_AS_HEAP 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_MEMTRACE=y
CONFIG_RT_USING_HEAP=y CONFIG_RT_USING_HEAP=y
@ -68,7 +75,7 @@ CONFIG_RT_USING_INTERRUPT_INFO=y
CONFIG_RT_USING_CONSOLE=y CONFIG_RT_USING_CONSOLE=y
CONFIG_RT_CONSOLEBUF_SIZE=256 CONFIG_RT_CONSOLEBUF_SIZE=256
CONFIG_RT_CONSOLE_DEVICE_NAME="uart0" CONFIG_RT_CONSOLE_DEVICE_NAME="uart0"
CONFIG_RT_VER_NUM=0x40002 CONFIG_RT_VER_NUM=0x40004
CONFIG_ARCH_ARM=y CONFIG_ARCH_ARM=y
# CONFIG_RT_USING_CPU_FFS is not set # CONFIG_RT_USING_CPU_FFS is not set
CONFIG_ARCH_ARM_CORTEX_A=y CONFIG_ARCH_ARM_CORTEX_A=y
@ -112,9 +119,9 @@ CONFIG_FINSH_ARG_MAX=10
# #
CONFIG_RT_USING_DFS=y CONFIG_RT_USING_DFS=y
CONFIG_DFS_USING_WORKDIR=y CONFIG_DFS_USING_WORKDIR=y
CONFIG_DFS_FILESYSTEMS_MAX=2 CONFIG_DFS_FILESYSTEMS_MAX=4
CONFIG_DFS_FILESYSTEM_TYPES_MAX=8 CONFIG_DFS_FILESYSTEM_TYPES_MAX=8
CONFIG_DFS_FD_MAX=16 CONFIG_DFS_FD_MAX=32
# CONFIG_RT_USING_DFS_MNTTABLE is not set # CONFIG_RT_USING_DFS_MNTTABLE is not set
CONFIG_RT_USING_DFS_ELMFAT=y CONFIG_RT_USING_DFS_ELMFAT=y
@ -128,6 +135,11 @@ CONFIG_RT_DFS_ELM_WORD_ACCESS=y
# CONFIG_RT_DFS_ELM_USE_LFN_2 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=y
CONFIG_RT_DFS_ELM_USE_LFN=3 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_MAX_LFN=255
CONFIG_RT_DFS_ELM_DRIVES=2 CONFIG_RT_DFS_ELM_DRIVES=2
CONFIG_RT_DFS_ELM_MAX_SECTOR_SIZE=4096 CONFIG_RT_DFS_ELM_MAX_SECTOR_SIZE=4096
@ -136,8 +148,6 @@ CONFIG_RT_DFS_ELM_REENTRANT=y
CONFIG_RT_USING_DFS_DEVFS=y CONFIG_RT_USING_DFS_DEVFS=y
CONFIG_RT_USING_DFS_ROMFS=y CONFIG_RT_USING_DFS_ROMFS=y
CONFIG_RT_USING_DFS_RAMFS=y CONFIG_RT_USING_DFS_RAMFS=y
# CONFIG_RT_USING_DFS_UFFS is not set
# CONFIG_RT_USING_DFS_JFFS2 is not set
# CONFIG_RT_USING_DFS_NFS is not set # CONFIG_RT_USING_DFS_NFS is not set
# #
@ -155,14 +165,17 @@ CONFIG_RT_SERIAL_RB_BUFSZ=64
# CONFIG_RT_USING_HWTIMER is not set # CONFIG_RT_USING_HWTIMER is not set
# CONFIG_RT_USING_CPUTIME is not set # CONFIG_RT_USING_CPUTIME is not set
CONFIG_RT_USING_I2C=y CONFIG_RT_USING_I2C=y
# CONFIG_RT_I2C_DEBUG is not set
CONFIG_RT_USING_I2C_BITOPS=y 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_PIN=y
# CONFIG_RT_USING_ADC is not set # CONFIG_RT_USING_ADC is not set
# CONFIG_RT_USING_DAC is not set
# CONFIG_RT_USING_PWM is not set # CONFIG_RT_USING_PWM is not set
CONFIG_RT_USING_MTD_NOR=y CONFIG_RT_USING_MTD_NOR=y
CONFIG_RT_USING_MTD_NAND=y CONFIG_RT_USING_MTD_NAND=y
CONFIG_RT_MTD_NAND_DEBUG=y CONFIG_RT_MTD_NAND_DEBUG=y
# CONFIG_RT_USING_MTD is not set
# CONFIG_RT_USING_PM is not set # CONFIG_RT_USING_PM is not set
CONFIG_RT_USING_RTC=y CONFIG_RT_USING_RTC=y
# CONFIG_RT_USING_ALARM is not set # CONFIG_RT_USING_ALARM is not set
@ -181,6 +194,7 @@ CONFIG_RT_USING_SFUD=y
CONFIG_RT_SFUD_USING_SFDP=y CONFIG_RT_SFUD_USING_SFDP=y
CONFIG_RT_SFUD_USING_FLASH_INFO_TABLE=y CONFIG_RT_SFUD_USING_FLASH_INFO_TABLE=y
# CONFIG_RT_SFUD_USING_QSPI is not set # CONFIG_RT_SFUD_USING_QSPI is not set
CONFIG_RT_SFUD_SPI_MAX_HZ=50000000
# CONFIG_RT_DEBUG_SFUD is not set # CONFIG_RT_DEBUG_SFUD is not set
# CONFIG_RT_USING_ENC28J60 is not set # CONFIG_RT_USING_ENC28J60 is not set
# CONFIG_RT_USING_SPI_WIFI is not set # CONFIG_RT_USING_SPI_WIFI is not set
@ -188,15 +202,9 @@ CONFIG_RT_USING_WDT=y
# CONFIG_RT_USING_AUDIO is not set # CONFIG_RT_USING_AUDIO is not set
# CONFIG_RT_USING_SENSOR is not set # CONFIG_RT_USING_SENSOR is not set
# CONFIG_RT_USING_TOUCH is not set # CONFIG_RT_USING_TOUCH is not set
#
# Using Hardware Crypto drivers
#
# CONFIG_RT_USING_HWCRYPTO is not set # CONFIG_RT_USING_HWCRYPTO is not set
# CONFIG_RT_USING_PULSE_ENCODER is not set
# # CONFIG_RT_USING_INPUT_CAPTURE is not set
# Using WiFi
#
# CONFIG_RT_USING_WIFI is not set # CONFIG_RT_USING_WIFI is not set
# #
@ -214,8 +222,10 @@ CONFIG_PTHREAD_NUM_MAX=8
CONFIG_RT_USING_POSIX=y CONFIG_RT_USING_POSIX=y
CONFIG_RT_USING_POSIX_MMAP=y CONFIG_RT_USING_POSIX_MMAP=y
CONFIG_RT_USING_POSIX_TERMIOS=y CONFIG_RT_USING_POSIX_TERMIOS=y
CONFIG_RT_USING_POSIX_GETLINE=y
CONFIG_RT_USING_POSIX_AIO=y CONFIG_RT_USING_POSIX_AIO=y
# CONFIG_RT_USING_MODULE is not set # CONFIG_RT_USING_MODULE is not set
CONFIG_RT_LIBC_FIXED_TIMEZONE=8
# #
# Network # Network
@ -225,6 +235,7 @@ CONFIG_RT_USING_POSIX_AIO=y
# Socket abstraction layer # Socket abstraction layer
# #
CONFIG_RT_USING_SAL=y CONFIG_RT_USING_SAL=y
CONFIG_SAL_INTERNET_CHECK=y
# #
# protocol stack implement # protocol stack implement
@ -250,9 +261,10 @@ CONFIG_NETDEV_IPV6=0
# #
CONFIG_RT_USING_LWIP=y CONFIG_RT_USING_LWIP=y
# CONFIG_RT_USING_LWIP141 is not set # CONFIG_RT_USING_LWIP141 is not set
CONFIG_RT_USING_LWIP202=y # CONFIG_RT_USING_LWIP202 is not set
# CONFIG_RT_USING_LWIP210 is not set CONFIG_RT_USING_LWIP212=y
# CONFIG_RT_USING_LWIP_IPV6 is not set # CONFIG_RT_USING_LWIP_IPV6 is not set
CONFIG_RT_LWIP_MEM_ALIGNMENT=4
# CONFIG_RT_LWIP_IGMP is not set # CONFIG_RT_LWIP_IGMP is not set
CONFIG_RT_LWIP_ICMP=y CONFIG_RT_LWIP_ICMP=y
# CONFIG_RT_LWIP_SNMP is not set # CONFIG_RT_LWIP_SNMP is not set
@ -294,6 +306,7 @@ CONFIG_SO_REUSE=1
CONFIG_LWIP_SO_RCVTIMEO=1 CONFIG_LWIP_SO_RCVTIMEO=1
CONFIG_LWIP_SO_SNDTIMEO=1 CONFIG_LWIP_SO_SNDTIMEO=1
CONFIG_LWIP_SO_RCVBUF=1 CONFIG_LWIP_SO_RCVBUF=1
CONFIG_LWIP_SO_LINGER=0
# CONFIG_RT_LWIP_NETIF_LOOPBACK is not set # CONFIG_RT_LWIP_NETIF_LOOPBACK is not set
CONFIG_LWIP_NETIF_LOOPBACK=0 CONFIG_LWIP_NETIF_LOOPBACK=0
# CONFIG_RT_LWIP_STATS is not set # CONFIG_RT_LWIP_STATS is not set
@ -301,11 +314,6 @@ CONFIG_LWIP_NETIF_LOOPBACK=0
CONFIG_RT_LWIP_USING_PING=y CONFIG_RT_LWIP_USING_PING=y
# CONFIG_RT_LWIP_DEBUG is not set # CONFIG_RT_LWIP_DEBUG is not set
#
# Modbus master and slave stack
#
# CONFIG_RT_USING_MODBUS is not set
# #
# AT commands # AT commands
# #
@ -332,14 +340,20 @@ CONFIG_RT_USING_LWP=y
# #
# IoT - internet of things # IoT - internet of things
# #
# CONFIG_PKG_USING_LORAWAN_DRIVER is not set
# CONFIG_PKG_USING_PAHOMQTT 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_WEBCLIENT is not set
# CONFIG_PKG_USING_WEBNET is not set # CONFIG_PKG_USING_WEBNET is not set
# CONFIG_PKG_USING_MONGOOSE 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_WEBTERMINAL is not set
# CONFIG_PKG_USING_CJSON is not set # CONFIG_PKG_USING_CJSON is not set
# CONFIG_PKG_USING_JSMN is not set # CONFIG_PKG_USING_JSMN is not set
# CONFIG_PKG_USING_LIBMODBUS 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_LJSON is not set
# CONFIG_PKG_USING_EZXML is not set # CONFIG_PKG_USING_EZXML is not set
# CONFIG_PKG_USING_NANOPB is not set # CONFIG_PKG_USING_NANOPB is not set
@ -361,6 +375,8 @@ CONFIG_RT_USING_LWP=y
# CONFIG_PKG_USING_COAP is not set # CONFIG_PKG_USING_COAP is not set
# CONFIG_PKG_USING_NOPOLL is not set # CONFIG_PKG_USING_NOPOLL is not set
# CONFIG_PKG_USING_NETUTILS is not set # CONFIG_PKG_USING_NETUTILS is not set
# 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_AT_DEVICE is not set
# CONFIG_PKG_USING_ATSRV_SOCKET is not set # CONFIG_PKG_USING_ATSRV_SOCKET is not set
# CONFIG_PKG_USING_WIZNET is not set # CONFIG_PKG_USING_WIZNET is not set
@ -372,13 +388,34 @@ CONFIG_RT_USING_LWP=y
# CONFIG_PKG_USING_GAGENT_CLOUD is not set # CONFIG_PKG_USING_GAGENT_CLOUD is not set
# CONFIG_PKG_USING_ALI_IOTKIT is not set # CONFIG_PKG_USING_ALI_IOTKIT is not set
# CONFIG_PKG_USING_AZURE is not set # CONFIG_PKG_USING_AZURE is not set
# CONFIG_PKG_USING_TENCENT_IOTHUB 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_NIMBLE is not set
# CONFIG_PKG_USING_OTA_DOWNLOADER is not set # CONFIG_PKG_USING_OTA_DOWNLOADER is not set
# CONFIG_PKG_USING_IPMSG is not set # CONFIG_PKG_USING_IPMSG is not set
# CONFIG_PKG_USING_LSSDP is not set # CONFIG_PKG_USING_LSSDP is not set
# CONFIG_PKG_USING_AIRKISS_OPEN is not set # CONFIG_PKG_USING_AIRKISS_OPEN is not set
# CONFIG_PKG_USING_LIBRWS 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 # security packages
@ -386,6 +423,8 @@ CONFIG_RT_USING_LWP=y
# CONFIG_PKG_USING_MBEDTLS is not set # CONFIG_PKG_USING_MBEDTLS is not set
# CONFIG_PKG_USING_libsodium is not set # CONFIG_PKG_USING_libsodium is not set
# CONFIG_PKG_USING_TINYCRYPT 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 # language packages
@ -400,6 +439,11 @@ CONFIG_RT_USING_LWP=y
# CONFIG_PKG_USING_OPENMV is not set # CONFIG_PKG_USING_OPENMV is not set
# CONFIG_PKG_USING_MUPDF is not set # CONFIG_PKG_USING_MUPDF is not set
# CONFIG_PKG_USING_STEMWIN 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 # tools packages
@ -411,7 +455,31 @@ CONFIG_RT_USING_LWP=y
# CONFIG_PKG_USING_RDB is not set # CONFIG_PKG_USING_RDB is not set
# CONFIG_PKG_USING_QRCODE is not set # CONFIG_PKG_USING_QRCODE is not set
# CONFIG_PKG_USING_ULOG_EASYFLASH 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_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
# CONFIG_PKG_USING_MICRO_XRCE_DDS_CLIENT is not set
# CONFIG_PKG_USING_LWLOG is not set
# CONFIG_PKG_USING_ANV_TRACE is not set
# CONFIG_PKG_USING_ANV_MEMLEAK is not set
# CONFIG_PKG_USING_ANV_TESTSUIT is not set
# CONFIG_PKG_USING_ANV_BENCH is not set
# #
# system packages # system packages
@ -423,6 +491,7 @@ CONFIG_RT_USING_LWP=y
# CONFIG_PKG_USING_LWEXT4 is not set # CONFIG_PKG_USING_LWEXT4 is not set
# CONFIG_PKG_USING_PARTITION is not set # CONFIG_PKG_USING_PARTITION is not set
# CONFIG_PKG_USING_FAL is not set # CONFIG_PKG_USING_FAL is not set
# CONFIG_PKG_USING_FLASHDB is not set
# CONFIG_PKG_USING_SQLITE is not set # CONFIG_PKG_USING_SQLITE is not set
# CONFIG_PKG_USING_RTI is not set # CONFIG_PKG_USING_RTI is not set
# CONFIG_PKG_USING_LITTLEVGL2RTT is not set # CONFIG_PKG_USING_LITTLEVGL2RTT is not set
@ -430,6 +499,32 @@ CONFIG_RT_USING_LWP=y
# CONFIG_PKG_USING_DFS_YAFFS is not set # CONFIG_PKG_USING_DFS_YAFFS is not set
# CONFIG_PKG_USING_LITTLEFS is not set # CONFIG_PKG_USING_LITTLEFS is not set
# CONFIG_PKG_USING_THREAD_POOL 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 is not set
# 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_KPRINTF_THREADSAFE 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
# CONFIG_PKG_USING_LPM is not set
# #
# peripheral libraries and drivers # peripheral libraries and drivers
@ -437,6 +532,8 @@ CONFIG_RT_USING_LWP=y
# CONFIG_PKG_USING_SENSORS_DRIVERS is not set # CONFIG_PKG_USING_SENSORS_DRIVERS is not set
# CONFIG_PKG_USING_REALTEK_AMEBA is not set # CONFIG_PKG_USING_REALTEK_AMEBA is not set
# CONFIG_PKG_USING_SHT2X 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_STM32_SDIO is not set
# CONFIG_PKG_USING_ICM20608 is not set # CONFIG_PKG_USING_ICM20608 is not set
# CONFIG_PKG_USING_U8G2 is not set # CONFIG_PKG_USING_U8G2 is not set
@ -445,10 +542,16 @@ CONFIG_RT_USING_LWP=y
# CONFIG_PKG_USING_SX12XX is not set # CONFIG_PKG_USING_SX12XX is not set
# CONFIG_PKG_USING_SIGNAL_LED is not set # CONFIG_PKG_USING_SIGNAL_LED is not set
# CONFIG_PKG_USING_LEDBLINK 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_WM_LIBRARIES is not set
# CONFIG_PKG_USING_KENDRYTE_SDK is not set # CONFIG_PKG_USING_KENDRYTE_SDK is not set
# CONFIG_PKG_USING_INFRARED is not set # CONFIG_PKG_USING_INFRARED is not set
# CONFIG_PKG_USING_ROSSERIAL 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_AT24CXX is not set
# CONFIG_PKG_USING_MOTIONDRIVER2RTT is not set # CONFIG_PKG_USING_MOTIONDRIVER2RTT is not set
# CONFIG_PKG_USING_AD7746 is not set # CONFIG_PKG_USING_AD7746 is not set
@ -456,6 +559,34 @@ CONFIG_RT_USING_LWP=y
# CONFIG_PKG_USING_I2C_TOOLS is not set # CONFIG_PKG_USING_I2C_TOOLS is not set
# CONFIG_PKG_USING_NRF24L01 is not set # CONFIG_PKG_USING_NRF24L01 is not set
# CONFIG_PKG_USING_TOUCH_DRIVERS 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 # miscellaneous packages
@ -465,13 +596,17 @@ CONFIG_RT_USING_LWP=y
# CONFIG_PKG_USING_FASTLZ is not set # CONFIG_PKG_USING_FASTLZ is not set
# CONFIG_PKG_USING_MINILZO is not set # CONFIG_PKG_USING_MINILZO is not set
# CONFIG_PKG_USING_QUICKLZ 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_MULTIBUTTON is not set
# CONFIG_PKG_USING_FLEXIBLE_BUTTON is not set
# CONFIG_PKG_USING_CANFESTIVAL is not set # CONFIG_PKG_USING_CANFESTIVAL is not set
# CONFIG_PKG_USING_ZLIB is not set # CONFIG_PKG_USING_ZLIB is not set
# CONFIG_PKG_USING_DSTR is not set # CONFIG_PKG_USING_DSTR is not set
# CONFIG_PKG_USING_TINYFRAME is not set # CONFIG_PKG_USING_TINYFRAME is not set
# CONFIG_PKG_USING_KENDRYTE_DEMO is not set # CONFIG_PKG_USING_KENDRYTE_DEMO is not set
# CONFIG_PKG_USING_DIGITALCTRL 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 # samples: kernel and components samples
@ -482,7 +617,28 @@ CONFIG_RT_USING_LWP=y
# CONFIG_PKG_USING_PERIPHERAL_SAMPLES is not set # CONFIG_PKG_USING_PERIPHERAL_SAMPLES is not set
# CONFIG_PKG_USING_HELLO is not set # CONFIG_PKG_USING_HELLO is not set
# CONFIG_PKG_USING_VI is not set # CONFIG_PKG_USING_VI is not set
# CONFIG_PKG_USING_KI is not set
# CONFIG_PKG_USING_NNOM 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
# CONFIG_PKG_USING_MCURSES is not set
# CONFIG_PKG_USING_COWSAY is not set
CONFIG_SOC_VEXPRESS_A9=y CONFIG_SOC_VEXPRESS_A9=y
CONFIG_RT_USING_UART0=y CONFIG_RT_USING_UART0=y
CONFIG_RT_USING_UART1=y CONFIG_RT_USING_UART1=y

View File

@ -34,7 +34,7 @@ QEMU/VExpress A9是QEMU模拟器针对ARM VExpress-A9 FPGA开发板进行软件
## 3. 执行 ## 3. 执行
当要执行编译好的RT-Thread时在这个bsp目录下已经提供了运行脚本文件qemu.bat/qemu.sh 当要执行编译好的RT-Thread时在这个bsp目录下已经提供了运行脚本文件qemu.bat和qemu.sh。可以在bsp目录下运行env在env中敲入qemu.bat即可直接运行。
这个执行脚本默认把串口输出到stdio即控制台所以直接执行脚本后就可以输出结果了。 这个执行脚本默认把串口输出到stdio即控制台所以直接执行脚本后就可以输出结果了。
@ -99,7 +99,7 @@ start qemu-system-arm -M vexpress-a9 -kernel rtthread.elf -serial stdio -sd sd.b
维护人:[bernard][4] 维护人:[bernard][4]
[1]: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.subset.boards.express/index.html [1]: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.subset.boards.express/index.html
[2]: https://www.rt-thread.org/page/download.html [2]: https://www.rt-thread.org/page/download.html
[3]: https://launchpad.net/gcc-arm-embedded/5.0/5-2016-q3-update/+download/gcc-arm-none-eabi-5_4-2016q3-20160926-linux.tar.bz2 [3]: https://launchpad.net/gcc-arm-embedded/5.0/5-2016-q3-update/+download/gcc-arm-none-eabi-5_4-2016q3-20160926-linux.tar.bz2
[4]: https://github.com/BernardXiong [4]: https://github.com/BernardXiong

View File

@ -21,6 +21,9 @@
#define RT_USING_TIMER_SOFT #define RT_USING_TIMER_SOFT
#define RT_TIMER_THREAD_PRIO 4 #define RT_TIMER_THREAD_PRIO 4
#define RT_TIMER_THREAD_STACK_SIZE 1024 #define RT_TIMER_THREAD_STACK_SIZE 1024
/* kservice optimization */
#define RT_DEBUG #define RT_DEBUG
#define RT_DEBUG_COLOR #define RT_DEBUG_COLOR
@ -49,7 +52,7 @@
#define RT_USING_CONSOLE #define RT_USING_CONSOLE
#define RT_CONSOLEBUF_SIZE 256 #define RT_CONSOLEBUF_SIZE 256
#define RT_CONSOLE_DEVICE_NAME "uart0" #define RT_CONSOLE_DEVICE_NAME "uart0"
#define RT_VER_NUM 0x40002 #define RT_VER_NUM 0x40004
#define ARCH_ARM #define ARCH_ARM
#define ARCH_ARM_CORTEX_A #define ARCH_ARM_CORTEX_A
#define ARCH_ARM_CORTEX_A9 #define ARCH_ARM_CORTEX_A9
@ -84,9 +87,9 @@
#define RT_USING_DFS #define RT_USING_DFS
#define DFS_USING_WORKDIR #define DFS_USING_WORKDIR
#define DFS_FILESYSTEMS_MAX 2 #define DFS_FILESYSTEMS_MAX 4
#define DFS_FILESYSTEM_TYPES_MAX 8 #define DFS_FILESYSTEM_TYPES_MAX 8
#define DFS_FD_MAX 16 #define DFS_FD_MAX 32
#define RT_USING_DFS_ELMFAT #define RT_USING_DFS_ELMFAT
/* elm-chan's FatFs, Generic FAT Filesystem Module */ /* elm-chan's FatFs, Generic FAT Filesystem Module */
@ -95,6 +98,8 @@
#define RT_DFS_ELM_WORD_ACCESS #define RT_DFS_ELM_WORD_ACCESS
#define RT_DFS_ELM_USE_LFN_3 #define RT_DFS_ELM_USE_LFN_3
#define RT_DFS_ELM_USE_LFN 3 #define RT_DFS_ELM_USE_LFN 3
#define RT_DFS_ELM_LFN_UNICODE_0
#define RT_DFS_ELM_LFN_UNICODE 0
#define RT_DFS_ELM_MAX_LFN 255 #define RT_DFS_ELM_MAX_LFN 255
#define RT_DFS_ELM_DRIVES 2 #define RT_DFS_ELM_DRIVES 2
#define RT_DFS_ELM_MAX_SECTOR_SIZE 4096 #define RT_DFS_ELM_MAX_SECTOR_SIZE 4096
@ -132,14 +137,9 @@
#define RT_USING_SFUD #define RT_USING_SFUD
#define RT_SFUD_USING_SFDP #define RT_SFUD_USING_SFDP
#define RT_SFUD_USING_FLASH_INFO_TABLE #define RT_SFUD_USING_FLASH_INFO_TABLE
#define RT_SFUD_SPI_MAX_HZ 50000000
#define RT_USING_WDT #define RT_USING_WDT
/* Using Hardware Crypto drivers */
/* Using WiFi */
/* Using USB */ /* Using USB */
@ -151,13 +151,16 @@
#define RT_USING_POSIX #define RT_USING_POSIX
#define RT_USING_POSIX_MMAP #define RT_USING_POSIX_MMAP
#define RT_USING_POSIX_TERMIOS #define RT_USING_POSIX_TERMIOS
#define RT_USING_POSIX_GETLINE
#define RT_USING_POSIX_AIO #define RT_USING_POSIX_AIO
#define RT_LIBC_FIXED_TIMEZONE 8
/* Network */ /* Network */
/* Socket abstraction layer */ /* Socket abstraction layer */
#define RT_USING_SAL #define RT_USING_SAL
#define SAL_INTERNET_CHECK
/* protocol stack implement */ /* protocol stack implement */
@ -177,7 +180,8 @@
/* light weight TCP/IP stack */ /* light weight TCP/IP stack */
#define RT_USING_LWIP #define RT_USING_LWIP
#define RT_USING_LWIP202 #define RT_USING_LWIP212
#define RT_LWIP_MEM_ALIGNMENT 4
#define RT_LWIP_ICMP #define RT_LWIP_ICMP
#define RT_LWIP_DNS #define RT_LWIP_DNS
#define RT_LWIP_DHCP #define RT_LWIP_DHCP
@ -213,12 +217,10 @@
#define LWIP_SO_RCVTIMEO 1 #define LWIP_SO_RCVTIMEO 1
#define LWIP_SO_SNDTIMEO 1 #define LWIP_SO_SNDTIMEO 1
#define LWIP_SO_RCVBUF 1 #define LWIP_SO_RCVBUF 1
#define LWIP_SO_LINGER 0
#define LWIP_NETIF_LOOPBACK 0 #define LWIP_NETIF_LOOPBACK 0
#define RT_LWIP_USING_PING #define RT_LWIP_USING_PING
/* Modbus master and slave stack */
/* AT commands */ /* AT commands */
@ -226,6 +228,7 @@
/* Utilities */ /* Utilities */
#define RT_USING_LWP #define RT_USING_LWP
/* RT-Thread online packages */ /* RT-Thread online packages */
@ -259,6 +262,9 @@
/* system packages */ /* system packages */
/* Micrium: Micrium software products porting for RT-Thread */
/* peripheral libraries and drivers */ /* peripheral libraries and drivers */
@ -267,6 +273,9 @@
/* samples: kernel and components samples */ /* samples: kernel and components samples */
/* games: games run on RT-Thread console */
#define SOC_VEXPRESS_A9 #define SOC_VEXPRESS_A9
#define RT_USING_UART0 #define RT_USING_UART0
#define RT_USING_UART1 #define RT_USING_UART1

View File

@ -17,6 +17,7 @@ menu "Onboard Peripheral Drivers"
config BSP_USING_COM2 config BSP_USING_COM2
bool "Enable COM2 (uart2 pin conflict with Ethernet and PWM)" bool "Enable COM2 (uart2 pin conflict with Ethernet and PWM)"
depends on (!BSP_USING_ETH && !BSP_USING_PWM)
select BSP_USING_UART select BSP_USING_UART
select BSP_USING_UART2 select BSP_USING_UART2
default n default n
@ -45,15 +46,24 @@ menu "Onboard Peripheral Drivers"
bool "Enable I2C EEPROM (i2c1)" bool "Enable I2C EEPROM (i2c1)"
select BSP_USING_I2C1 select BSP_USING_I2C1
default n default n
config PHY_USING_LAN8720A
bool
config BSP_USING_ETH config BSP_USING_ETH
bool "Enable Ethernet" bool "Enable Ethernet"
default n default n
select RT_USING_LWIP select RT_USING_LWIP
select PHY_USING_LAN8720A select RT_LWIP_USING_HW_CHECKSUM
config BSP_USING_ETH_SAL
bool "Enable Ethernet with SAL"
depends on BSP_USING_ETH
default y
select RT_USING_SAL
select SAL_USING_POSIX
config PHY_USING_LAN8720A
bool
depends on BSP_USING_ETH
default y
config BSP_USING_MPU6050 config BSP_USING_MPU6050
bool "Enable MPU6050 (i2c1)" bool "Enable MPU6050 (i2c1)"
@ -67,12 +77,12 @@ menu "Onboard Peripheral Drivers"
select RT_USING_DFS select RT_USING_DFS
select RT_USING_DFS_ELMFAT select RT_USING_DFS_ELMFAT
default n default n
if BSP_USING_SDCARD
config SDIO_MAX_FREQ config SDIO_MAX_FREQ
int "sdio max freq" int "sdio max freq"
range 0 24000000 range 0 24000000
depends on BSP_USING_SDCARD
default 1000000 default 1000000
endif
endmenu endmenu

View File

@ -6,6 +6,7 @@
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes
* 2018-12-13 balanceTWK add sdcard port file * 2018-12-13 balanceTWK add sdcard port file
* 2021-05-10 Meco Man fix a bug that cannot use fatfs in the main thread at starting up
*/ */
#include <rtthread.h> #include <rtthread.h>
@ -20,7 +21,7 @@
#define DBG_LVL DBG_INFO #define DBG_LVL DBG_INFO
#include <rtdbg.h> #include <rtdbg.h>
void sd_mount(void *parameter) static void sd_mount(void *parameter)
{ {
while (1) while (1)
{ {
@ -40,23 +41,30 @@ void sd_mount(void *parameter)
} }
} }
int stm32_sdcard_mount(void) static int onboard_sdcard_mount(void)
{ {
rt_thread_t tid; rt_thread_t tid;
tid = rt_thread_create("sd_mount", sd_mount, RT_NULL, if (dfs_mount("sd0", "/", "elm", 0, 0) == RT_EOK)
1024, RT_THREAD_PRIORITY_MAX - 2, 20);
if (tid != RT_NULL)
{ {
rt_thread_startup(tid); LOG_I("sd card mount to '/'");
} }
else else
{ {
LOG_E("create sd_mount thread err!"); tid = rt_thread_create("sd_mount", sd_mount, RT_NULL,
1024, RT_THREAD_PRIORITY_MAX - 2, 20);
if (tid != RT_NULL)
{
rt_thread_startup(tid);
}
else
{
LOG_E("create sd_mount thread err!");
}
} }
return RT_EOK; return RT_EOK;
} }
INIT_APP_EXPORT(stm32_sdcard_mount); INIT_APP_EXPORT(onboard_sdcard_mount);
#endif /* BSP_USING_SDCARD */ #endif /* BSP_USING_SDCARD */

View File

@ -13,7 +13,7 @@
#include <board.h> #include <board.h>
#ifdef BSP_USING_SRAM #ifdef BSP_USING_SRAM
#include <sram_port.h> #include "drv_sram.h"
#define DRV_DEBUG #define DRV_DEBUG
#define LOG_TAG "drv.sram" #define LOG_TAG "drv.sram"

View File

@ -19,16 +19,9 @@
#include <sys/types.h> #include <sys/types.h>
#include <sys/time.h> #include <sys/time.h>
/* errno for Keil MDK */
#if defined(__CC_ARM) || defined(__IAR_SYSTEMS_ICC__)
#include <sys/errno.h>
#include <sys/unistd.h>
#else
#include <unistd.h> #include <unistd.h>
#include <errno.h> #include <errno.h>
#include <fcntl.h> #include <fcntl.h>
#endif
#endif #endif

View File

@ -46,17 +46,16 @@
#define X32_F "lx" #define X32_F "lx"
#ifdef RT_USING_LIBC #ifdef RT_USING_LIBC
#if defined(__CC_ARM) || defined(__CLANG_ARM) || defined(__IAR_SYSTEMS_ICC__)
#include <sys/errno.h>
#else
#include <errno.h> #include <errno.h>
/* some errno not defined in newlib */ #ifndef ENSRNOTFOUND
#define ENSRNOTFOUND 163 /* Domain name not found */ #define ENSRNOTFOUND 163 /* Domain name not found */
#endif
#ifndef ESHUTDOWN
/* WARNING: ESHUTDOWN also not defined in newlib. We chose /* WARNING: ESHUTDOWN also not defined in newlib. We chose
180 here because the number "108" which is used 180 here because the number "108" which is used
in arch.h has been assigned to another error code. */ in arch.h has been assigned to another error code. */
#define ESHUTDOWN 180 #define ESHUTDOWN 180
#endif /* __CC_ARM/__IAR_SYSTEMS_ICC__ */ #endif
#endif /* RT_USING_LIBC */ #endif /* RT_USING_LIBC */
#if defined(RT_USING_LIBC) || defined(RT_LIBC_USING_TIME) || (defined( __GNUC__ ) && !defined(__ARMCC_VERSION)) #if defined(RT_USING_LIBC) || defined(RT_LIBC_USING_TIME) || (defined( __GNUC__ ) && !defined(__ARMCC_VERSION))

79
examples/utest/README.md Normal file
View File

@ -0,0 +1,79 @@
# RT-Thread 测试用例集合
## 简介
为了保证某一部分代码的质量,通常可以通过编写测试用例的方式,验证此代码的功能。为了保证 RT-Thread 相关仓库的代码质量,我们基于 utest 框架搭建了一套简易的自动化测试环境。有兴趣,有精力的小伙伴可以利用这套机制完善自己的代码检查。如果有意愿让社区上更多的小伙伴收益,也可以在提交代码的时候,把对应的测试用例也提交上来。
## 目录结构
| 目录 | 用途 |
| --------- | ------------------------------------------------------------ |
| configs | 配置文件集合每一个目录代表一种功能集合kernel,net等 |
| testcases | 测试用例源代码 |
## 如何贡献
### 1. 编写测试用例
参考已有的测试用例在 [examples\utest\testcases](./testcases) 目录下添加自己的测试用例。测试用例的编写方法参考文档中心《utest 测试框架》章节。
### 2. 本地测试
1. 在 `bsp\qemu-vexpress-a9` 目录下打开 `menuconfig`,使能对应的测试用例,如下:
```
RT-Thread Utestcases --->
[*] RT-Thread Utestcases
Utest Self Testcase --->
[*] Pass test
```
2. 保存并退出,输入 scons 编译当前 bsp。
3. 输入 .\qemu.bat 运行当前 bsp在 msh 环境下执行 utest_run 命令,验证代码运行是否正常。
```
msh />utest_run
[I/utest] [==========] [ utest ] loop 1/1
[I/utest] [==========] [ utest ] started
[I/utest] [----------] [ testcase ] (testcases.utest.pass_tc) started
[D/utest] [ OK ] [ unit ] (test_assert_pass:16) is passed
[D/utest] [ OK ] [ unit ] (test_assert_pass:17) is passed
[D/utest] [ OK ] [ unit ] (test_assert_pass:19) is passed
[D/utest] [ OK ] [ unit ] (test_assert_pass:20) is passed
[D/utest] [ OK ] [ unit ] (test_assert_pass:22) is passed
[D/utest] [ OK ] [ unit ] (test_assert_pass:23) is passed
[D/utest] [ OK ] [ unit ] (test_assert_pass:25) is passed
[D/utest] [ OK ] [ unit ] (test_assert_pass:26) is passed
[D/utest] [ OK ] [ unit ] (test_assert_pass:28) is passed
[D/utest] [ OK ] [ unit ] (test_assert_pass:29) is passed
[I/utest] [ PASSED ] [ result ] testcase (testcases.utest.pass_tc)
[I/utest] [----------] [ testcase ] (testcases.utest.pass_tc) finished
[I/utest] [==========] [ utest ] finished
```
### 3. 提交
1. 如果是对已有测试集合的完善,需要把添加的测试用例的配置项添加到对应测试集合的配置文件里,如:[examples\utest\configs\utest_self\config.h](./configs/utest_self/config.h)。
```
/* RT-Thread Utestcases */
#define RT_USING_UTESTCASES
/* Utest Self Testcase */
#define UTEST_SELF_PASS_TC
/* xxx Testcase */
#define UTEST_XXX_TC
```
2. 如果要添加新的测试集合,需要参考已有的测试集合,在 [examples\utest\configs](./configs) 目录下添加新的测试集合配置项。并更新 [.github\workflows\action_utest.yml](../../.github/workflows/action_utest.yml) 内的测试集合。
```
- {UTEST: "kernel/ipc", RTT_BSP: "bsp/qemu-vexpress-a9", QEMU_ARCH: "vexpress-a9", CONFIG_FILE: "examples/utest/configs/utest_self/config.h"}
- {UTEST: "components/utest", RTT_BSP: "bsp/qemu-vexpress-a9", QEMU_ARCH: "vexpress-a9", CONFIG_FILE: "examples/utest/configs/utest_self/config.h"}
```
3. 向 RT-Thread 主仓库提交合并请求。

View File

@ -0,0 +1,297 @@
#ifndef RT_CONFIG_H__
#define RT_CONFIG_H__
/* Automatically generated file; DO NOT EDIT. */
/* RT-Thread Project Configuration */
/* RT-Thread Kernel */
#define RT_NAME_MAX 8
#define RT_USING_SMP
#define RT_CPUS_NR 2
#define RT_ALIGN_SIZE 4
#define RT_THREAD_PRIORITY_32
#define RT_THREAD_PRIORITY_MAX 32
#define RT_TICK_PER_SECOND 100
#define RT_USING_OVERFLOW_CHECK
#define RT_USING_HOOK
#define RT_USING_IDLE_HOOK
#define RT_IDLE_HOOK_LIST_SIZE 4
#define IDLE_THREAD_STACK_SIZE 1024
#define RT_USING_TIMER_SOFT
#define RT_TIMER_THREAD_PRIO 4
#define RT_TIMER_THREAD_STACK_SIZE 1024
/* kservice optimization */
#define RT_DEBUG
#define RT_DEBUG_COLOR
/* Inter-Thread communication */
#define RT_USING_SEMAPHORE
#define RT_USING_MUTEX
#define RT_USING_EVENT
#define RT_USING_MAILBOX
#define RT_USING_MESSAGEQUEUE
#define RT_USING_SIGNALS
/* Memory Management */
#define RT_USING_MEMPOOL
#define RT_USING_MEMHEAP
#define RT_USING_SMALL_MEM
#define RT_USING_MEMTRACE
#define RT_USING_HEAP
/* Kernel Device Object */
#define RT_USING_DEVICE
#define RT_USING_DEVICE_OPS
#define RT_USING_INTERRUPT_INFO
#define RT_USING_CONSOLE
#define RT_CONSOLEBUF_SIZE 256
#define RT_CONSOLE_DEVICE_NAME "uart0"
#define RT_VER_NUM 0x40004
#define ARCH_ARM
#define ARCH_ARM_CORTEX_A
#define ARCH_ARM_CORTEX_A9
/* RT-Thread Components */
#define RT_USING_COMPONENTS_INIT
#define RT_USING_USER_MAIN
#define RT_MAIN_THREAD_STACK_SIZE 2048
#define RT_MAIN_THREAD_PRIORITY 10
/* C++ features */
#define RT_USING_CPLUSPLUS
/* Command shell */
#define RT_USING_FINSH
#define FINSH_THREAD_NAME "tshell"
#define FINSH_USING_HISTORY
#define FINSH_HISTORY_LINES 5
#define FINSH_USING_SYMTAB
#define FINSH_USING_DESCRIPTION
#define FINSH_THREAD_PRIORITY 20
#define FINSH_THREAD_STACK_SIZE 4096
#define FINSH_CMD_SIZE 80
#define FINSH_USING_MSH
#define FINSH_USING_MSH_DEFAULT
#define FINSH_ARG_MAX 10
/* Device virtual file system */
#define RT_USING_DFS
#define DFS_USING_WORKDIR
#define DFS_FILESYSTEMS_MAX 2
#define DFS_FILESYSTEM_TYPES_MAX 8
#define DFS_FD_MAX 16
#define RT_USING_DFS_ELMFAT
/* elm-chan's FatFs, Generic FAT Filesystem Module */
#define RT_DFS_ELM_CODE_PAGE 437
#define RT_DFS_ELM_WORD_ACCESS
#define RT_DFS_ELM_USE_LFN_3
#define RT_DFS_ELM_USE_LFN 3
#define RT_DFS_ELM_LFN_UNICODE_0
#define RT_DFS_ELM_LFN_UNICODE 0
#define RT_DFS_ELM_MAX_LFN 255
#define RT_DFS_ELM_DRIVES 2
#define RT_DFS_ELM_MAX_SECTOR_SIZE 4096
#define RT_DFS_ELM_REENTRANT
#define RT_USING_DFS_DEVFS
#define RT_USING_DFS_ROMFS
#define RT_USING_DFS_RAMFS
/* Device Drivers */
#define RT_USING_DEVICE_IPC
#define RT_PIPE_BUFSZ 512
#define RT_USING_SYSTEM_WORKQUEUE
#define RT_SYSTEM_WORKQUEUE_STACKSIZE 2048
#define RT_SYSTEM_WORKQUEUE_PRIORITY 23
#define RT_USING_SERIAL
#define RT_SERIAL_USING_DMA
#define RT_SERIAL_RB_BUFSZ 64
#define RT_USING_I2C
#define RT_USING_I2C_BITOPS
#define RT_USING_PIN
#define RT_USING_MTD_NOR
#define RT_USING_MTD_NAND
#define RT_MTD_NAND_DEBUG
#define RT_USING_RTC
#define RT_USING_SOFT_RTC
#define RT_USING_SDIO
#define RT_SDIO_STACK_SIZE 512
#define RT_SDIO_THREAD_PRIORITY 15
#define RT_MMCSD_STACK_SIZE 1024
#define RT_MMCSD_THREAD_PREORITY 22
#define RT_MMCSD_MAX_PARTITION 16
#define RT_USING_SPI
#define RT_USING_SPI_MSD
#define RT_USING_SFUD
#define RT_SFUD_USING_SFDP
#define RT_SFUD_USING_FLASH_INFO_TABLE
#define RT_SFUD_SPI_MAX_HZ 50000000
#define RT_USING_WDT
/* Using USB */
/* POSIX layer and C standard library */
#define RT_USING_LIBC
#define RT_USING_PTHREADS
#define PTHREAD_NUM_MAX 8
#define RT_USING_POSIX
#define RT_USING_POSIX_MMAP
#define RT_USING_POSIX_TERMIOS
#define RT_USING_POSIX_AIO
#define RT_LIBC_FIXED_TIMEZONE 8
/* Network */
/* Socket abstraction layer */
#define RT_USING_SAL
#define SAL_INTERNET_CHECK
/* protocol stack implement */
#define SAL_USING_LWIP
#define SAL_USING_POSIX
/* Network interface device */
#define RT_USING_NETDEV
#define NETDEV_USING_IFCONFIG
#define NETDEV_USING_PING
#define NETDEV_USING_NETSTAT
#define NETDEV_USING_AUTO_DEFAULT
#define NETDEV_IPV4 1
#define NETDEV_IPV6 0
/* light weight TCP/IP stack */
#define RT_USING_LWIP
#define RT_USING_LWIP202
#define RT_LWIP_MEM_ALIGNMENT 4
#define RT_LWIP_ICMP
#define RT_LWIP_DNS
#define RT_LWIP_DHCP
#define IP_SOF_BROADCAST 1
#define IP_SOF_BROADCAST_RECV 1
/* Static IPv4 Address */
#define RT_LWIP_IPADDR "192.168.1.30"
#define RT_LWIP_GWADDR "192.168.1.1"
#define RT_LWIP_MSKADDR "255.255.255.0"
#define RT_LWIP_UDP
#define RT_LWIP_TCP
#define RT_LWIP_RAW
#define RT_MEMP_NUM_NETCONN 8
#define RT_LWIP_PBUF_NUM 16
#define RT_LWIP_RAW_PCB_NUM 4
#define RT_LWIP_UDP_PCB_NUM 4
#define RT_LWIP_TCP_PCB_NUM 4
#define RT_LWIP_TCP_SEG_NUM 40
#define RT_LWIP_TCP_SND_BUF 8196
#define RT_LWIP_TCP_WND 8196
#define RT_LWIP_TCPTHREAD_PRIORITY 10
#define RT_LWIP_TCPTHREAD_MBOX_SIZE 8
#define RT_LWIP_TCPTHREAD_STACKSIZE 1024
#define RT_LWIP_ETHTHREAD_PRIORITY 12
#define RT_LWIP_ETHTHREAD_STACKSIZE 1024
#define RT_LWIP_ETHTHREAD_MBOX_SIZE 8
#define RT_LWIP_REASSEMBLY_FRAG
#define LWIP_NETIF_STATUS_CALLBACK 1
#define LWIP_NETIF_LINK_CALLBACK 1
#define SO_REUSE 1
#define LWIP_SO_RCVTIMEO 1
#define LWIP_SO_SNDTIMEO 1
#define LWIP_SO_RCVBUF 1
#define LWIP_SO_LINGER 0
#define LWIP_NETIF_LOOPBACK 0
#define RT_LWIP_USING_PING
/* AT commands */
/* VBUS(Virtual Software BUS) */
/* Utilities */
#define RT_USING_UTEST
#define UTEST_THR_STACK_SIZE 4096
#define UTEST_THR_PRIORITY 20
#define RT_USING_LWP
/* RT-Thread Utestcases */
#define RT_USING_UTESTCASES
/* Utest Self Testcase */
#define UTEST_SELF_PASS_TC
/* RT-Thread online packages */
/* IoT - internet of things */
/* Wi-Fi */
/* Marvell WiFi */
/* Wiced WiFi */
/* IoT Cloud */
/* security packages */
/* language packages */
/* multimedia packages */
/* tools packages */
/* system packages */
/* Micrium: Micrium software products porting for RT-Thread */
/* peripheral libraries and drivers */
/* AI packages */
/* miscellaneous packages */
/* samples: kernel and components samples */
/* entertainment: terminal games and other interesting software packages */
#define SOC_VEXPRESS_A9
#define RT_USING_UART0
#define RT_USING_UART1
#define BSP_DRV_EMAC
#endif

View File

@ -0,0 +1,14 @@
menu "RT-Thread Utestcases"
config RT_USING_UTESTCASES
bool "RT-Thread Utestcases"
default n
select RT_USING_UTEST
if RT_USING_UTESTCASES
source "$RTT_DIR/examples/utest/testcases/utest/Kconfig"
endif
endmenu

View File

@ -0,0 +1,15 @@
# RT-Thread building script for bridge
import os
from building import *
cwd = GetCurrentDir()
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')

View File

@ -0,0 +1,7 @@
menu "Utest Self Testcase"
config UTEST_SELF_PASS_TC
bool "Pass test"
default y
endmenu

View File

@ -0,0 +1,13 @@
Import('rtconfig')
from building import *
cwd = GetCurrentDir()
src = Split('''
pass_tc.c
''')
CPPPATH = [cwd]
group = DefineGroup('utestcases', src, depend = ['UTEST_SELF_PASS_TC'], CPPPATH = CPPPATH)
Return('group')

View File

@ -0,0 +1,46 @@
/*
* Copyright (c) 2006-2019, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2019-01-16 MurphyZhao the first version
*/
#include <rtthread.h>
#include "utest.h"
static void test_assert_pass(void)
{
uassert_true(1);
uassert_false(0);
uassert_null(RT_NULL);
uassert_not_null(!RT_NULL);
uassert_int_equal(1, 1);
uassert_int_not_equal(1, 2);
uassert_str_equal("Hello RT-Thread!", "Hello RT-Thread!");
uassert_str_not_equal("Hello RT-Thread!", "Hello");
uassert_in_range(2048, 1024, 4096);
uassert_not_in_range(0, 1024, 4096);
}
static rt_err_t utest_tc_init(void)
{
return RT_EOK;
}
static rt_err_t utest_tc_cleanup(void)
{
return RT_EOK;
}
static void testcase(void)
{
UTEST_UNIT_RUN(test_assert_pass);
}
UTEST_TC_EXPORT(testcase, "testcases.utest.pass_tc", utest_tc_init, utest_tc_cleanup, 10);

View File

@ -10,6 +10,8 @@ CPPPATH = [cwd]
if rtconfig.PLATFORM == 'armcc': if rtconfig.PLATFORM == 'armcc':
src += Glob('*_rvds.S') src += Glob('*_rvds.S')
elif rtconfig.PLATFORM == 'armclang':
src += Glob('*_rvds.S')
if rtconfig.PLATFORM == 'gcc': if rtconfig.PLATFORM == 'gcc':
src += Glob('*_init.S') src += Glob('*_init.S')

View File

@ -447,6 +447,10 @@ def PrepareBuilding(env, root_directory, has_libcpu=False, remove_components = [
variant_dir=kernel_vdir + '/components', variant_dir=kernel_vdir + '/components',
duplicate=0, duplicate=0,
exports='remove_components')) exports='remove_components'))
# include testcases
objs.extend(SConscript(Rtt_Root + '/examples/utest/testcases/SConscript',
variant_dir=kernel_vdir + '/examples/utest/testcases',
duplicate=0))
return objs return objs