cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F407 LWIP TCP Server Rx Stalling

intermiami
Associate

Hello, 
I'm working on a STM32F407 LwIP acting as a TCP server with a bare winsock based client on Windows 10.
The project is derived from CubeMX V1.27.1 with the tcp_echoserver.c module creating and communicating to the client.
After a few transfer of bytes, I debug hit the  RxAllocStatus = RX_ALLOC_ERROR; located in HAL_ETH_RxAllocateCallback from ethernetif.c and the transfer receive exchange stalls. Wireshark indicates that TCP ZeroWindow packet pointing that the rx buffer is full.
Are there any solutions to this particular scenario. Pbuf Free and other mechanisms do not help.
@Tesla DeLorean or any members, please advise.

5 REPLIES 5
mslugx
Associate II

I am running into the same issue too. Seems like the line "LWIP_MEMPOOL_ALLOC(RX_POOL);" is not able geta valid pbuf., did you ever resolve your issue? 

Hi Piranha, I studied your post before. However, I am not able to pin point where the problem is. Can you tell me which one should I look at please?

Or why do you think you have just one problem? The topic reports many bugs! From where comes that wrong thinking that you can fix just one of many bugs and the device will somehow magically not be affected by all the other bugs?

Got cha. Forgive my ignorance. I just started on embedded development not too long ago. The reason is because in the main loop in Main, it calls "low_level_input" below, and the RxAllocStatus becomes RX_ALLOC_Err, and it stop going in to the If to call "HAL_ETH_ReadData". that's why it appears to be stalling. However I could be very wrong, but i don't know where else to look for the problem. Would you please point me at the right direction? Thank you Chief 🙂 

 

 

static struct pbuf * low_level_input(struct netif *netif)
{
struct pbuf *p = NULL;

if(RxAllocStatus == RX_ALLOC_OK)
{
HAL_ETH_ReadData(&heth, (void **)&p);
}

return p;
}