Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12603 Discussions

Problems with receiving UDP-messages

Altera_Forum
Honored Contributor II
982 Views

Hi all, 

 

send UDP-messages isn't a problem anymore. But now, when I try to send a message from pc to nios II, my data doesn't arrive and ethereal tells me that the IP-header checksum is 0x0000. When I chat with the program (it's a udp-version of a small chatprogram) it works fine. We written it ourselves, but for some reason, I doesn't cooperate with my NIOS II. 

 

This is what I use for receiving data: 

 

*************************************************************** 

while(1) 

 

lan91c111if_service(&netif); 

 

pcb = udp_new(); 

udp_recv(pcb, udp_callback, 666); 

udp_bind(pcb, IP_ADDR_ANY, 666); 

// udp_callback_function(recvBuffer, pcb, p, &destIpAddr, 666); 

 

*************************************************************** 

 

CALLBACK 

 

 

*************************************************************** 

 

void udp_callback_function(void *recvBuffer, struct udp_pcb *pcb, struct  

pbuf *p, struct ip_addr *ipaddr, u16_t port) 

recvBuffer = p->payload; 

printf(recvBuffer); 

pbuf_free(p); 

udp_remove(pcb); 

 

************************************************************** 

 

Could anyone tell me what I'm doing wrong!? Thanks in advance. 

 

Danny
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
271 Views

Ok now I can receive messages http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/smile.gif .. But now it seems that I can&#39;t receive large files. After a couple of messages it just stops receiving. I think I need to clear a buffer or anything... Or free memory... help anyone!? 

 

Thanks, 

 

Danny
0 Kudos
Altera_Forum
Honored Contributor II
271 Views

I know what the problem is: 

 

in lwipopts.h PBUF_POOL_SIZE is defined as 32. When I sent 32 strings it stops. But m question is: how do I clear it. There must be a way. When I use pbuf_free, it doesn&#39;t seem to be much of help.
0 Kudos
Altera_Forum
Honored Contributor II
271 Views

No problems anymore also fixed it.... Only one question left: how large is the max size of a packages which is received by NIOS?! 

 

cheers, 

 

Danny
0 Kudos
Reply