public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Trouble using lwIP (driver crash...)
@ 2006-04-03 13:14 Michael Grimard
  0 siblings, 0 replies; 8+ messages in thread
From: Michael Grimard @ 2006-04-03 13:14 UTC (permalink / raw)
  To: ecos-discuss

Hi,
  I have downloaded the latest source for eCos with the ported version of
lwIP (1.1.1) and I have some trouble with it.

With the eCos Configuration Tool, I choose i386 PC target with i82559
ethernet template with the lwip_eth package and this configuration doesn’t
compile. I got “cyg/fileio/limits.h: No such file or directory” error. In
fact, the directory cyg/fileio has not been created by the config tool. I
added the POSIX File IO compatibility layer package and now eCos builds
without errors. I guess that this package should be included by default…

I never used lwIP so I wanted to start with the nc_test_xxx examples to test
it, but nc_test_master.c is not given, so I started porting it to use lwIP.
The biggest problem I had with the code was that gethostbyname() and struct
hostent that are undefined.

struct hostent is defined in netdb.h or dns.h. I don’t have dns.h (the
directory “ns” has not been created by the config tool), so I must use
netdb.h, but by doing this, gethostbyname() gets defined to a function
returning NULL… That’s not really what I was expecting…

Does lwIP supports a call to gethostbyname()? If yes, how can I do it?

For now, I’m using the IP4_ADDR macro and nc_test_master compiles.

Now… my real problem. Is anybody have used lwIP with the i82559 driver?

When I run nc_test_master, the first packet sent triggers the ARP Protocol.
An ARP Request is sent, the reply from the slave is sent and the master
sends the first packet (NC_REQUEST_TCP_ECHO), but when the master receives
the ACK from the slave, I got:

ASSERT FAIL: <5>if_i82559.c [2008]PacketRxReady() No prev EL

Can anyone help me with this?

If someone has already the nc_test_master.c file modified for lwIP and can
send it to me, I will try it to see if it is the modification I made to the
nc_test_master.c file that causes this or something else (maybe eth_drv.c?).


Thanks,
Michael



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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [ECOS] Trouble using lwIP (driver crash...)
  2006-04-04 17:10 ` Michael Grimard
@ 2006-04-05  7:26   ` Birahim Larou Fall
  0 siblings, 0 replies; 8+ messages in thread
From: Birahim Larou Fall @ 2006-04-05  7:26 UTC (permalink / raw)
  To: Michael Grimard; +Cc: ecos-discuss

compare your file  eCos\packages\net\lwip_tcpip\current\ChangeLog with my 
changeLog. I advise you to update the ecos sources (LWIP packages) if your 
changelog is different to mine.  I use the lwip an it's ok.. Before 
re-building library, I suggest you to delete the build tree yourself 
(three reportories: mlt, build and include) and generate again build tree. 
This can avoid some build errors.


2005-10-07  Uwe Kindler <uwe_kindler@web.de>

        * src/core/tcp_in.c: pbuf_free() assert triggered by 
        NULLified inseg.p
        * include/lwip/tcp.h Do no longer try to free pbuf 
        when TCP_EVENT_RECV() is called without a callback 
        handler, and without packet. 
        * tests/nc_test_slave.c Fixed test_printf and diag_printf
        format strings that caused errors or warnings.
        * tests/nc_test_slave.c Included <lwip/inet.h> - required
        for compilation
        * src/ecos/init.c Added structs ip_addr ipaddr, netmask and gw
        in lwip_init() if loop interface is used

2004-05-05  Jani Monoses <jani@iv.ro>

        * src/netif/ppp/ppp.c: Decrease sleep period in main thread
        from 250ms to 1ms. Was a leftover of debugging the code and
        slowing things down.

