lwip-users
[Top][All Lists]
Advanced

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

RE: [lwip-users] udp/lwip on xilinx


From: Matthew Yingling
Subject: RE: [lwip-users] udp/lwip on xilinx
Date: Thu, 5 Oct 2006 17:37:25 -0400

What do you mean by "Why the end of the lines was not shown?"?

I found that changing

contrib\ports\v2pro\include\arch\cc.h

from

#define LWIP_PLATFORM_DIAG(x) do {xil_printf x;} while(0)

to

#define LWIP_PLATFORM_DIAG(x) do {printf x;} while(0)

helps make debugging actually useful on the Xilinx platform.  xil_printf
can't handle %p delimiters and requires explicit \r\n pairs instead of
inserting \r with \n, and this makes the LwIP debug output very difficult to
use otherwise.

Matthew

-----Original Message-----
From: address@hidden
[mailto:address@hidden Behalf Of Haori
Yang
Sent: Thursday, October 05, 2006 5:31 PM
To: Mailing list for lwIP users
Subject: Re: [lwip-users] udp/lwip on xilinx


guys,

   I capture the output of the hyper terminal. for some reason, the error
about "can't allocate ** bytes" just disappeared. I didn't even change the
code. I enabled the xilmfs library and set the starting address of the
program in the 16Mb sdram the board has.

  the hyper terminal gives out this, before it freezes there. Why the end of
the lines was not shown? can you guys tell what's wrong here?

  another question would be when exactly should the led on the ethernet
connector be lighten? I connect a PC with a fpga board, using a crossover
cable. the leds were never lighten. I assume the connection between these
two was not created at all, right?

  thanks,

haori

netif_set_ipaddr: netif address being changed
netif: IP address of interface    set to ...
netif: netmask of interface    set to ...
netif: GW address of interface    set to ...
netif: added interface e0 IP addr ... netmask ... gw ...
netif: setting default interface e0
udp_bind(ipaddr = ..., port = )
udp_bind: bound to ..., port
udp_connect: connected to ..., port
pbuf_alloc(length=)
pbuf_alloc(length=) ==
udp_send
pbuf_header: failed as  <
pbuf_alloc(length=)
pbuf_alloc(length=) ==
pbuf_chain:  references
udp_send: added header pbuf  before given pbuf
udp_send: sending datagram of length
udp_send: UDP packet length
udp_send: UDP checksum 0xB66A
udp_send: ip_output_if (,,,,IP_PROTO_UDP,)
pbuf_header: old  new  (619814488)
ip_output_if: e0
IP header:
+-------------------------------+
| 4 | 5 |  0x00 |          | (v, hl, tos, len)
+-------------------------------+
|          ||       | (id, flags, offset)
+-------------------------------+
|    |    |    0x00FF     | (ttl, proto, chksum)
+-------------------------------+
|  149  |  199  |    6  |  108  | (src)
+-------------------------------+
|  149  |  199  |    6  |  107  | (dest)
+-------------------------------+
netif->output()pbuf_header: old  new  (619814468)
pbuf_take()
pbuf_take: skipping pbuf not of type PBUF_REF
pbuf_take: skipping pbuf not of type PBUF_REF
pbuf_take: end of chain reached.
pbuf_alloc(length=)
pbuf_alloc(length=) ==







On 10/5/06, Sathya Thammanur <address@hidden> wrote:
Hi Haori,
You need to ensure that the hardware is working first. Can you check if the
TestApp_Peripheral example that is created as part of BSB works without any
issues? If not then the hardware has issues. If it does work, then you try
to see if you are getting interrupts with Emac or not. You can enable the
debug option for lwip library in XPS and see if your hyper terminal does
print out all the debug messages when you try to ping th eboard.

Sathya




On 10/4/06, Haori Yang <address@hidden > wrote:
You are absolutely right about this! , you are good... I found this error.
the code can be compiled all right.

But the whole design just doesn't work.

I was checking the mail archive, I saw that you've done this kind of stuff
before. could you give me some hint what could possiblely went wrong? My
setup:  AvNet Virtex4LX25 Evaluation board + Xilinx EDK 8.1i. I connected my
desktop and the board with a crossover cable.

I used BSB create a project. then, go to software platform setting, select
lwip. set the 'emac_instances' of the lwip.
Generate netlist, Generate library. create a new project, import the code I
post. compile the project (set as 'initialize bram'). update bit file,
download bit file to fpga. the 'done' comes on.

but my desktop always shows that 'network connection' is unplugged... and
the led on the ethernet connector never comes up.

It's so simple that I can't think of anything that might be wrong. it's
killing me...

I'll atttach the mhs and mss files.




On 10/4/06, Pisano, Edward A < address@hidden> wrote:
All of your "undefined reference" errors are to functions in the lwIP
library, but I don't see the lwIP4lib called out on your 'make' line.
 The –L identifies the correct path to the directory containing the library,
but you need to add the "-llwip4" to your make line.  If you're working in
the XiLinx Platform Studio, right-click on "Compiler Options", go to the
"Paths and Options" tab and specify 'lwip4' in the "Libraries to Link
against" field.

Regards,
Ed



From: address@hidden
[mailto:address@hidden On Behalf Of
Haori Yang
Sent: Wednesday, October 04, 2006 6:52 PM
To: Mailing list for lwIP users
Subject: Re: [lwip-users] udp/lwip on xilinx

Hi, Ed

  do you happen to know why am I getting a lot of undefined reference?

  like this?  I am using EDK 8.1i

  At Local date and time: Wed Oct 04 21:49:35 2006
 xbash -q -c "cd /cygdrive/e/Temp/MicroDemo/WebClient2/; /usr/bin/make -f
system.make WebClient_program; exit;" started...
mb-gcc -O2 Send2PC/send.c  -o WebClient/executable.elf \
    -mno-xl-soft-mul     -Wl,-T -Wl,TestApp_Peripheral/src/TestApp_Periphera
l_LinkScr.ld  -g    -I./microblaze_0/include/  -L./microblaze_0/lib/  \


Send2PC/send.c:79:2: warning: no newline at end of file

/cygdrive/c/DOCUME~1/Haori/LOCALS~1/Temp/ccH5S4ia.o: In function `main':
/cygdrive/e/Temp/MicroDemo/WebClient2/Send2PC/send.c:30: undefined reference
to `mem_init'
/cygdrive/e/Temp/MicroDemo/WebClient2/Send2PC/send.c:35: undefined reference
to `memp_init'
/cygdrive/e/Temp/MicroDemo/WebClient2/Send2PC/send.c:36: undefined reference
to `pbuf_init'
/cygdrive/e/Temp/MicroDemo/WebClient2/Send2PC/send.c:39: undefined reference
to `xemacif_setmac'
/cygdrive/e/Temp/MicroDemo/WebClient2/Send2PC/send.c:44: undefined reference
to `netif_init'
/cygdrive/e/Temp/MicroDemo/WebClient2/Send2PC/send.c:46: undefined reference
to `udp_init'
/cygdrive/e/Temp/MicroDemo/WebClient2/Send2PC/send.c:48: undefined reference
to `mem_malloc'
/cygdrive/e/Temp/MicroDemo/WebClient2/Send2PC/send.c:50: undefined reference
to `XEmacIf_ConfigTable'
/cygdrive/e/Temp/MicroDemo/WebClient2/Send2PC/send.c:52: undefined reference
to `xemacif_init'
/cygdrive/e/Temp/MicroDemo/WebClient2/Send2PC/send.c:52: undefined reference
to `ip_input'
/cygdrive/e/Temp/MicroDemo/WebClient2/Send2PC/send.c:52: undefined reference
to `netif_add'
/cygdrive/e/Temp/MicroDemo/WebClient2/Send2PC/send.c:60: undefined reference
to `netif_set_default'
/cygdrive/e/Temp/MicroDemo/WebClient2/Send2PC/send.c:60: undefined reference
to `udp_new'
/cygdrive/e/Temp/MicroDemo/WebClient2/Send2PC/send.c:64: undefined reference
to `udp_connect'
/cygdrive/e/Temp/MicroDemo/WebClient2/Send2PC/send.c:68: undefined reference
to `pbuf_alloc'
/cygdrive/e/Temp/MicroDemo/WebClient2/Send2PC/send.c:74: undefined reference
to `udp_send'
collect2: ld returned 1 exit status
make: *** [WebClient/executable.elf] Error 1

Done!
On 10/4/06, Pisano, Edward A < address@hidden> wrote:
Hello,
I just glanced at the code, but noticed that your remote_pcb is not bound to
a local endpoint.  I believe both ends must be grounded with an endpoint.
Your remote_pcb uses udp_connect() to specify the remote endpoint IP Address
and port number, but isn't bound to a local IP Address and port number.


// local_pcb = udp_new();
 remote_pcb = udp_new();
// udp_bind(local_pcb, &ipaddr, (u16_t)8080);
 udp_bind(remote_pcb, IP_ADDR_ANY, (u16_t)8081);
 udp_connect(remote_pcb, &remoteip, (u16_t)8080);

Regards,
Ed




From: lwip-users-bounces+edward.pisano= address@hidden [mailto:
address@hidden On Behalf Of Haori Yang
Sent: Wednesday, October 04, 2006 6:17 PM
To: address@hidden
Subject: [lwip-users] udp/lwip on xilinx

Guys,

   I am trying to implement a udp client on a xilinx fpga. here's my code. I
am getting "undefined reference" errors. could you take a look at it?
Thanks.

  I appreciate your help.


 #include "xparameters.h"

/* lwIP Includes */
#include "netif/xemacif.h"
#include "lwip/tcp.h"
#include "lwip/udp.h"
#include "lwip/memp.h"
#include "lwip/mem.h"
#include "netif/etharp.h"
#include "lwip/sys.h"


extern XEmacIf_Config XEmacIf_ConfigTable[];

int main(void)
{
        struct udp_pcb *local_pcb;
        struct udp_pcb *remote_pcb;
       struct ip_addr ipaddr, netmask, gateway, remoteip;
        struct netif *default_netif;
        char low_mac[3] = {0x00,0x22,0x38};
        unsigned char fullmac[6] = {0x00, 0x0A, 0x35, 0x00, 0x22, 0x38};
        unsigned char ip_address[4] = {149,199,6,108};
        unsigned char ip_remote[4] = {149,199,6,107};
        unsigned char subnet[4] = {255,255,255,0};
        unsigned char gateway_addr[4] = {149,199,6,254};
        struct pbuf *p;
        void *tmpPtr;
        unsigned char buffer[4096] = "beetje flauw\n";
        unsigned char *buffPtr;


sys_init();
mem_init();
memp_init();
pbuf_init();

xemacif_setmac(0, (u8_t *)fullmac);

IP4_ADDR(&ipaddr, ip_address[0], ip_address[1], ip_address[2],
ip_address[3]);
IP4_ADDR(&netmask, subnet[0], subnet[1], subnet[2], subnet[3]);
IP4_ADDR(&gateway, gateway_addr[0], gateway_addr[1], gateway_addr[2],
gateway_addr[3]);
IP4_ADDR(&remoteip, ip_remote[0], ip_remote[1], ip_remote[2], ip_remote[3]);

netif_init();

udp_init();

 tmpPtr = mem_malloc((mem_size_t)sizeof(struct netif));
 default_netif = (netif *) tmpPtr;
 default_netif = netif_add(default_netif,
                             &ipaddr,
                             &netmask,
                             &gateway,
                             &XEmacIf_ConfigTable[0],
                             xemacif_init,
                             ip_input);

 netif_set_default(default_netif);


// local_pcb = udp_new();
 remote_pcb = udp_new();
// udp_bind(local_pcb, &ipaddr, (u16_t)8080);
 udp_connect(remote_pcb, &remoteip, (u16_t)8080);

 p = pbuf_alloc(PBUF_TRANSPORT,4096,PBUF_RAM);
 p->payload = buffer;


 for (;;)
 {
     udp_send(remote_pcb, p);
 }

  return 0;

}

_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users


_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users





_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users






_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users





reply via email to

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