I was testing LWIP with ChibiOS (latest, 17.6.3) on a STM32F107 (Olimex STM32-P107 board, rev. B), and noticed that it didn't work quite well (couldn't ping the IP). After some random trials, I found that I needed to insert a delay right after the call to macStart (in lwipthread.c). After further investigation I came with the following fix at the beginning of the lwip_thread function:
Code: Select all
/* begin fix */
/* end fix */
netif_add(&thisif, &ip, &netmask, &gateway, NULL, ethernetif_init, tcpip_input);
It takes approximately 1.9 seconds to complete, which matches the delay I was using previously, and after that LWIP works perfectly.
The only problem is that I don't really understand what's going on, and I don't even know if this is really a fix. Can someone who understands LWIP and the ETH driver help me figure out a clean solution (or explain what happens, in case I already have the proper one)?