[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-users] Initialization problem upgrading from 1.4.1 to 2.0.3

From: Keith Rubow
Subject: [lwip-users] Initialization problem upgrading from 1.4.1 to 2.0.3
Date: Thu, 5 Apr 2018 11:29:37 -0700
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:52.0) Gecko/20100101 Thunderbird/52.7.0

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, &ethernetif_init, &tcpip_input);

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?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]