AnsweredAssumed Answered

STM32F407 Ethernet stops working after being working for a while (Discovery+Expansion Boards)

Question asked by SbS on Mar 15, 2016
Latest reply on Mar 17, 2016 by SbS
Hello everyone,

I'm using the STM32F407 Discovery Kit with the Expansion Board Discover-MO:) (DM-STF4BB) with ethernet. The ports and clocks initialization are based in the code generated with Cube MX. The system is working with HAL-Drivers, FreeRTOS, LwIP and PTPv2 (taken from the STM32F107 example). I have modified the file ethernetif.c to support PTP time stamping, the LAN8720 PHY and to generate a Receive buffer unavailable interrupt that resumes the receiving process.

Everything is working fine for a while: I can reach the web server with the example web page with the task list, the board responds to a continuous ping and PTP is working fine.

After some time (sometimes 5 minutes and sometimes 5 hours) the ethernet connection stops working. first I see that the Pulse Per Second (PPS) signal doesn't synchronize any more from PTP, I also see that the web page is getting slower but the ping response is still there. After a short time the ping and the web server becomes unreachable.

I've checked for Malloc Fail and Stack Overflow as well as Hard Faults but that dosen't seam to be the problem. If I suspend execution, I see that FreeRTOS is still running. The problem is that pbuf_alloc() fails and sometimes the Ethernet interrupt stops being generated, that's why the receive buffer is not being freed any more and its impossible to receive new packages.

Does any one have the same or a similar problem? Does any body have some idea how to solve it? Is there a method to determinate the right size of the buffers, memory pools and number of control blocks for LwIP?

The problem dosen't appear if no data is send to the board, in this case I test it after a week and it was still working fine.

Thanks in advance for helping.

Best regards