2004-05-04  Jani Monoses <jani@iv.ro>

        * cdl/lwip_net.cdl
        * src/api/err.c
        * src/api/tcpip.c
        * src/api/sockets.c
        * src/api/api_lib.c
        * src/api/api_msg.c
        * src/core/tcp_in.c
        * src/core/ipv4/ip.c
        * src/core/ipv4/ip_addr.c
        * src/core/ipv4/ip_frag.c
        * src/core/ipv4/icmp.c
        * src/core/tcp_out.c
        * src/core/mem.c
        * src/core/raw.c
        * src/core/tcp.c
        * src/core/sys.c
        * src/core/udp.c
        * src/core/stats.c
        * src/core/dhcp.c
        * src/core/netif.c
        * src/core/inet.c
        * src/core/memp.c
        * src/core/pbuf.c
        * src/ecos/sio.c
        * src/ecos/sys_arch.c
        * src/ecos/init.c
        * src/netif/ppp/vj.c
        * src/netif/ppp/vj.h
        * src/netif/ppp/randm.c
        * src/netif/ppp/randm.h
        * src/netif/ppp/vjbsdhdr.h
        * src/netif/ppp/fsm.c
        * src/netif/ppp/fsm.h
        * src/netif/ppp/lcp.c
        * src/netif/ppp/lcp.h
        * src/netif/ppp/md5.c
        * src/netif/ppp/md5.h
        * src/netif/ppp/pap.c
        * src/netif/ppp/pap.h
        * src/netif/ppp/ppp.c
        * src/netif/ppp/ppp.h
        * src/netif/ppp/magic.c
        * src/netif/ppp/magic.h
        * src/netif/ppp/pppdebug.h
        * src/netif/ppp/auth.c
        * src/netif/ppp/auth.h
        * src/netif/ppp/chap.c
        * src/netif/ppp/chap.h
        * src/netif/ppp/ipcp.c
        * src/netif/ppp/ipcp.h
        * src/netif/ppp/chpms.c
        * src/netif/ppp/chpms.h
        * src/netif/etharp.c
        * src/netif/slipif.c
        * src/netif/loopif.c
        * tests/tcpecho.c
        * tests/udpecho.c
        * tests/nc_test_framework.h
        * tests/nc_test_slave.c
        * tests/httpd.c
        * tests/sys_timeout.c
        * tests/socket.c
        * include/arch/cc.h
        * include/arch/sys_arch.h
        * include/arch/perf.h
        * include/lwip/ip.h
        * include/lwip/debug.h
        * include/lwip/ip_addr.h
        * include/lwip/api.h
        * include/lwip/def.h
        * include/lwip/err.h
        * include/lwip/mem.h
        * include/lwip/opt.h
        * include/lwip/ip_frag.h
        * include/lwip/raw.h
        * include/lwip/sio.h
        * include/lwip/tcp.h
        * include/lwip/sys.h
        * include/lwip/udp.h
        * include/lwip/tcpip.h
        * include/lwip/stats.h
        * include/lwip/arch.h
        * include/lwip/dhcp.h
        * include/lwip/netif.h
        * include/lwip/icmp.h
        * include/lwip/inet.h
        * include/lwip/memp.h
        * include/lwip/pbuf.h
        * include/lwip/snmp.h
        * include/lwip/sockets.h
        * include/lwip/api_msg.h
        * include/netif/etharp.h
        * include/netif/slipif.h
        * include/netif/loopif.h
        * include/network.h
        * include/lwipopts.h : Initial import of the lwIP TCP/IP stack.

//===========================================================================
//####ECOSGPLCOPYRIGHTBEGIN####
// -------------------------------------------
// This file is part of eCos, the Embedded Configurable Operating System.
// Copyright (C) 2004 eCosCentric 
//
// eCos is free software; you can redistribute it and/or modify it under
// the terms of the GNU General Public License as published by the Free
// Software Foundation; either version 2 or (at your option) any later 
version.
//
// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
// for more details.
//
// You should have received a copy of the GNU General Public License along
// with eCos; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
//
// As a special exception, if other files instantiate templates or use 
macros
// or inline functions from this file, or you compile this file and link 
it
// with other works to produce a work based on this file, this file does 
not
// by itself cause the resulting work to be covered by the GNU General 
Public
// License. However the source code for this file must still be made 
available
// in accordance with section (3) of the GNU General Public License.
//
// This exception does not invalidate any other reasons why a work based 
on
// this file might be covered by the GNU General Public License.
//
// -------------------------------------------
//####ECOSGPLCOPYRIGHTEND####
//===========================================================================

Fall Birahim
Digital TV Firmware Engineer
Elsys Design for SCM Microsystems




"Michael Grimard" <michaelg@maxt.com> 
Sent by: ecos-discuss-owner@ecos.sourceware.org
04/04/2006 19:10

To
<ecos-discuss@sourceware.org>
cc

Subject
RE: [ECOS] Trouble using lwIP (driver crash...)






