UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

取消
显示结果 
搜索替代 
您的意思是: 
Visitor zynqdiouf
Visitor
465 次查看
注册日期: ‎06-08-2016

lwIP netif: 'unable to alloc pbuf in recv_handler' message and 网络通讯异常

情况:

     用Lwip作为客户端,每秒发送业务数据到PC服务端,服务端会回复信息标记。然后在工作n(n < 4)小时以后,在终端调试助手会显示

'unable to alloc pbuf in recv_handler' 

'unable to alloc pbuf in recv_handler' 

'unable to alloc pbuf in recv_handler' 

然后调试发现下面程序中p返回值为0:

 

"pbuf.c"文件中

struct pbuf *
pbuf_alloc(pbuf_layer layer, u16_t length, pbuf_type type)
{

...

    p = (struct pbuf *)memp_malloc(MEMP_PBUF_POOL);
    LWIP_DEBUGF(PBUF_DEBUG | LWIP_DBG_TRACE, ("pbuf_alloc: allocated pbuf %p\n", (void *)p));
    if (p == NULL) {
      PBUF_POOL_IS_EMPTY();
      return NULL;
    }

...

}

 

查阅xilinx网站发现有类似情况,但没有看懂如何解决,如下两条参考链接:

https://forums.xilinx.com/t5/Embedded-Processor-System-Design/lwIP-netif-unable-to-alloc-pbuf-in-recv-handler-message/td-p/743941

 

https://forums.xilinx.com/t5/Embedded-Processor-System-Design/lwIP-netif-unable-to-alloc-pbuf-in-recv-handler-message/m-p/752919#M19351

 

请问如何解决或调试这个问题。

 

 

 

0 项奖励
1 条回复1
Xilinx Employee
Xilinx Employee
392 次查看
注册日期: ‎04-15-2011

回复: lwIP netif: 'unable to alloc pbuf in recv_handler' message and 网络通讯异常

@zynqdiouf

通常碰到的这类错误,是指pbuf数量不够处理接收的packets。

你可以试试把BSP里的lwIP的下面几个参数增大,你贴的链接里,指的也是这几个参数。

Capture.PNG

 

-------------------------------------------------------------------------
Don't forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 项奖励