ch32v307的freertos开启tcpserver会失败返回错误码11

freertos的例程是开启了tcpclient,将代码改成tcpserver后,启动监听会失败,返回错误代码是0x11,将下面代码直接放到裸机代码程序中则不会失败。查错误码是WCHNET_ERR_MEM,注释Out of memory error,这个是要设置哪个内存的大小

void?WCHNET_CreateTcpSocketListen(void)?
{
????u8?i;
????SOCK_INF?TmpSocketInf;

????memset((void?*)?&TmpSocketInf,?0,?sizeof(SOCK_INF));

????memcpy((void?*)?TmpSocketInf.IPAddr,?IPAddr,?4);
????TmpSocketInf.SourPort?=?80;
????TmpSocketInf.ProtoType?=?PROTO_TYPE_TCP;
????i?=?WCHNET_SocketCreat(&SocketIdForListen,?&TmpSocketInf);
????printf("SocketIdForListen?%d\r\n",?SocketIdForListen);
????mStopIfError(i);
????i?=?WCHNET_SocketListen(SocketIdForListen);?????????//listen?for?connections
????mStopIfError(i);
}


已经解决,需要在net_config.h中将WCHNET_NUM_TCP_LISTEN宏定义改为1


只有登录才能回复,可以选择微信账号登录