Skip to main content
######
Senior II
August 9, 2023
Solved

LWIP PBuf Queue?

  • August 9, 2023
  • 2 replies
  • 2407 views

Hello,

I have a STM32 sending a packet a second, up to 25 UDP packets, to another STM32 whose role is to echo these packets back to the sending STM32.

Inside the packets is a value which I increment after every transmission.

I've noticed that at the original STM I only receive message 1, after I transmitted message 4.

However, if I continue to run the program I do receive all 25 messages and actually in order.

because I transmit every second I expected to receive the echo of the first message before I sent the second. 

I am allocating small pBuf sizes, much smaller than my PBUF_POOL_BUFSIZE define, are the packets being queue'd somewhere either at receive or transmit?

Thanks.

Using RAW LWIP 2.1. and STM32F4.

This topic has been closed for replies.
Best answer by Johi

In these cases there is 1 essential tool: use Wireshark to know which STM32 is the culprit. Or your messages are not getting out or they are not processed somewhere properly.
There are also a number of system traces you can enable in MX in the LwIP configurator. If you enable these you can get a much more detailed view on what is happening.

The number of 4 makes me think it might have to do with the number of pBufs allocated, but that is a long shot.

2 replies

LCE
Principal II
August 10, 2023

I think lwIP sends any UDP packet immediately, but you better check udp.c

Beware! It's many function calls...

Johi
JohiBest answer
Senior II
August 19, 2023

In these cases there is 1 essential tool: use Wireshark to know which STM32 is the culprit. Or your messages are not getting out or they are not processed somewhere properly.
There are also a number of system traces you can enable in MX in the LwIP configurator. If you enable these you can get a much more detailed view on what is happening.

The number of 4 makes me think it might have to do with the number of pBufs allocated, but that is a long shot.