lwIP stops receiving packets

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
NiMc_1688136
Level 5
Level 5
10 sign-ins 50 questions asked 10 solutions authored

I am using WICED SDK 6.1 with FreeRTOS and LwIP.

I am trying to test OTA updates on my CYW43907 based module with custom code receiving the image through secured MQTT. The first ~140KB of the image is received and processed but then all network activity stops. I cannot send or receive and I cannot reach the device through ping from a computer. I think something has died in LwIP, or something in the WICED network layer has stopped pulling packets from LwIP.

I enabeled the LwIP stat print out and I think there is an issue with the PBUF_POOL_RX buffer.

MEM PBUF_POOL_RX

avail: 45

used: 45

max: 45

err: 866

The full LwIP stat output is attached.

Any ideas on how to troubleshoot this?

I enabled debug and error prints in WICED and I am not seeing any errors or anything that stands out regarding the TLS or Network modules.

0 Likes
1 Solution

After enabling the full debug output in LwIP, I was able to see that pbuff was allocated on receive and deallocated when library functions used the network but in my app, when a packet was received the buffer was never deallocated. To fix this, I added the missing wiced_packet_deletefunction call.

Seems to work so far...

View solution in original post

0 Likes
2 Replies
NiMc_1688136
Level 5
Level 5
10 sign-ins 50 questions asked 10 solutions authored

I do not have deep knowledge of LwIP but it seems that ethernet_input, under the netif folder is pretty low level. When the system stops handling network traffic, I can set a breakpoint in this function and nothing arrives.

0 Likes

After enabling the full debug output in LwIP, I was able to see that pbuff was allocated on receive and deallocated when library functions used the network but in my app, when a packet was received the buffer was never deallocated. To fix this, I added the missing wiced_packet_deletefunction call.

Seems to work so far...

0 Likes