[ECOS] ecos + lwip

Mandeep Sandhu mandeepsandhu.chd@gmail.com
Tue Sep 1 15:20:00 GMT 2009


On Tue, Sep 1, 2009 at 7:08 PM, Simon Kallweit<simon.kallweit@intefo.ch> wrote:
> Mandeep Sandhu wrote:
>>
> You should not call lwip_init() when using the ecos lwip port. You need to
> use cyg_lwip_simple_init() or cyg_lwip_sequential_init(). Well, I really
> should add some documentation I guess.

Yes. Documentation would help a lot. Thanks.
>
>> It's being used in all the test apps). The only difference is, the test
>> apps
>> call cyg_lwip_thread_new() to create a new thread, while I call
>> sys_thread_new()
>> (though this is internally calling cyg_lwip_thread_new())
>
> sys_thread_new() will use preallocated memory for the stack, while
> cyg_lwip_thread_new() will take the stack as an argument. Therefore by
> default you should use cyg_lwip_thread_new(). When using sys_thread_new()
> the ecos should fail when all preallocated memory is used.

But sys_thread_new() also takes stacksize as an argument. It passes
the same value
to cyg_lwip_thread_new() after validating it. So I guess it should be ok.

>
>> With this I see the n/w interface being initialized, but the app
>> crashes/hangs
>> after init-ing the interface:
>>
>> ...
>> netif_set_ipaddr: netif address being changed
>> netif: IP address of interface  set to 11.1.1.1
>> netif: netmask of interface  set to 255.255.255.0
>> netif: GW address of interface  set to 0.0.0.0
>> netif: added interface et IP addr 11.1.1.1 netmask 255.255.255.0 gw
>> 0.0.0.0
>> netif: setting default interface et

Whoops! Sorry. I guess its not obvious to others on what happens next! :)

Well, after this I should see debug o/p of my thread. Here's the code:
...
...
cyg_lwip_sequential_init();
sys_thread_new("My thread",
                   m_main,
                   (void *)"My thread",
                   0x1000,
                   5);
...
...

void
m_main( void *arg )
{
    LOG(LOG_DEBUG,"%s started...", (char *)arg);
...
...

So I'm expecting "My thread started" as the next o/p.

Same code works fine with 1.1.1

-mandeep
>>
>>
>> After this nothing happens. I think the app's crashed here!
>
> What should happen next?
>
> Simon
>

--
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