try to add #include "lwip/ip_addr.h" and read http://www.nongnu.org/lwip/2_0_x/upgrading.html especially "Changed netif "up" flag handling to be an administrative flag [...]" -> don't forget to call netif_set_up()
Ciao Dirk -- Dirk Ziegelmeier * d...@ziegelmeier.net * http://www.ziegelmeier.net On Thu, Apr 5, 2018 at 8:29 PM, Keith Rubow <kru...@micro-aide.com> wrote: > I am trying to use lwip on ARM cortex M4. My development software is > Atollic Truestudio on Win10. So far I have gotten lwip 1.4.1 to work using > raw api and a simple multitasking OS. > > Now I am trying to change over to lwip 2.0.3, and am having trouble with > initialization. My initialization code is as follows: > #include "lwipopts.h" > #include "lwip/tcpip.h" > #include "lwip/tcp.h" > struct netif wiznetif; // network interface struct for wiznet > ... > static void initialize_lwip(void) { > struct ip_addr ipaddr, netmask, gateway; > > IP4_ADDR(&ipaddr, setup.ip_address[0], setup.ip_address[1], > setup.ip_address[2], setup.ip_address[3]); > IP4_ADDR(&netmask, setup.subnet[0], setup.subnet[1], setup.subnet[2], > setup.subnet[3]); > IP4_ADDR(&gateway, setup.gateway[0], setup.gateway[1], > setup.gateway[2], setup.gateway[3]); > tcpip_init(NULL, NULL); > netif_add(&wiznetif, &ipaddr, &netmask, &gateway, NULL, > ðernetif_init, &tcpip_input); > netif_set_up(&wiznetif); > } > > This works with lwip 1.4.1, but with 2.0.3 I get an compile error, storage > size of 'ipaddr' isn't known. Apparently struct ip_addr isn't defined. I > must be missing an include. Or maybe the ip address is defined differently > in 2.0.3? I can't seem to find a simple example of initialization code for > 2.0.3. BTW, I use ipv4 only, no ipv6. > > Also, any other raw api or sys_arch changes I need to watch out for in > 2.0.3? > > Keith > > > _______________________________________________ > lwip-users mailing list > lwip-users@nongnu.org > https://lists.nongnu.org/mailman/listinfo/lwip-users
_______________________________________________ lwip-users mailing list lwip-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/lwip-users