TCP-IP stack stops working


I am using FreeRTOS+TCP+Multi. I am using it for Modbus TCP server. When I start sending queries after every 100mS and I try to connect more Modbus TCP clients, it stops working. Even Ping does not work and I have to apply hard reset. What could be the problem?


Out of buffers / heap ? Or do you have plenty of RAM available ?
Please also tell the MCU / the FreeRTOS port and version.


We are using STM32F722 controller. For Ethernet we are using ENC424J600. There are 2 ethernet ports. Right now I am testing with only one port and facing this challenge.


Does the rest of the system work, or do you end up in a fault? If the former, check if your TCP task is deadlocked. If the latter, go through your off the shelf fault analysis.

I am thinking in the same direction as Hartmut: possibly there is a lack of resources?

If you have enabled logging, i.e. ipconfigHAS_PRINTF is defined, then vPrintResourceStats() will be called regularly from the network-interface ( well, most interfaces ). It gives warnings about the heap and the number of available network buffers.

Maybe you can have FreeRTOS_printf() send its logging to a serial / USB port?

If you want to know how much memory the IP-stack is using, you can have a look at tcp_mem_stats.c. It registers every allocation while running.

When I read your post, I thought that ENC424J600 is yet another PHY, but in fact it is a stand-alone EMAC. Did you write the network driver yourself? Can I find it somewhere?

Are you also using the internal EMAC of the STM32F7x? In that case vPrintResourceStats() will be called regularly. I hope that you have access to its logging.


Other system works. I have observed that when this issue occurs, it happens after sending the response with FreeRTOS_send() interface. No Ping response is given by the system.


Can you show the driver for ENC424J600, in case it is open source?
And the same questions:
Can you check if the device is running out of heap memory?
Or is it running out of network buffers?
Maybe it is also useful to attach you copy of FreeRTOSIPConfig.h, to see how you configure +TCP.
And can you put a break in the IP-task, for instance here in prvIPTask(). Does it stop there?

Hello Mr. Tibosch,

Thank you very much for your swift replies.

I am not sure if the ENC424J600 driver is open source. However, is it ok if I send it to you by email, instead of putting it in the forum?


Oops, sorry, I missed your reply.

Yes sure you can email it to me: hein [at] htibosch [dot] net
Thank you