This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

C6657 NDK高网络带宽运行奔溃

Other Parts Discussed in Thread: TMS320C6657

硬件平台:TMS320C6657 Lite Evaluation Modules

软件平台如下:CCS V6.20和最新的PROCESSOR-SDK-RTOS-C665x  03_02_00_05

使用的例程是:NIMU_emacExample_EVMC6657C66BiosExampleProject

在该例程上做了小修改,创建Task不断往上位机发送数据,发送长度8192,代码如下:

int frameSize = 8192;
int packetlen = 8192 ;

TaskCreate( sendclient, "SendClient", OS_TASKPRINORM, 0x1400, 0, 0, 0 );

//
// TCP Send Client (SOCK_STREAM @ port 9527)
//
void sendclient()
{
SOCKET stcp = INVALID_SOCKET;
struct sockaddr_in sin1;
int bytes;
IPN IPAddr;
int retVal = 0;
struct timeval to;

/* Wait for the link to come up */

TaskSleep(1000);

// Allocate the file environment for this task
fdOpenSession( TaskSelf() );

printf("Sending Task started\n");
// Allocate a working buffer
if( !(pBuf = mmBulkAlloc( frameSize )) )
{
printf("failed temp buffer allocation\n");
goto leave;
}
// Create the main TCP listen socket
stcp = socket(AF_INET, SOCK_STREAM, 0);
if( stcp == INVALID_SOCKET )
{
printf("Fail socket, %d\n", fdError());
goto leave;
}

// Set Pmort = 9527, IP address = IPAddrSend
IPAddr = inet_addr(RemoteIPAddr);
bzero( &sin1, sizeof(struct sockaddr_in) );
sin1.sin_family = AF_INET;
sin1.sin_addr.s_addr = IPAddr;
sin1.sin_port = htons(9527);

to.tv_sec = 5;
to.tv_usec = 0;
setsockopt( stcp, SOL_SOCKET, SO_SNDTIMEO, &to, sizeof( to ) );
setsockopt( stcp, SOL_SOCKET, SO_RCVTIMEO, &to, sizeof( to ) );

while(connect( stcp, (PSA) &sin1, sizeof(sin1) ) < 0)
{
printf("Fail connect, %d\n", fdError());
}

printf ("Sending %d Bytes \n", frameSize);

// Configure our socket timeout to be 5 seconds

/* Configure the transmit device */
retVal = setsockopt(stcp, SOL_SOCKET, SO_SNDBUF, &packetlen, sizeof(packetlen));
if(retVal)
printf("error in setsockopt \n");

while(1)
{
if( ((bytes = send( stcp, pBuf , (int)frameSize, 0 )) < 0) )
{
printf("send failed (%d)\n",fdError());
goto leave;
}
if(frameSize != bytes)
{
printf("send bytes (%d)\n",bytes);
}
}

leave:
if( NULL != pBuf )
mmBulkFree( pBuf );

// We only get here on an error - close the sockets
if( stcp != INVALID_SOCKET )
fdClose( stcp );
hsendclient = NULL;
printf("Send Task to be terminated\n");

fdCloseSession( TaskSelf() );

TaskDestroy( TaskSelf() );
}

上位机自己编写或者使用iperf接收数据,接收速度差不多30MB/s,但是传输一小会就中断了,DSP不再发送数据,并且网络ping不通,重启DSP后才可以ping通,请问这是什么原因,并且如何解决这个问题?谢谢

这个问题挺关键的,麻烦大佬抽空回答一下,再次谢谢!

x 出现错误。请重试或与管理员联系。