Dear all
I just started learning RTOS with RT 1170 DEV board, and would like to change IP address while it is running, I am able to change it from DHCP to static, but struggling to change it from static to DHCP, I believe I still need to call do it like it is starts up:
netifapi_dhcp_start(&netif);
while (ethernetif_wait_linkup(&netif, 5000) != ERR_OK)
{
PRINTF("PHY Auto-negotiation failed. Please check the cable connection and link partner setting.\r\n");
}
(void)ethernetif_wait_ipv4_valid(&netif, ETHERNETIF_WAIT_FOREVER);
But it is not running and stuck somewhere, I am new to freeRTOS. Please advise what I did wrong.
Thank you!
Ping
已解决! 转到解答。
sorry, there is a mistake in my reply, below is what I wanted to say:
I wonder whether it needs to be done in a new thread when start DHCP again? in non OS system I just done with RT1024, change to static IP don't need to call netif_add() again, there is another api netif_set_addr(). I wonder whether there is another set of similar API to call when change to DHCP from static?
Ping
Hi @ping1,
It might be worth looking into the place in the code where the the execution halts to get a better insight on what the specific issue might be. That said, the most straightforward recommendation would still be to de-initialize and reinitialize the stack anyways, so I would advice you to do so and let me know if the issue persists.
BR,
Edwin.
Thanks for reply, Edwin
I wonder whether it needs to be done in a new thread when start DHCP again? in non OS system I just done with RT1024, change to DHCP don't need to call netif_add() again, there is another api netif_set_addr(). I wonder whether there is another set of similar API to call when change to DHCP from static?
BR
Ping