FreeRTOS TCP+ PhyLinkStatus update ratr


I have a short question regarding the PhyLinkStatus, which is polled every 15 seconds (default) if no packed where received…

I wondering why the time interval is so high. I want to change it to 1 second to detect the broken link earlier, but don’t know what impact that might be have…


Hello Andy, that’s a good question!

You must have come across this private macro in phyHandling.c:

#ifndef ipconfigPHY_LS_HIGH_CHECK_TIME_MS
    /* Check if the LinkStatus in the PHY is still high
     * after 15 seconds of not receiving packets. */
	#define ipconfigPHY_LS_HIGH_CHECK_TIME_MS    15000U

You can define it in your FreeRTOSIPConfig.h, and give it a value of e.g. 1000 (ms).

Once I had put it very short, and the Link Status was polled unconditionally, i.e. polling was also done during heavy traffic.
The polling is not so much work, but accessing the PHY’s registers seem to influence the performance heavily. This happened on a Xilinx Zynq 7000.

So, just put at one second and check if the performance stays the same.

As long as frames are received, no polling will happen. So i think it must be no problem for the performance to reduce this value to 1s :thinking:
Just wanted to double check if there are any other cocerns i miss…

I also noticed a interesting timing problem in my system (Intel FPGA Max10 with TripleSpeedEthernet MAC IP core) when accessing the phy.
The problem was the behaviour of the MAC. The MAC has a register space representing the internal registers of the phy.
When accessing these registers of the MAC (read or write) immediatly a MDIO transaction to the phy is executed by the MAC hardware. This serial transaction (max 25MHz) need some time and will stall the data bus of the CPU for some microseconds…

In my case this was a problem, which i solved by a DMA contoller which access these registers to keep the CPU alive for this time…