cancel
Showing results for 
Search instead for 
Did you mean: 

LwIP TCP server send periodic data

loribru
Associate II

Hi all, I am developing a TCP server starting from the STM32F4 TCP server echo sample.

My goal is to keep the echo functionality and send in addition a periodic message.
I modified slightly the original file and I managed to have the echo working and the method tcp_echoserver_periodic_notification called every second, but that message does not get to my client.
I am probably doing something wrong but I do not understand what since it's my first time with LwIP and I must say it's not very straightforward.
Can you please help me, what am I doing wrong?
Also, I see other examples using the methods pbuf_take and pbuf_alloc, but the ST example does not use them, what is best to do here?
Thanks.

12 REPLIES 12

Hello @loribru 

I think that increasing the DEFAULT_THREAD_STACKSIZE from 512 to 1024 is what solved the issue maybe if you still have an instance of the other project you can try the modification described one by one to know for sure which was the root cause of the issue .

know for the hanging up behavior of FreeRTOS maybe try increasing the STACKSIZE to 2048 to see if the issue is still visible. 

BR

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Hello @STea , do you mean increasing again DEFAULT_THREAD_STACKSIZE  or a more general FreeRTOS define?
Also, my MCU heap and stack size are the default ones, I am not sure what roles they play when running FreeRTOS.

Hello @loribru 

If your threads are hanging up randomly, it could be a sign that they are running out of stack space or heap memory. You can try increasing the stack size of your threads (DEFAULT_THREAD_STACKSIZE) and the heap size (MCU heap) of your project to see if it resolves the issue.

BR

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.