EmbeddedRelated.com
Forums
Memfault Beyond the Launch

compile error implementation lwIP on a LPC2378

Started by fretkroket December 22, 2008
After I successfully tested the enet.zip project from the files
section, I was trying to implement the lwIP IP stack from Adam Dunkels.

I include all the necessary c and header files.
After compiling in Eclipse with the armGCC compiler I get the
following error:

main.o -lc
tcp_in.o: In function `tcp_receive':
GNU ld version 2.17
ethernet/lwip/tcp_in.c:734: undefined reference to `__divsi3'
c:\gccfd\yagarto\bin\../arm-elf/lib\libc.a(lib_a-syscalls.o): In
function `_sbrk':
../../../../../../newlib-1.15.0/newlib/libc/sys/arm/syscalls.c:506:
undefined reference to `end'
make: *** [main.out] Error 1

On line tcp_in.c:734 there is the following C code rule:
u16_t new_cwnd = (pcb->cwnd + pcb->mss * pcb->mss / pcb->cwnd);

Could anyone please help me, what goes wrong?
I also can't solve the syscalls.c error.

An Engineer's Guide to the LPC2100 Series

fretkroket wrote:
> After I successfully tested the enet.zip project from the files
> section, I was trying to implement the lwIP IP stack from Adam
> Dunkels.
>
> I include all the necessary c and header files.
> After compiling in Eclipse with the armGCC compiler I get the
> following error:
>
> main.o -lc
> tcp_in.o: In function `tcp_receive':
> GNU ld version 2.17
> ethernet/lwip/tcp_in.c:734: undefined reference to `__divsi3'
> c:\gccfd\yagarto\bin\../arm-elf/lib\libc.a(lib_a-syscalls.o): In
> function `_sbrk':
> ../../../../../../newlib-1.15.0/newlib/libc/sys/arm/syscalls.c:506:
> undefined reference to `end'
> make: *** [main.out] Error 1
>
> On line tcp_in.c:734 there is the following C code rule:
> u16_t new_cwnd = (pcb->cwnd + pcb->mss * pcb->mss / pcb->cwnd);
>
> Could anyone please help me, what goes wrong?
> I also can't solve the syscalls.c error.

It's trying to call a function to do the integer divide, that seems not to
be present on your system. The sbrk error can be fixed by adding something
like this to your linker input file:
PROVIDE (end = .);
Put it right after:
_end = . ;

There are to many errors to get lwIP working.
It is to complex for me, so I decided to delete the whole lwIP section.
At this moment I had a working MAC and can ping and arp my
developement board. Ping and ARp is nothing else then simply edit the
request and send it back.

Now I try to implement uIP, but sends its packets with uIP_send()
function.
Is here anyone who connected this function correctly with his MAC?
> -----Original Message-----
> From: l...
> [mailto:l...] On Behalf Of fretkroket
> Sent: 23 December 2008 16:56
> To: l...
> Subject: [lpc2000] Re: compile error implementation lwIP on a LPC2378
>
> There are to many errors to get lwIP working.
> It is to complex for me, so I decided to delete the whole
> lwIP section.
> At this moment I had a working MAC and can ping and arp my
> developement board. Ping and ARp is nothing else then simply
> edit the request and send it back.
>
> Now I try to implement uIP, but sends its packets with
> uIP_send() function.
> Is here anyone who connected this function correctly with his MAC?

See:
http://www.freertos.org/portlpc2368_Eclipse.html
http://www.freertos.org/portlpc2368uIP.html

Regards,
Richard.

+ http://www.FreeRTOS.org
Designed for Microcontrollers. More than 7000 downloads per month.

+ http://www.SafeRTOS.com
Certified by T as meeting the requirements for safety related systems.

Thanx,

When I don't want an OS like FreeTOS, then the "main" loop is in
uIP_task.c?

In that file, there is a task for checking if you received a packet.
But what do i have to do if i would send a TCP packet with data?
Could you please explain the right function order?

static void prvENET_Send(void) is the tcp send function?
And uip_appdata contains my data string?
--- In l..., "FreeRTOS.org Info" wrote:
>
> > -----Original Message-----
> > From: l...
> > [mailto:l...] On Behalf Of fretkroket
> > Sent: 23 December 2008 16:56
> > To: l...
> > Subject: [lpc2000] Re: compile error implementation lwIP on a LPC2378
> >
> > There are to many errors to get lwIP working.
> > It is to complex for me, so I decided to delete the whole
> > lwIP section.
> > At this moment I had a working MAC and can ping and arp my
> > developement board. Ping and ARp is nothing else then simply
> > edit the request and send it back.
> >
> > Now I try to implement uIP, but sends its packets with
> > uIP_send() function.
> > Is here anyone who connected this function correctly with his MAC?
>
> See:
> http://www.freertos.org/portlpc2368_Eclipse.html
> http://www.freertos.org/portlpc2368uIP.html
>
> Regards,
> Richard.
>
> + http://www.FreeRTOS.org
> Designed for Microcontrollers. More than 7000 downloads per month.
>
> + http://www.SafeRTOS.com
> Certified by T as meeting the requirements for safety related systems.
>

> Thanx,
>
> When I don't want an OS like FreeTOS, then the "main" loop is
> in uIP_task.c?
>
> In that file, there is a task for checking if you received a packet.
> But what do i have to do if i would send a TCP packet with data?
> Could you please explain the right function order?
>
> static void prvENET_Send(void) is the tcp send function?
> And uip_appdata contains my data string?

See http://www.sics.se/~adam/uip/uip-1.0-refman/ - there is also a pdf
version available.

Regards,
Richard.

+ http://www.FreeRTOS.org
Designed for Microcontrollers. More than 7000 downloads per month.

+ http://www.SafeRTOS.com
Certified by T as meeting the requirements for safety related systems.


Memfault Beyond the Launch