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!

cancel
Showing results for 
Search instead for 
Did you mean: 
Adventurer
Adventurer
6,108 Views
Registered: ‎09-19-2016

lwIP netif: 'unable to alloc pbuf in recv_handler' message

Hi,

 

I have been trying to implement simple PC client application which only sends UDP packets to server application that runs on ZYNQ custom board and is only receiving packets. Everything works fine, until I put some random printf just after lwip_recvfrom() function in server app. Then I am getting many prints "unable to alloc pbuf in recv_handler" which is printed from setup_rx_bds() function placed in xemacpsif_dma.c file. However, app doesn't crash there, but continues to work on. Nevertheless, I would like to know what could be causing this message?

 

I am using lwIP v1.4.1 with FreeRTOS v8.2.3.

0 Kudos
4 Replies
Moderator
Moderator
6,075 Views
Registered: ‎09-12-2007

Re: lwIP netif: 'unable to alloc pbuf in recv_handler' message

Can you try update the xemacpsif_dma.c fIle from
Xil_SetTlbAttributes((s32_t)bd_space, DEVICE_MEMORY); // addr, attr
To
Xil_SetTlbAttributes((s32_t)bd_space, STRONG_ORDERED); // addr, attr
0 Kudos
Adventurer
Adventurer
6,027 Views
Registered: ‎09-19-2016

Re: lwIP netif: 'unable to alloc pbuf in recv_handler' message

Hi @stephenm,

 

in xemacpsif_dma.c I have found this line:

Xil_SetTlbAttributes((s32_t)bd_space, NORM_NONCACHE); // addr, attr

I changed the attribute to STRONG_ORDERED, but the behavior of the app was the same. Afterwards, I changed it to DEVICE_MEMORY, and app crashed completely whit this assert: "Assert failed in file port.c, line 424".

0 Kudos
Highlighted
Visitor sixinglu
Visitor
5,563 Views
Registered: ‎01-08-2014

Re: lwIP netif: 'unable to alloc pbuf in recv_handler' message

@x_irie

 

Hi x_irie,

Have you solve the problem ?

I have the same issue with you. Except I use xilkernel under lwip1.4.1.

 

Thank you very much!

Six

0 Kudos
Adventurer
Adventurer
5,501 Views
Registered: ‎09-19-2016

Re: lwIP netif: 'unable to alloc pbuf in recv_handler' message

Unfortunately, I don't remember what I done with this one... But, I assume that was some problem with lack of memory. Try to increase parameters such as MEM_SIZE, MEMP_NUM_PBUF, PBUF_POOL_SIZE.

0 Kudos