I ran udpecho with the same problem. I boost the "Size of per thread stack
in lwIP" to 32Kb and still got the same problem.

I enabled CYGFUN_KERNEL_ALL_THREADS_STACK_CHECKING and now I got:

ASSERT FAIL: <5>if_i82559.c[2370]i82559_can_send() send: Excess send
recursions


Before using lwIP, I was using FreeBSD and every eCos tests passed. Now I 
am
not able to build all the tests. In eCos Configuration Tool, Build Tests
stops with:

/home/michaelg/ecos/build/ecos_lwip_install/lib/extras.o: In function
'_GLOBAL__I.55000__home_michaelg_ecos_ecos_packages_compat_posix_current_src
_startup.cxx_75E51868_B69D580C':
make[1]: Leaving directory
'/home/michaelg/ecos/build/ecos_lwip_build/kernel/current'
/home/michaelg/ecos/ecos/packages/compat/posix/current/src/startup.cxx:(.bss
.statistics+0x0): multiple definition of 'statistics'
make: Leaving directory '/home/michaelg/ecos/build/ecos_lwip_build'
tests/stress_threads.o:/home/michaelg/ecos/ecos/packages/kernel/current/test
s/stress_threads.c:724: first defined here

/home/michaelg/ecos/gnutools/i386-elf/bin/../lib/gcc/i386-elf/3.4.5/../../..
/../i386-elf/bin/ld: Warning: size of symbol 'statistics' changes from 92 
in
tests/stress_threads.o to 32 in
/home/michaelg/ecos/build/ecos_lwip_install/lib/extras.o
collect2: ld returned 1 exit status
make[1]:
***[/home/michaelg/ecos/build/ecos_lwip_install/tests/kernel/current/tests/s
tress_threads] Error 1
make: *** [tests] Error 2


I ran thread0, thread1 and kthread1 without problems.

Do you think of some particular tests that I should run?


Thanks,
Michael


-----Original Message-----
From: uwe_kindler@web.de [mailto:uwe_kindler@web.de] 
Sent: April 4, 2006 11:45 AM
To: ecos-discuss@sourceware.org; michaelg@maxt.com
Subject: Re: [ECOS] Trouble using lwIP (driver crash...)

Did you ran any other lwip test successfully? Does the tcpecho, udpecho 
and sockets tests work properly. Did you ran any other eCos tests 
successfully?


 >Stack base corrupt - i: 0
 >...
 >...
 >ASSERT FAIL: <A>thread.inl[119]void Cyg_HardwareThread::check_stack() 
 >Stack
 >base corrupt
 >
 >Any idea what causes this?


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




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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [ECOS] Trouble using lwIP (driver crash...)
  2006-04-04 15:45 Uwe Kindler
@ 2006-04-04 17:10 ` Michael Grimard
  2006-04-05  7:26   ` Birahim Larou Fall
  0 siblings, 1 reply; 8+ messages in thread
From: Michael Grimard @ 2006-04-04 17:10 UTC (permalink / raw)
  To: ecos-discuss

I ran udpecho with the same problem. I boost the "Size of per thread stack
in lwIP" to 32Kb and still got the same problem.

I enabled CYGFUN_KERNEL_ALL_THREADS_STACK_CHECKING and now I got:

ASSERT FAIL: <5>if_i82559.c[2370]i82559_can_send() send: Excess send
recursions


Before using lwIP, I was using FreeBSD and every eCos tests passed. Now I am
not able to build all the tests. In eCos Configuration Tool, Build Tests
stops with:

/home/michaelg/ecos/build/ecos_lwip_install/lib/extras.o: In function
'_GLOBAL__I.55000__home_michaelg_ecos_ecos_packages_compat_posix_current_src
_startup.cxx_75E51868_B69D580C':
make[1]: Leaving directory
'/home/michaelg/ecos/build/ecos_lwip_build/kernel/current'
/home/michaelg/ecos/ecos/packages/compat/posix/current/src/startup.cxx:(.bss
.statistics+0x0): multiple definition of 'statistics'
make: Leaving directory '/home/michaelg/ecos/build/ecos_lwip_build'
tests/stress_threads.o:/home/michaelg/ecos/ecos/packages/kernel/current/test
s/stress_threads.c:724: first defined here

