cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F107 LwIP TCP server stops transmitting

IOrek.1
Associate II

Hello!

I'm writing a small application based on Cube LwIP TCP echo server example little adapted to my custom board. The application is sending small periodic reports (50-150 bytes) to connected TCP client but on some iteration it stops transmitting messages. As I can see, tcp_write function is executed with no error returned but tcp_sent callback is never called. Total amount of successfully transmitted reports depends only on total size of this reports. Message reception from the client works normally.

Using non-modified echoserver source code file with the echotool test program leads to the same result. On some step there is no echo response from the server depending on the transmitted string size.

Is there a problem with memory allocation? Maybe i need change settings in lwipopts?

3 REPLIES 3
IOrek.1
Associate II

The only parameter in lwipopts.h that affects the total amount of transmitted responses is TCP_MSS.

The greater is MSS the lower is count of successful responds.

Thank you for your reply! Finally have an opportunity to return to this problem...

Now my application is consistently working if the compiler was set to low optimization. As far as I understand this is the missing barriers problem from the howto topic. I modifed HAL_ETH library source file by putting __DMB() instructions in it but still can't get working application on higher optimization settings of compiler. Maybe don't fully understand where to put this instructions.