I have stopped the problem but I am not sure of the root cause. It does not seem to have anything to do with LWIP itself. I was using a utility feature supplied
by STM that prints debug messages to the LCD screen on the evaluation board. When I reduced the number of messages and text length, the Assert stopped occurring.
From: Patrick Klos <address@hidden>
Sent: Thursday, September 27, 2018 5:23 AM
Cc: Greenwood, Gregory A. [US-US] <address@hidden>
Subject: EXTERNAL: Re: [lwip-users] Pbuf Assert
On 9/26/2018 9:53 PM, Greenwood, Gregory A. wrote:
I cannot figure out why I am getting an Assert in pbuf.c at line 747:
LWIP_ASSERT("pbuf_free: p->ref > 0", p->ref > 0);
I know the obvious answer, in the p->ref cannot be 0.
The problem is that I cannot tell what would cause p->ref to be 0.
And this is occurring in a while loop that depends on p != NULL.
I am using the LWIP that comes from CubeMX for STM32H7.
Until someone with better information responds, let me venture a guess for you:
I think that ASSERT implies the pbuf has been dereferenced (freed) more than it has been referenced. Check that you're not freeing the pbuf more than once.
Klos Technologies, Inc.