TCP Client
Hello I'm developing a TCP client for STM32F4 MCU.
I'm using the LWIP sockets api and freeRTOS to do so.
This client will both send and receive data when triggered by RTC (every hour or so) and based on an ADC reading.
My understanding is both sockets and netconn api's are based on state machine so they need to run in a different thread than MX_LWIP_Init() so after this function is called I am creating a thread that communicates to my server application.
I initialise the thread with xTaskCreate(TcpThread, "TCP", 128 * 4, NULL, osPriorityNormal, &tcp_thread_id);
In this thread I am creating, connecting writing and closing the socket and checking for errors for each with UART as one should do.
After this I delete the thread with vTaskDelete(NULL).
I then create the thread again 5s afterwards by calling osDelay(5000).
The application seems to run fine but crashes anywhere from 24 to 1100 connections without showing errors over UART.
Is there something wrong with my implementation?
I've attached main and client source files to this post.
If anyone has tips on how to solve this I would very much appreciate them for it.
Thank you,
Marc
