Tool/software: Starterware
Dear All
Just imported the enet_lwip example and started playing, it words when I configure it with a DHCP IP address and able to be pinged back with PC. However, when I try to configure it with a STATIC IP address with LWIP_DHCP option set to 1, my IP address is failed to set and all end up with 0s. Traced the lwiplib.c and found the following:
1. lwIPLinkDetect() is running at regular interval (called by lwIPServiceTimer()) when LWIP_DHCP option is set, and where when a Link state is changed it clears all IP settings by following code snip:
//
// Clear any address information from the network interface.
//
ip_addr.addr = 0;
net_mask.addr = 0;
gw_addr.addr = 0;
netif_set_addr(&g_sNetIF, &ip_addr, &net_mask, &gw_addr);
I don’t know the definition of a Link state change, is it caused by initialization to a IP address?
2. Clear LWIP_DHCP to 0, STATIC IP address works fine. But I need to leave both option open to customers.
3. Checked equivalent StellarisWare we has been using, it seems like it checks the Link state in LwIpServiceTimers() too, but do not clear any settings. Wonder whether it is a bug?
Anyone had similar issue please?