lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] problems with LWIP , xilinx & XPS 10.1 sp3


From: steve birtles
Subject: [lwip-users] problems with LWIP , xilinx & XPS 10.1 sp3
Date: Fri, 23 Jan 2009 18:04:17 +0800

Hi Guys,

I'm working on an application that  connects to a remote server, for the sake of testing lets say the remote server port is 80.

The FPGA is a XUPV2P  board , that has been tested with the inbuilt utilities and the tcp/ip port works and will support a demo webserver.
The cables are good, the led's are on , and flash when the board is pinged (though a reply is nver returned)

The version of LWIP is 3.00a in RAW API mode.

We have a function that initialises the  tcp/ip, along the lines of:

 init_tcpip(){
........
lwip_init();
......
if (!xemac_add(&default_netif, &ipaddr, &netmask, &gw, mac_ethernet_address, EMAC_BASEADDR)) { 
printf("Error adding N/W interface\n\r"); 
return; // -1; 
        } 

netif_set_default(&default_netif);
netif_set_up(&default_netif);
}

then we call this to trigger a connection

int connect_server(void)
{
struct ip_addr server;
IP4_ADDR(&server, 192, 168, 5, 52); //our server (mac)
printf(" *  Image server at %u.%u.%u.%u\n",
ip4_addr1(&server), ip4_addr2(&server), ip4_addr3(&server), ip4_addr4(&server));

struct tcp_pcb *tpcb = tcp_new();
if (!tpcb)
{
printf("FATAL: tcp_new() failed\n");
return -1;
}

tcp_err(tpcb, error);
tcp_sent(tpcb, data_sent);
tcp_poll(tpcb, data_poll, 4);
//printf(" * connecting...\n");
//just queue a SYN, it does not actually wait for connection!!
//port 7683
if (tcp_connect(tpcb, &server, 80, connected))
{
printf("tcp connect failed!\n");
return 1;
} else{
printf("tcp SYN Queued!\n");
return 0;
}
}


What we see next is interesting:
using wire shark, the  board sends out a single ARP packet to the destination server, and a reply is sent back from the server to the FPGA board.
in about 0.2ms.

However  LWIP has the debug code turned on, and it clearly shows  4 ARP packets being triggered , and nothing being recived to the FPGA, in response to the ARP.

the connection then failes due to the ARP time out.

The LWIP never even makes it as far as the  callback "connected" routine, from the tcp_connect.
 it is as if there is some sort of error occuring inside of LWIP, that causes the connection to fail.


I would assume that if the first ARP packet is making it to the wire, then surely , i'm fairly close to a solution.

 where do i start looking, and how would i debug this?



Steve









reply via email to

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