/home/michaelg/ecos/gnutools/i386-elf/bin/../lib/gcc/i386-elf/3.4.5/../../..
/../i386-elf/bin/ld: Warning: size of symbol 'statistics' changes from 92 in
tests/stress_threads.o to 32 in
/home/michaelg/ecos/build/ecos_lwip_install/lib/extras.o
collect2: ld returned 1 exit status
make[1]:
***[/home/michaelg/ecos/build/ecos_lwip_install/tests/kernel/current/tests/s
tress_threads] Error 1
make: *** [tests] Error 2


I ran thread0, thread1 and kthread1 without problems.

Do you think of some particular tests that I should run?


Thanks,
Michael


-----Original Message-----
From: uwe_kindler@web.de [mailto:uwe_kindler@web.de] 
Sent: April 4, 2006 11:45 AM
To: ecos-discuss@sourceware.org; michaelg@maxt.com
Subject: Re: [ECOS] Trouble using lwIP (driver crash...)

Did you ran any other lwip test successfully? Does the tcpecho, udpecho 
and sockets tests work properly. Did you ran any other eCos tests 
successfully?


 >Stack base corrupt - i: 0
 >...
 >...
 >ASSERT FAIL: <A>thread.inl[119]void Cyg_HardwareThread::check_stack() 
 >Stack
 >base corrupt
 >
 >Any idea what causes this?


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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [ECOS] Trouble using lwIP (driver crash...)
@ 2006-04-04 15:45 Uwe Kindler
  2006-04-04 17:10 ` Michael Grimard
  0 siblings, 1 reply; 8+ messages in thread
From: Uwe Kindler @ 2006-04-04 15:45 UTC (permalink / raw)
  To: ecos-discuss, michaelg

Did you ran any other lwip test successfully? Does the tcpecho, udpecho 
and sockets tests work properly. Did you ran any other eCos tests 
successfully?


 >Stack base corrupt - i: 0
 >...
 >...
 >ASSERT FAIL: <A>thread.inl[119]void Cyg_HardwareThread::check_stack() 
 >Stack
 >base corrupt
 >
 >Any idea what causes this?

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [ECOS] Trouble using lwIP (driver crash...)
  2006-04-04 13:33   ` Andrew Lunn
@ 2006-04-04 14:36     ` Michael Grimard
  0 siblings, 0 replies; 8+ messages in thread
From: Michael Grimard @ 2006-04-04 14:36 UTC (permalink / raw)
  To: ecos-discuss

I found what cause limits.h to include cyg/fileio/limits.h.

In eCos Configuration Tool, under ISO C and POSIX infrastructure, there is a
Limits section. In this section, there are OPEN_MAX and NAME_MAX
implementation header that points to <cyg/fileio/limits.h>. Both were
checked.
I don't know why there were checked, since by default they are not. I
unchecked them and now the build works.


For the nc_test_slave, I will only test with the UDP part, so SO_REUSE will
not be a problem. I put this in comments, compile and run. When I ping it, I
got:

Stack base corrupt - i: 0
...
...
ASSERT FAIL: <A>thread.inl[119]void Cyg_HardwareThread::check_stack() Stack
base corrupt

Any idea what causes this?


Thanks,
Michael

-----Original Message-----
From: Andrew Lunn [mailto:andrew@lunn.ch] 
Sent: April 4, 2006 9:34 AM
To: Michael Grimard
Cc: ecos-discuss@sourceware.org
Subject: Re: [ECOS] Trouble using lwIP (driver crash...)

On Tue, Apr 04, 2006 at 09:20:28AM -0400, Michael Grimard wrote:
> Hi,
> 
> When I compile without the File IO package I got:
> 
> In file included from
> /my_path_to_ecos/ecos/packages/infra/current/src/diag.cxx:65:
> /my_path_to_ecos/ecos_lwip_install/include/limits.h:175:37:
> cyg/fileio/limits.h: No such file or directory

This does not look like a direct lwip problem. 

Could you find out why limits.h is trying to include
cyg/fileio/limits.h. To me it seems like a configuration problem, but
i'm jumping to a conclusion with very limmited information. Could you
export your configuration and post it.

> For nc_test_slave, I got the "Not Applicable" message when I ran it, but I
> didn't try it before running nc_test_master, since nc_test_slave is part
of
> the tests that come with lwIP. Maybe, it needs to be remove?

The reason the test has been kept is that we hope the upstream
maintains of lwip will put back the setsockopt() calls the test needs.

        Andrew


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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [ECOS] Trouble using lwIP (driver crash...)
  2006-04-04 13:20 ` Michael Grimard
