Hi, I've managed to incorporate the LWIP stack into our project and can successfully ping etc.. and have now moved on to try and make the ip address as a user setting but I'm have trouble getting this to apply. I've followed the ping example and adding netif_set_down first to the sequence as
netif_set_down(&fsl_netif0);
printf("ip address set as %d.%d.%d.%d\r\n",configIP_ADDR[0],configIP_ADDR[1],configIP_ADDR[2],configIP_ADDR[3]);IP4_ADDR(&fsl_netif0_ipaddr, configIP_ADDR[0], configIP_ADDR[1], configIP_ADDR[2], configIP_ADDR[3]);
IP4_ADDR(&fsl_netif0_netmask, configNET_MASK[0], configNET_MASK[1], configNET_MASK[2], configNET_MASK[3]);
IP4_ADDR(&fsl_netif0_gw, configGW_ADDR[0], configGW_ADDR[1], configGW_ADDR[2], configGW_ADDR[3]);
lwip_init();
netif_add(&fsl_netif0, &fsl_netif0_ipaddr, &fsl_netif0_netmask, &fsl_netif0_gw,
&fsl_enet_config0, ethernetif0_init, ethernet_input);netif_set_default(&fsl_netif0);
netif_set_up(&fsl_netif0);
After setting a new ip address pinging the previous address now fails so it's had some effect but I can't successfully ping the new address.
Any ideas on what steps I'm missing?
Thanks
Ian
已解决! 转到解答。
For anyone having this issue I found the answer in the LWIP wiki under the IPv4 section https://lwip.fandom.com/wiki/IPv4
and use the function netif_set_ipaddr instead of adding the interface again.
Cheers
Ian
For anyone having this issue I found the answer in the LWIP wiki under the IPv4 section https://lwip.fandom.com/wiki/IPv4
and use the function netif_set_ipaddr instead of adding the interface again.
Cheers
Ian