2024-02-14 07:34 AM - edited 2024-02-14 07:57 AM
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.
Solved! Go to Solution.
2024-02-20 04:49 AM - edited 2024-02-20 04:51 AM
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
2024-02-20 07:56 AM
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.
2024-02-20 08:06 AM
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