@ 2006-04-04 13:33   ` Andrew Lunn
  2006-04-04 14:36     ` Michael Grimard
  0 siblings, 1 reply; 8+ messages in thread
From: Andrew Lunn @ 2006-04-04 13:33 UTC (permalink / raw)
  To: Michael Grimard; +Cc: ecos-discuss

On Tue, Apr 04, 2006 at 09:20:28AM -0400, Michael Grimard wrote:
> Hi,
> 
> When I compile without the File IO package I got:
> 
> In file included from
> /my_path_to_ecos/ecos/packages/infra/current/src/diag.cxx:65:
> /my_path_to_ecos/ecos_lwip_install/include/limits.h:175:37:
> cyg/fileio/limits.h: No such file or directory

This does not look like a direct lwip problem. 

Could you find out why limits.h is trying to include
cyg/fileio/limits.h. To me it seems like a configuration problem, but
i'm jumping to a conclusion with very limmited information. Could you
export your configuration and post it.

> For nc_test_slave, I got the "Not Applicable" message when I ran it, but I
> didn't try it before running nc_test_master, since nc_test_slave is part of
> the tests that come with lwIP. Maybe, it needs to be remove?

The reason the test has been kept is that we hope the upstream
maintains of lwip will put back the setsockopt() calls the test needs.

        Andrew

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [ECOS] Trouble using lwIP (driver crash...)
  2006-04-03 23:02 Uwe Kindler
@ 2006-04-04 13:20 ` Michael Grimard
  2006-04-04 13:33   ` Andrew Lunn
  0 siblings, 1 reply; 8+ messages in thread
From: Michael Grimard @ 2006-04-04 13:20 UTC (permalink / raw)
  To: ecos-discuss

Hi,

When I compile without the File IO package I got:

In file included from
/my_path_to_ecos/ecos/packages/infra/current/src/diag.cxx:65:
/my_path_to_ecos/ecos_lwip_install/include/limits.h:175:37:
cyg/fileio/limits.h: No such file or directory

For nc_test_slave, I got the "Not Applicable" message when I ran it, but I
didn't try it before running nc_test_master, since nc_test_slave is part of
the tests that come with lwIP. Maybe, it needs to be remove?


Michael


-----Original Message-----
From: ecos-discuss-owner@ecos.sourceware.org
[mailto:ecos-discuss-owner@ecos.sourceware.org] On Behalf Of Uwe Kindler
Sent: April 3, 2006 5:38 PM
To: ecos-discuss@sourceware.org
Cc: michaelg@maxt.com
Subject: Re: [ECOS] Trouble using lwIP (driver crash...)

Hello,

which file does include cyg/fileio/limits.h? I searched the whole lwIP 
stack sources but did not found any file that includes limits.h.

The nc_test_slave is currently not applicable because SO_REUSEADDR and 
SO_REUSEPORT are not supported at the moment and the nc_test_slave 
requires both.

Regards, Uwe




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


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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [ECOS] Trouble using lwIP (driver crash...)
@ 2006-04-03 23:02 Uwe Kindler
  2006-04-04 13:20 ` Michael Grimard
  0 siblings, 1 reply; 8+ messages in thread
From: Uwe Kindler @ 2006-04-03 23:02 UTC (permalink / raw)
  To: ecos-discuss; +Cc: michaelg

Hello,

which file does include cyg/fileio/limits.h? I searched the whole lwIP 
stack sources but did not found any file that includes limits.h.

The nc_test_slave is currently not applicable because SO_REUSEADDR and 
SO_REUSEPORT are not supported at the moment and the nc_test_slave 
requires both.

Regards, Uwe




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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2006-04-05  7:26 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-03 13:14 [ECOS] Trouble using lwIP (driver crash...) Michael Grimard
2006-04-03 23:02 Uwe Kindler
2006-04-04 13:20 ` Michael Grimard
2006-04-04 13:33   ` Andrew Lunn
2006-04-04 14:36     ` Michael Grimard
2006-04-04 15:45 Uwe Kindler
2006-04-04 17:10 ` Michael Grimard
2006-04-05  7:26   ` Birahim Larou Fall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).