- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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); <-Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Has somebody a example for using lwip (standalone version) and UDP to send data?
My board sends an ARP and then its dead. regards revolt- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear Revolt,
I am sorry ...i havn't come with solution...rather i am looking for sample UDP code who will communicate from NIos to PC through UDP, as your problem says that you have write udp code which communicate with pc. so please share with me this peace of information kaushal- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- 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

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page