FreeRTOS + TCP, tutorial, STM32F7 questions.

heinbali01 wrote on Saturday, February 09, 2019:

A few remarks about your FreeRTOSIPConfig.h :

/* USE_WIN: Let TCP use windowing mechanism. */
#define ipconfigUSE_TCP_WIN ( 0 )

Not important yet, but I recommend using the sliding TCP windows

#define ipconfigTCP_WIN_SEG_COUNT 240

I recommend a lower number. This defines the maximum number of outstanding TCP segments at any time.

#define ipconfigTCP_RX_BUFFER_LENGTH ( 1000 )

/* Define the size of Tx buffer for TCP sockets. */
#define ipconfigTCP_TX_BUFFER_LENGTH ( 1000 )

1000 bytes is very little. Normally this would be defined as minimal:

#define ipconfigTCP_RX_BUFFER_LENGTH                   ( 4 * ipconfigTCP_MSS )
#define ipconfigTCP_TX_BUFFER_LENGTH                   ( 2 * ipconfigTCP_MSS )

In the above case, the buffers are defined as a multiple of ipconfigTCP_MSS, which depends on ipconfigNETWORK_MTU, or up to 1460 bytes.

#define ipconfigREPLY_TO_INCOMING_PINGS 1

That is OK, but it is defined 2 times.

static uint8_t ucMACAddress[ 6 ] = { configMAC_ADDR0, configMAC_ADDR1, configMAC_ADDR2,
configMAC_ADDR3, configMAC_ADDR4, configMAC_ADDR5 };

You are defining static variables/arrays in a header file. I think that all these declarations should be placed in your main.c.

Especially ucMACAddress : are you sure it must be accessible in all modules that include FreeRTOSIPConfig.h?
If you change ucMACAddress in e.g. main.c, it will not change in other modules.
Normally FreeRTOS_GetMACAddress() is used to read the 6-byte MAC-address.
Can you see where (in what modules) ucMACAddress[] is being used?