As above, having issues using FreeRTOS+LwIP on a Zedboard, with the board just crashing and needing a power reset. I think it's to do with the network connections, I have two, one for incoming traffic and one for outgoing, both connect fine, however data seems a bit, odd.
Here's the function I'm using to receive data from the PC:
while (ntotal < size)
{
n = lwip_read(connection_descriptor, (buffer+ntotal), size - ntotal);
if (n < 0)
{
printf("Failed receiving frame, received %i bytes\n", ntotal);
return -1;
}
ntotal = ntotal + n;
}
And here's for the outgoing:
int bytesSent = 0;
int bytesSentTotal = 0;
int lengthToSend = 0;
int lengthToSendTotal = 0;
lengthToSendTotal = Size;
lengthToSend = 1460;
printf("Processed frame about to be sent from obin%d\n", binNO);
while (bytesSentTotal + lengthToSend < lengthToSendTotal)
{
//lengthToSend = lengthToSendTotal - bytesSentTotal;
bytesSent = lwip_write(connection_descriptor, &(buffer[bytesSentTotal]), lengthToSend);
if (bytesSent < 0)
{
printf("ERROR writing frame to socket\n");
return -1;
}
else
{
bytesSentTotal += bytesSent;
//printf("Data sent: %d\n", bytesSentTotal);
}
}
lengthToSend = lengthToSendTotal - bytesSentTotal;
bytesSent = lwip_write(connection_descriptor, &(buffer[bytesSentTotal]), lengthToSend);
I tried changing it to send smaller amount of data per call as I wondered if trying to send a large amount at once was causing the issues (looking to send 900kb+ each time). However the behaviour seems to be the same regardless, it will start fine, with data being received, then it will freeze, often partway through sending data back, until finally the client code on my PC will fail at the write command due to non responding network connection (or something similar).
So I'm just wondering if there's anything obvious I'm doing wrong?