I have a Xilinx Zynq-based board with FreeRTOS running on it. Its EMAC is connected to a copper/fiber (unmanaged) switch (it's mounted on the board). I use lwIP 2.02 in sockets mode.
The application running on the board is used as a TCP client. In order to monitor the connection, I use the TCP keep-alive feature of lwIP. I configure 3 retries with an interval of 2 seconds. When the connection is up and running, and there is no traffic, I see in logs that the keep-alive packet is sent (almost) exactly every 2 seconds. But, when I disconnect the fiber cable (recall, it is on the other side of the switch, and not connected directly to the EMAC), the keep-alive packets are sent each ~10 seconds, and therefore I am able to receive a notification regarding the disconnection in my application code only after ~30 seconds. As an alternative, I tried to query the EMAC regarding it's link status, but it always reports up (which make sense, since it is always connected to the switch). Did anyone experience such an issue?
Many thanks, Alex