--- Quote Start ---
Hi,
i'm working with the LwIP (standalone version) TCP/IP Stack on a NIOS II system and want to use it to send UDP messages. My problem is that when I call the udp_send() function the system is dead. At the end
of this funktion a pbuf_free call kills it with the message
"Assertion "pbuf_free: sane flags" failed at line 556 in ../lwip-0.7.1/src/core/p
buf.c"
Has somebody a explanation for this?
Thankx a lot
revolt
My code:
pbuf1 = pbuf_alloc(PBUF_TRANSPORT,100,PBUF_RAM); //Get a pbuf struct.
udpSkt = udp_new();
udp_bind(udpSkt,IP_ADDR_ANY,1024);
IP4_ADDR(&udpDestIpAddr, 192, 168, 0, 10);
udp_connect(udpSkt,&udpDestIpAddr,69); //Set-up socket withdest IP and port.
udp_recv(udpSkt,&udp_recv_packet, &FillBuff);
// Send wrq
pbuf1->payload = (void*)wrq;
pbuf1->tot_len = 17;
pbuf1->len = 17;
-> udp_send(udpSkt,pbuf1); <-
--- Quote End ---
Almost always this sane pbuf message is caused from memory overwrite during program run. Is you stack size good? Are you checking return values from lwIP and runtime functions? If you're using an RTOS, lwIP can be accessed from only one thread.
Bill