TI中文支持网
TI专业的中文技术问题搜集分享网站

TMS320C6678: TCP/IP无法正常收发

Part Number:TMS320C6678

Ti专家你好:

        有个问题想咨询一下你们,我们自研的DSP6678单板,用的是sys/bios,UDP协议收发目前是正常的,长时间测试也是正常的无丢数,但是用tcp协议一直无法正常收发,一直提示ETHERNET FRAME CHECK SEQUENCE INCORRECT ,不知道是否在nimu这个库里面有关于修改网络ECRC校验的,麻烦ti专家指导下。(底下是我的tcp代码和wireshark抓包)

void NetLineFx_tcp(UArg a0, UArg a1)
{
	struct timeval to;
	int recvCharLength;
	int	sendCharLength;
	int	pbuf;	char *ppbuf;
	HANDLE hBuffer;
	structsockaddr_in sinData, cliAddr;
	int err;
	char ncData[4] = {1,2,3,4};//网口发送数据,测试用int bufferLength=1*1024*1024;//Allocate the file environment for this taskfdOpenSession( TaskSelf() );//Initialize the socketsendtcp  = socket(AF_INET, SOCK_STREAMNC, IPPROTO_TCP);if (sendtcp == INVALID_SOCKET){
		printf(" socket(socksend) failed \n");
		//return -1;}//Initialize socket address in structurebzero( &sinData, sizeof(struct sockaddr_in) );sinData.sin_family = AF_INET;sinData.sin_len= sizeof( sinData );sinData.sin_port = htons(65030);//Bind the socketerr = bind (sendtcp, (struct sockaddr *)&sinData, sizeof(sinData));
	if(err == 0)
		printf("Send-Bind operation successfully done\n");
	else
	{
		printf("Send-Bind operation failed errno= %d\n", fdError());
		//return -1;
	}
	err = listen(sendtcp,100);
	if(err == -1)
	{
		printf("Listen failed!\r\n");
	}
	int size1;
	size1= sizeof(cliAddr);
	bzero( &cliAddr, sizeof(struct sockaddr_in) );
	accept(sendtcp,(struct sockaddr *)&cliAddr,&size1);
	setsockopt( sendtcp, SOL_SOCKET, SO_SNDBUF, &bufferLength, sizeof( int ) );
	setsockopt( sendtcp, SOL_SOCKET, SO_RCVBUF, &bufferLength, sizeof( int ) );
	for(;;)
	{
		recvCharLength = (int)recvnc( sendtcp, (void **)&ppbuf, 0, &hBuffer );
		printf("tcp receive data len %d\n",recvCharLength);
		if(recvCharLength > 0)
		{
			recvncfree( hBuffer );
			sendCharLength = (int)send( sendtcp, ncData , 16 , 0);
		}
		else
		{
			printf("FINISHED\n");
			break;
		}
	}
	fdClose(sendtcp);
}

JohnieSi1:

帧校验一直有问题  只要打开网络调试助手 发送数据wireshark抓包都是现在帧校验全部是0 无法正常收发

,

JohnieSi1:

DSP6678 tcp做服务器端,pc做客户端

,

JohnieSi1:

问题已解决 !!!!

赞(0)
未经允许不得转载:TI中文支持网 » TMS320C6678: TCP/IP无法正常收发
分享到: 更多 (0)