cancel
Showing results for 
Search instead for 
Did you mean: 

LWIP PBuf Queue?

######
Senior

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.

1 ACCEPTED SOLUTION

Accepted Solutions
Johi
Senior III

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.

View solution in original post

2 REPLIES 2
LCE
Principal

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

Beware! It's many function calls...

Johi
Senior III

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.