FreeRTOS TCP server recv() drops packets

Hi Emanuel @Stonebull,

thanks for reporting this.

You wrote:

The IP task priority is in both tests the highest priority among all tasks.

We would recommend this priority scheme:

  • Highest: EMAC task from NetworkInterface.c
  • Medium: IP-task
  • Lower: Tasks that make use of the IP-stack

Although I don’t think that this caused your problem.

Software version: are you using the latest sources from the Github repo?
And if not, could you try it with the latest release?

I tried a similar test scenario but with less bytes (4 bytes) and no concurrently running application in background which worked without dropping any data

What do you mean with “no concurrently running application”, is that on the Zynq, or on the host (client side)?

The “network” is just one cable that goes from the PC to the device running FreeRTOS

I always recommend using a switch between the PC and the Zynq. Remember that when you connect the DUT (Zynq), on both sides of the cable PHY’s start negotiating.
Fortunately you have disabled ipconfigUSE_DHCP, because that would cause more conflicts (both devices might take the 0.0.0.0 address).
It looks like your PC has a fixed IP-address and does not use DHCP?
( using a switch is not a must, it is just more convenient while testing ).

Apparently the application has something to do with the issue…

you refer to the same application here? What application was it?

Thank you for the copy of FreeRTOSIPConfig.h, that is always very useful.

/* Set to 1 if the driver's transmit function is
* using zero copy. Otherwise set to 0. */
#define ipconfigZERO_COPY_TX_DRIVER 0

Can you set both these macros to 1:

#define ipconfigZERO_COPY_TX_DRIVER			1
#define ipconfigZERO_COPY_RX_DRIVER			1

Or did you disable ipconfigZERO_COPY_TX_DRIVER on purpose?
The driver supports zero-copy behaviour in both directions and that is the preferred method.

#define ipconfigNUM_NETWORK_BUFFER_DESCRIPTORS 96

That is a lot of network buffers. It won’t cause problems, except that RAM memory is occupied by them.

Finally, I am most curious about “the other application”, how that influences the observations? Maybe you can start two or more applications and see if the problem gets worse?