Forum Discussion
Altera_Forum
Honored Contributor
15 years agoAs far as I have seen, there is no need to call netmain_init().
Is there a reason why you are executing it? If you disable DHCP in the BSP, there is no DHCP code in your project. It is surrounded by -ifdef everywhere, and won't get included. It will be better to change get_ip_addr(), and set use_dhcp = 0 there. This function is there for customization, so that's the point to start. I'm not sure this will do it, maybe one has to disable the NF_DHCPC flag (wherever that gets set; I have seen it already, but can't remember where). To enable DHCP then, you can use my code as above. The 3 times problem I have not seen yet, as I have just changed my IP Address 2 times: DHCP->static->DHCP. I'll try tomorrow.