Merge branch 'prepare_for_master' of https://gitlink.org.cn/xuos/xiuos into lorawan_develop
This commit is contained in:
@@ -4,6 +4,12 @@ export LFLAGS := -mcmodel=medany -march=rv64imafdc -mabi=lp64d -nostartfiles -Wl
|
||||
|
||||
export APPLFLAGS := -mcmodel=medany -march=rv64imafdc -mabi=lp64d -nostartfiles -Wl,--gc-sections,-Map=XiZi-app.map,-cref,-u, -T $(BSP_ROOT)/link_userspace.lds
|
||||
|
||||
ifeq ($(CONFIG_LIB_MUSLLIB), y)
|
||||
export LFLAGS += -nostdlib -nostdinc -fno-builtin -nodefaultlibs
|
||||
export LIBCC := -lgcc
|
||||
export LINK_MUSLLIB := $(KERNEL_ROOT)/lib/musllib/libmusl.a
|
||||
endif
|
||||
|
||||
export CXXFLAGS := -mcmodel=medany -march=rv64imafdc -mabi=lp64d -fno-common -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -O0 -ggdb -Werror
|
||||
|
||||
export CROSS_COMPILE ?=/opt/gnu-mcu-eclipse/riscv-none-gcc/8.2.0-2.1-20190425-1021/bin/riscv-none-embed-
|
||||
|
||||
+53
-36
@@ -437,45 +437,62 @@ SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0) | SHELL_CMD_TYPE(SHELL_TYPE_CMD_FUNC) |
|
||||
wiz_server_op, wiz_server_test,
|
||||
wiz_sock_recv or wiz_sock_send data as tcp server);
|
||||
|
||||
int32_t loopback_udps(uint8_t sn, uint8_t *buf, uint16_t port) {
|
||||
int32_t ret;
|
||||
uint16_t size, sentsize;
|
||||
uint8_t destip[4];
|
||||
uint16_t destport;
|
||||
// uint8_t packinfo = 0;
|
||||
switch (getSn_SR(sn)) {
|
||||
case SOCK_UDP:
|
||||
if ((size = getSn_RX_RSR(sn)) > 0) {
|
||||
if (size > g_wiznet_buf_size) size = g_wiznet_buf_size;
|
||||
ret = wiz_sock_recvfrom(sn, buf, size, destip, (uint16_t *)&destport);
|
||||
if (ret <= 0) {
|
||||
printf("%d: wiz_sock_recvfrom error. %ld\r\n", sn, ret);
|
||||
return ret;
|
||||
}
|
||||
size = (uint16_t)ret;
|
||||
sentsize = 0;
|
||||
while (sentsize != size) {
|
||||
ret = wiz_sock_sendto(sn, buf + sentsize, size - sentsize, destip,
|
||||
destport);
|
||||
if (ret < 0) {
|
||||
printf("%d: wiz_sock_sendto error. %ld\r\n", sn, ret);
|
||||
return ret;
|
||||
}
|
||||
sentsize += ret; // Don't care SOCKERR_BUSY, because it is zero.
|
||||
}
|
||||
}
|
||||
break;
|
||||
case SOCK_CLOSED:
|
||||
printf("%d:LBUStart\r\n", sn);
|
||||
if ((ret = wiz_socket(sn, Sn_MR_UDP, port, 0x00)) != sn) return ret;
|
||||
printf("%d:Opened, port [%d]\r\n", sn, port);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
void loopback_udps(int argc, char *argv[])
|
||||
{
|
||||
/* argv[1]: remote_ip ip address of remote udp
|
||||
* argv[2]: remote_port the port number of the remote udp
|
||||
* argv[2]: local_port the port number of the local udp
|
||||
*/
|
||||
uint32_t tmp_ip[4];
|
||||
uint8_t remote_ip[4];
|
||||
uint16_t remote_port, local_port;
|
||||
uint8_t buffer[g_wiznet_buf_size];
|
||||
uint16_t len = 0;
|
||||
|
||||
if (argc < 4)
|
||||
{
|
||||
KPrintf("loopback_udps test error\n");
|
||||
return;
|
||||
}
|
||||
|
||||
sscanf(argv[1], "%d.%d.%d.%d", &tmp_ip[0], &tmp_ip[1], &tmp_ip[2], &tmp_ip[3]);
|
||||
for(int i = 0;i < 4; i++)
|
||||
{
|
||||
remote_ip[i] = (uint8_t)tmp_ip[i];
|
||||
}
|
||||
|
||||
remote_port = atoi(argv[2]);
|
||||
local_port = atoi(argv[3]);
|
||||
while(1)
|
||||
{
|
||||
switch (getSn_SR(0))
|
||||
{
|
||||
case SOCK_UDP:
|
||||
if(getSn_IR(0) & Sn_IR_RECV)
|
||||
{
|
||||
setSn_IR(0, Sn_IR_RECV);
|
||||
}
|
||||
if((len = getSn_RX_RSR(0))>0)
|
||||
{
|
||||
memset(buffer,0,len+1);
|
||||
wiz_sock_recvfrom(0, buffer, len, remote_ip, (uint16_t *)&remote_port);
|
||||
printf("received msg: %s\n", buffer);
|
||||
wiz_sock_sendto(0, buffer, len, remote_ip, remote_port);
|
||||
}
|
||||
break;
|
||||
|
||||
case SOCK_CLOSED:
|
||||
printf("LBUStart\r\n");
|
||||
wiz_socket(0, Sn_MR_UDP, local_port, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* wiz_udp remote_ip remote_port local_port */
|
||||
SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0) | SHELL_CMD_TYPE(SHELL_TYPE_CMD_MAIN),
|
||||
wiz_udp, loopback_udps, w5500 upd test);
|
||||
|
||||
void ifconfig() {
|
||||
wiz_NetInfo wiz_netinfo;
|
||||
ctlnetwork(CN_GET_NETINFO, (void *)&wiz_netinfo);
|
||||
|
||||
@@ -0,0 +1,252 @@
|
||||
#
|
||||
# Automatically generated file; DO NOT EDIT.
|
||||
# XiZi_IIoT Project Configuration
|
||||
#
|
||||
CONFIG_BOARD_GD32VF103RVSTAR=y
|
||||
CONFIG_ARCH_RISCV=y
|
||||
|
||||
#
|
||||
# gd32vf103-rvstar feature
|
||||
#
|
||||
CONFIG_BSP_USING_GPIO=y
|
||||
CONFIG_PIN_BUS_NAME="pin"
|
||||
CONFIG_PIN_DRIVER_NAME="pin_drv"
|
||||
CONFIG_PIN_DEVICE_NAME="pin_dev"
|
||||
CONFIG_BSP_USING_SYSCLOCK=y
|
||||
CONFIG_BSP_USING_UART=y
|
||||
CONFIG_BSP_USING_UART4=y
|
||||
CONFIG_SERIAL_BUS_NAME_4="uart4"
|
||||
CONFIG_SERIAL_DRV_NAME_4="uart4_drv"
|
||||
CONFIG_SERIAL_4_DEVICE_NAME_4="uart4_dev4"
|
||||
|
||||
#
|
||||
# Hardware feature
|
||||
#
|
||||
CONFIG_RESOURCES_SERIAL=y
|
||||
CONFIG_SERIAL_USING_DMA=y
|
||||
CONFIG_SERIAL_RB_BUFSZ=64
|
||||
CONFIG_RESOURCES_PIN=y
|
||||
|
||||
#
|
||||
# Kernel feature
|
||||
#
|
||||
|
||||
#
|
||||
# separate compile(choose none for compile once)
|
||||
#
|
||||
# CONFIG_SEPARATE_COMPILE is not set
|
||||
# CONFIG_COMPILER_APP is not set
|
||||
|
||||
# CONFIG_COMPILER_KERNEL is not set
|
||||
|
||||
#
|
||||
# Memory Management
|
||||
#
|
||||
# CONFIG_KERNEL_MEMBLOCK is not set
|
||||
CONFIG_MEM_ALIGN_SIZE=4
|
||||
# CONFIG_MEM_EXTERN_SRAM is not set
|
||||
CONFIG_MM_PAGE_SIZE=1024
|
||||
|
||||
#
|
||||
# Using small memory allocator
|
||||
#
|
||||
CONFIG_KERNEL_SMALL_MEM_ALLOC=y
|
||||
CONFIG_SMALL_NUMBER_32B=8
|
||||
CONFIG_SMALL_NUMBER_64B=4
|
||||
|
||||
#
|
||||
# Task feature
|
||||
#
|
||||
CONFIG_USER_APPLICATION=y
|
||||
# CONFIG_TASK_ISOLATION is not set
|
||||
|
||||
#
|
||||
# Inter-Task communication
|
||||
#
|
||||
# CONFIG_KERNEL_SEMAPHORE=y
|
||||
# CONFIG_KERNEL_MUTEX=y
|
||||
# CONFIG_KERNEL_EVENT is not set
|
||||
# CONFIG_KERNEL_MESSAGEQUEUE is not set
|
||||
# CONFIG_KERNEL_SOFTTIMER is not set
|
||||
CONFIG_SCHED_POLICY_RR_REMAINSLICE=y
|
||||
# CONFIG_SCHED_POLICY_RR is not set
|
||||
# CONFIG_SCHED_POLICY_FIFO is not set
|
||||
CONFIG_KTASK_PRIORITY_8=y
|
||||
CONFIG_KTASK_PRIORITY_MAX=8
|
||||
CONFIG_TICK_PER_SECOND=100
|
||||
CONFIG_KERNEL_STACK_OVERFLOW_CHECK=y
|
||||
CONFIG_IDLE_KTASK_STACKSIZE=512
|
||||
CONFIG_ZOMBIE_KTASK_STACKSIZE=512
|
||||
|
||||
#
|
||||
# Kernel Console
|
||||
#
|
||||
CONFIG_KERNEL_CONSOLE=y
|
||||
CONFIG_KERNEL_BANNER=y
|
||||
CONFIG_KERNEL_CONSOLEBUF_SIZE=128
|
||||
|
||||
#
|
||||
# Kernel Hook
|
||||
#
|
||||
# CONFIG_KERNEL_HOOK is not set
|
||||
|
||||
#
|
||||
# Command shell
|
||||
#
|
||||
CONFIG_TOOL_SHELL=y
|
||||
CONFIG_SHELL_TASK_PRIORITY=20
|
||||
CONFIG_SHELL_TASK_STACK_SIZE=2048
|
||||
|
||||
|
||||
# CONFIG_SHELL_ENTER_CRLF is not set
|
||||
|
||||
#
|
||||
# Set shell user control
|
||||
#
|
||||
CONFIG_SHELL_DEFAULT_USER="letter"
|
||||
CONFIG_SHELL_DEFAULT_USER_PASSWORD=""
|
||||
CONFIG_SHELL_LOCK_TIMEOUT=10000
|
||||
# CONFIG_SHELL_ENTER_CR_AND_LF is not set
|
||||
# CONFIG_SHELL_ENTER_CR is not set
|
||||
# CONFIG_SHELL_ENTER_LF is not set
|
||||
|
||||
#
|
||||
# Set shell config param
|
||||
#
|
||||
CONFIG_SHELL_MAX_NUMBER=5
|
||||
CONFIG_SHELL_PARAMETER_MAX_NUMBER=8
|
||||
CONFIG_SHELL_HISTORY_MAX_NUMBER=5
|
||||
CONFIG_SHELL_PRINT_BUFFER=128
|
||||
CONFIG_SHELL_HELP_SHOW_PERMISSION=y
|
||||
# CONFIG_SHELL_HELP_LIST_USER is not set
|
||||
CONFIG_SHELL_HELP_LIST_VAR=y
|
||||
# CONFIG_SHELL_HELP_LIST_KEY is not set
|
||||
|
||||
#
|
||||
# Kernel data structure Manage
|
||||
#
|
||||
CONFIG_KERNEL_QUEUEMANAGE=y
|
||||
# CONFIG_KERNEL_WORKQUEUE is not set
|
||||
CONFIG_WORKQUEUE_KTASK_STACKSIZE=256
|
||||
CONFIG_WORKQUEUE_KTASK_PRIORITY=23
|
||||
CONFIG_QUEUE_MAX=2
|
||||
# CONFIG_KERNEL_WAITQUEUE is not set
|
||||
# CONFIG_KERNEL_DATAQUEUE is not set
|
||||
# CONFIG_KERNEL_CIRCULAR_AREA is not set
|
||||
# CONFIG_KERNEL_AVL_TREE is not set
|
||||
|
||||
#
|
||||
# Kernel components init
|
||||
#
|
||||
CONFIG_KERNEL_COMPONENTS_INIT=y
|
||||
CONFIG_ENV_INIT_KTASK_STACK_SIZE=1024
|
||||
CONFIG_KERNEL_USER_MAIN=y
|
||||
CONFIG_NAME_NUM_MAX=32
|
||||
# CONFIG_KERNEL_DEBUG is not set
|
||||
# CONFIG_ARCH_SMP is not set
|
||||
|
||||
#
|
||||
# hash table config
|
||||
#
|
||||
CONFIG_ID_HTABLE_SIZE=1
|
||||
CONFIG_ID_NUM_MAX=4
|
||||
# CONFIG_KERNEL_TEST is not set
|
||||
|
||||
#
|
||||
# Kernel Lib
|
||||
#
|
||||
CONFIG_LIB=y
|
||||
CONFIG_LIB_POSIX=y
|
||||
CONFIG_LIB_NEWLIB=y
|
||||
# CONFIG_LIB_MUSLLIB is not set
|
||||
# CONFIG_LIB_OTHER is not set
|
||||
|
||||
#
|
||||
# C++ features
|
||||
#
|
||||
# CONFIG_LIB_CPLUSPLUS is not set
|
||||
|
||||
#
|
||||
# File system
|
||||
#
|
||||
CONFIG_FS_VFS=n
|
||||
# CONFIG_FS_CH376 is not set
|
||||
# CONFIG_FS_LWEXT4 is not set
|
||||
|
||||
#
|
||||
# APP_Framework
|
||||
#
|
||||
|
||||
#
|
||||
# Framework
|
||||
#
|
||||
CONFIG_TRANSFORM_LAYER_ATTRIUBUTE=y
|
||||
CONFIG_ADD_XIZI_FETURES=y
|
||||
# CONFIG_ADD_NUTTX_FETURES is not set
|
||||
# CONFIG_ADD_RTTHREAD_FETURES is not set
|
||||
# CONFIG_SUPPORT_SENSOR_FRAMEWORK is not set
|
||||
# CONFIG_SUPPORT_CONNECTION_FRAMEWORK is not set
|
||||
# CONFIG_SUPPORT_KNOWING_FRAMEWORK is not set
|
||||
# CONFIG_SUPPORT_CONTROL_FRAMEWORK is not set
|
||||
|
||||
#
|
||||
# Security
|
||||
#
|
||||
# CONFIG_CRYPTO is not set
|
||||
# CONFIG_MBEDTLS is not set
|
||||
|
||||
#
|
||||
# Applications
|
||||
#
|
||||
|
||||
#
|
||||
# config stack size and priority of main task
|
||||
#
|
||||
CONFIG_MAIN_KTASK_STACK_SIZE=1024
|
||||
CONFIG_MAIN_KTASK_PRIORITY=16
|
||||
|
||||
#
|
||||
# ota app
|
||||
#
|
||||
# CONFIG_APPLICATION_OTA is not set
|
||||
|
||||
#
|
||||
# test app
|
||||
#
|
||||
# CONFIG_USER_TEST is not set
|
||||
|
||||
#
|
||||
# connection app
|
||||
#
|
||||
# CONFIG_APPLICATION_CONNECTION is not set
|
||||
|
||||
#
|
||||
# control app
|
||||
#
|
||||
|
||||
#
|
||||
# knowing app
|
||||
#
|
||||
# CONFIG_APPLICATION_KNOWING is not set
|
||||
|
||||
#
|
||||
# sensor app
|
||||
#
|
||||
# CONFIG_APPLICATION_SENSOR is not set
|
||||
# CONFIG_USING_EMBEDDED_DATABASE_APP is not set
|
||||
# CONFIG_APP_USING_WEBNET is not set
|
||||
|
||||
#
|
||||
# app lib
|
||||
#
|
||||
CONFIG_APP_SELECT_NEWLIB=y
|
||||
# CONFIG_APP_SELECT_OTHER_LIB is not set
|
||||
# CONFIG_LIB_USING_CJSON is not set
|
||||
# CONFIG_LIB_USING_QUEUE is not set
|
||||
# CONFIG_LIB_LV is not set
|
||||
|
||||
#
|
||||
# LVGL configuration
|
||||
#
|
||||
# CONFIG_LV_CONF_MINIMAL is not set
|
||||
# CONFIG_USING_EMBEDDED_DATABASE is not set
|
||||
@@ -418,13 +418,7 @@ static struct pbuf *low_level_input(struct netif *netif)
|
||||
rxBuffer = (uint8_t *)(EthHandle.stcRxFrame).u32Buf;
|
||||
if (len > 0UL) {
|
||||
/* Allocate a pbuf chain of pbufs from the buffer */
|
||||
p = (struct pbuf *)malloc(sizeof(struct pbuf) + len);
|
||||
if (NULL != p) {
|
||||
p->next = NULL;
|
||||
p->payload = &((uint8_t *)p)[sizeof(struct pbuf)];
|
||||
p->len = len;
|
||||
(void)memset(p->payload, 0, p->len);
|
||||
}
|
||||
p = pbuf_alloc(PBUF_TRANSPORT, len, PBUF_RAM);
|
||||
}
|
||||
if (p != NULL) {
|
||||
DmaRxDesc = (EthHandle.stcRxFrame).pstcFSDesc;
|
||||
|
||||
@@ -139,8 +139,8 @@ CONFIG_SHELL_USING_CMD_EXPORT=y
|
||||
CONFIG_SHELL_HELP_SHOW_PERMISSION=y
|
||||
# CONFIG_SHELL_HELP_LIST_VAR is not set
|
||||
# CONFIG_SHELL_HELP_LIST_KEY is not set
|
||||
#CONFIG_KERNEL_QUEUEMANAGE=y
|
||||
# CONFIG_KERNEL_WORKQUEUE is not set
|
||||
CONFIG_KERNEL_QUEUEMANAGE=y
|
||||
CONFIG_KERNEL_WORKQUEUE=y
|
||||
CONFIG_WORKQUEUE_KTASK_STACKSIZE=256
|
||||
CONFIG_WORKQUEUE_KTASK_PRIORITY=2
|
||||
CONFIG_QUEUE_MAX=2
|
||||
|
||||
@@ -225,7 +225,7 @@ CONFIG_FS_VFS_DEVFS=y
|
||||
CONFIG_LIB=y
|
||||
CONFIG_LIB_POSIX=y
|
||||
CONFIG_LIB_NEWLIB=y
|
||||
CONFIG_LIB_MUSLLIB=y
|
||||
# CONFIG_LIB_MUSLLIB is not set
|
||||
|
||||
CONFIG_LITTLEVGL2RTT_USING_DEMO=y
|
||||
|
||||
|
||||
@@ -4,6 +4,13 @@ export LFLAGS := -mcmodel=medany -march=rv64imafdc -mabi=lp64d -nostartfiles -Wl
|
||||
|
||||
export APPLFLAGS := -mcmodel=medany -march=rv64imafdc -mabi=lp64d -nostartfiles -Wl,--gc-sections,-Map=XiZi-app.map,-cref,-u, -T $(BSP_ROOT)/link_userspace.lds
|
||||
|
||||
ifeq ($(CONFIG_LIB_MUSLLIB), y)
|
||||
export LFLAGS += -nostdlib -nostdinc -fno-builtin -nodefaultlibs
|
||||
export LIBCC := -lgcc
|
||||
export LINK_MUSLLIB := $(KERNEL_ROOT)/lib/musllib/libmusl.a
|
||||
endif
|
||||
|
||||
|
||||
export CXXFLAGS := -mcmodel=medany -march=rv64imafdc -mabi=lp64d -fno-common -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -O0 -ggdb -Werror
|
||||
|
||||
export CROSS_COMPILE ?=/opt/gnu-mcu-eclipse/riscv-none-gcc/8.2.0-2.1-20190425-1021/bin/riscv-none-embed-
|
||||
|
||||
@@ -33,7 +33,7 @@ Modification:
|
||||
#include "fsl_clock.h"
|
||||
#include "fsl_enet.h"
|
||||
#include "clock_config.h"
|
||||
#include <xizi.h>
|
||||
// #include <xizi.h>
|
||||
#include <arch_interrupt.h>
|
||||
|
||||
#ifdef BSP_USING_LWIP
|
||||
|
||||
Reference in New Issue
Block a user