> On Behalf Of V?ctor Mateo We have an annoying error using lwIP.
Our software is a NIOSII C/C++ application, without Operating System and
Superloop.

> We are experiencing intermittent errors while trying to
receive an UDP message, proccess data and send this proccesed data
back.
 -Assertion "bad pbuf type" failed at line 548 in
../lwIP/src/core/pbuf.c  t;ref == 1" failed at line 599 in
../lwIP/src/core/ipv4/ip.c
e see the UDP packet handling code? It sounds
like memory overwriting or using a NULL pbuf. Bill  : 
> 
>
------------------------------------------------------------------
-------------------------------------------------------------


static void UDP_decoder(void *arg, struct udp_pcb *pcb_new, struct
pbuf *p, struct ip_addr *addr, u16_t port) 

{
 alt_u8 *param_pointer; 

Rx_Command= NONE; 
 LWIP_UNUSED_ARG(arg);
 if(p == NULL)
 return;

memcpy ( buf, p->payload, MAX_UDP_LENGHT );

 if( !strncmp ( (void*)
HEADER_PARAMS, (void*)buf,6 ) ) {
 //:More Code Here:// 
 } 
 else if(
!strncmp ( (void*) HEADER_PARAM2, (void*)buf,6 ) ) {
 //:More Code
Here:// 
 }

 pbuf_free(p); 
 udp_remove(pcb_new);

}

void Rx_UDP() {

struct udp_pcb *pcb_new;
 pcb_new = udp_new();
 udp_bind(pcb_new,
IP_ADDR_ANY, FPGA_PORT);
 udp_recv(pcb_new , UDP_decoder,
NULL);
}

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


We call Rx_UDP() in an infinite while(1), so we can update parameters
anytime we send it trough the host. 

Maybe I am not "closing" fine pbuf
or pcb? Should I use "udp_disconnect(pcb_new)" or anything else? 

  
_______________________________________________
lwip-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to