FreeRTOS TCP IP implementation on STM32F767ZI

I just prepared a simple TCP-client session to run in an MCU:
tcp_connect_demo.zip (1.5 KB)

If you copy it to your project ( or link it ), then you can run it as follows:

uint32_t ulAddress = FreeRTOS_inet_addr_quick( 192, 168, 2, 5 );
uint16_t usPort = FreeRTOS_htons( 32002 );
handle_user_test (ulAddress, usPort );

Could you try to run it?

It is very verbose:

0.022 connect-test: socket() OK, calling bind()
0.022 connect-test: bind() OK, calling connect()
0.022 FreeRTOS_connect: 45878 to 192.168.2.5:32002
0.022 Socket 45878 -> 192.168.2.5:32002 State eCLOSED->eCONNECT_SYN
0.023 prvSocketSetMSS: 1460 bytes for 192.168.2.5:32002
0.023 prvWinScaleFactor: uxRxWinSize 1 MSS 1460 Factor 0
0.023 Connect[192.168.2.5:32002]: next timeout 1: 3000 ms
0.023 MSS change 1460 -> 9158
0.024 TCP: active 45878 => 192.168.2.5:32002 set ESTAB (scaling 1)
0.024 Socket 45878 -> 192.168.2.5:32002 State eCONNECT_SYN->eESTABLISHED
0.024 connect-test: connect() OK, calling send()
0.124 connect-test: calling shutdown()
0.124 Socket 45878 -> 192.168.2.5:32002 State eESTABLISHED->eFIN_WAIT_1
0.124 connect-test: Received 80 bytes
0.127 Socket 45878 -> 192.168.2.5:32002 State eFIN_WAIT_1->eCLOSE_WAIT
0.127 connect-test: calling closesocket()
0.127 FreeRTOS_closesocket[45878 to 192.168.2.5:32002]: buffers 13 socks 1

The test takes about 100 ms, because of a delay between send() and shutdown(). I had an echo server running on my laptop 192.168.2.5, port 32002. It echoed the 80 bytes of data.