For background, I have been working on getting FreeRTOS+TCP (10.3.1) ported to the iMX.RT1064 EVK and have been working through some issues with the Ethernet functionality. For background I have the kernel outputting the gratuitous ARP periodically as expected. The target also works reliable in terms of replying to pings sent to it. I am now working on verifying TCP and UDP operation. A simple UDP send loop on the target shows up on Wireshark as expected with the expected data in the payload. TCP has been giving me issues though.
-
I have copied the simpleTCPEchoServer for the demo in the release dnload.
-
Using putty I can open a telnet connection (telnet negotiation off) to the target (port 7).
-
When characters are typed from putty (‘1’, CRLF), I see them transmitted as 2 packets in Wireshark and the target immediately sends 2 acks back for them.
-
The echo server task gets the 3 characters from FreeRTOS_recv and then calls FreeRTOS_send. Send payload is verified to to be the 3 characters received ('1’CRLF)
-
FreeRTOS_send puts the 3 characters in the txStream for the socket. Proper content is verified in the stream buffer memory, stream head and front incremented to 3.
-
FreeRTOS_send signals IPTask with an eTCPTimerEvent which I assume is supposed to trigger the stream output at some point (code below).
/* Send a message to the IP-task so it can work on this
socket. Data is sent, let the IP-task work on it. */
pxSocket->u.xTCP.usTimeout = 1u;if( xIsCallingFromIPTask() == pdFALSE ) { /* Only send a TCP timer event when not called from the IP-task. */ xSendEventToIPTask( eTCPTimerEvent ); }
-
At this point the data never goes out and a breakpoint in xNetworkInterfaceOutput never gets to send the TCP reply (only to send ARP broadcasts). Additional characters sent are not Acked so it appears the TCP stack is no longer processing data.
-
Breaking app and looking at the socket descriptor still shows the data in the txStream.
I would appreciate any suggestions on what might be causing this or areas to focus on in terms of tracing this out and determining the issue. I am new to FreeRTOS+TCP so this has been a slow process walking through the TCP/IP code so any help would be appreciated.
Wireshark trace of a typical example is available.
Thank you,
Dave