[ECOS] ecos + lwip

Simon Kallweit simon.kallweit@intefo.ch
Tue Sep 1 12:17:00 GMT 2009

Mandeep Sandhu wrote:
>>>>> Well I fixed the bug with sio.c
>>>>> Here is the fixed release:
>>>>> http://download.westlicht.ch/lwip-20090827-1.tar.gz
>>> This one compiled all the way through (leaving a few "warnings")!!
>> Good news! I'll look into these warnings in socket.c when I get some time.
> Hi Simon,
> I'm trying to use your new 1.3.1 stack with my app. The app currently works fine
> with the current version lwIP (1.1.1). I'm using the Linux synthetic
> target with a
> static IP configured to eth0.
> I'm currently stuck at getting the netif struct corresponding to my
> only ethernet
> interface eth0. It is unable to find my interface!
> I'm passing the name as "et0". This was working fine with the previous version
> of lwIP.

Yes I think et0 should be the correct name.

> I've enabled the following options in my config:
> * Netif support
> * eth0 configuration -> Use DHCP is DISABLED.
>   (static IP is configured)
> Under I/O subsystems the following is enabled:
> * Support for lwIP network stack
> * Synthetic target ethernet driver -> Provide eth0 device
> Is there any other option that I need to enable? I see that a lot of
> configuration
> options in the new version of the stack have changed so I might've missed out
> some imp ones.

This looks fine so far. I have not used the netif API myself, so I don't 
know if there were changes between the old and the new version. But I 
bet there are, as there was lots of work between 1.1.1 and 1.3.1.

Can you please show us the code you are trying to use with the netif 
API? Maybe we should also add a netif API test to the lwip package.

> Also, I traced the lwIP init path (from lwIP_init()) and I didn't see any calls
> to init_hw_drivers(). How are h/w drivers initialized then? Is there a different
> mechanism now?

Well the drivers are initialized in cyg_lwip_simple_init() in 
ecos/simple.c (for simple mode) and tcpip_init_done() in 
ecos/sequential.c (for sequential mode) with the following code:

         // Initialize network devices
         for (t = &__NETDEVTAB__[0]; t != &__NETDEVTAB_END__; t++) {
             if (t->init(t)) {
                 t->status = CYG_NETDEVTAB_STATUS_AVAIL;
             } else {
                 // Device not [currently] available
                 t->status = 0;


Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

More information about the Ecos-discuss mailing list