Nios® II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.

stand-alone lwip ARP problem

Altera_Forum
Honored Contributor II
1,021 Views

Dear all ! 

 

I have downloaded stand-alone lwip from our forum "Test IP" .My design is to build a simple udp-client that sending data to PC with stand-alone lwip .But this version seems too old (version 0.7.1,developped on 2005 ,now the lastest version is 1.3.0)I guess MAYBE there is a bug in ARP modle ,here is the problem i hit: 

 

If i run my application, it does not send any UDP packets ( see that in Ethereal ). 

However ,after runing anther application udp_echo (data send and return ) ,stop it and run my application ,my app runs very well .I 'm very confused ! 

 

So i guess MAYBE there is a bug in our stand-alone lwip .Here is my reason.  

when i run the UDP_ECHO app, PC send a udp packet to board ,so our board konw the IP address and MAC addess of PC ,and update it to ARP cache . Then run my app ,the app konws the destination host ' IP address and MAC addess (PC),so it works well. If i run my app only ,it does not konw the PC 's MAC addess , therefore it work fail.Though PC send gratuitous arps ,but the lwip can't update it to the ARP cache . 

 

Am i right ? And how to resolve it ?  

Is there someone work similar with me ? or could send a simple udp-client example (stand-alone lwip version) to me ! 

Thank you ! My MSN and my email is the_gadfly@163.com 

----------my app------------- 

... 

... 

P4_ADDR(&udpDestIpAddr, 10, 1 ,1, 52); 

p = pbuf_alloc(PBUF_TRANSPORT,sizeof(Test),PBUF_RAM); 

memcpy(p->payload, Test, sizeof(Test)); 

pcb = udp_new();  

udp_bind(pcb, IP_ADDR_ANY, 60000);  

udp_connect(pcb, &udpDestIpAddr, 60000);  

 

 

for(i=0;i<1000;i++) 

udp_send(pcb,p); 

 

 

pbuf_free(p); 

udp_remove(pcb); 

 

--------udp_echo app------------ 

 

void udp_echo_recv(void *arg, struct udp_pcb *pcb, struct pbuf *p, struct ip_addr *addr, u16_t port)  

{ struct ip_addr ipaddr; 

IP4_ADDR(&ipaddr,10,1,1,52); 

if (p != NULL) 

{  

udp_connect(pcb,&ipaddr,60000); 

udp_send(pcb, p);  

 

pbuf_free(p);  

}  

}  

 

 

void udp_echo_init(void)  

{  

struct udp_pcb * pcb;  

pcb = udp_new();  

udp_bind(pcb, IP_ADDR_ANY, 60000) ; 

udp_recv(pcb, udp_echo_recv, NULL);  

 

}  

------------------------------------------- 

 

Best regards  

the_gadfly  

 

0 Kudos
1 Reply
Apara
Beginner
219 Views

Hi,

I too want to implement the lwip with DE2-115 FPGA , But I am facing difficulty in  spoc builder component connections.As I am new Altera I tried  with basic Ethernet design based on below link.

https://www.intel.com/content/www/us/en/programmable/support/support-resources/design-examples/intel...

When I adding these component and additional peripheral as suggest in message , I unable connect these.

I am confuse what should  the component, its value and how to connect with others.Please guide little

Reply