how to prevent the Lwip stack from shutting down after few transmissions in STM32?
I am currently writing a code to send joystick data from a PC to an STM32 Nucleo board. I use pygame to read joystick values and use the socket library of python to send data to MCU via a router. Both MCU and PC is connected to the router. On the MCU side, I use a modified example code of LWIP given in STM32 Cube pkg. The MCU also runs a FreeRTOS scheduler on which LWIP is running. I was able to get it run flawlessly in a 2 threaded FreeRTOS code. However, when I shift the code to a 16 threaded code[main project], LWIP stops working after a few exchanges. In a sense, I don't receive any ping after 4-5 exchanges.
Some things that were experimented with to resolve the issue
- reduced the publishing frequency from the PC side to 20hz. This increases the exchange duration but fails after few minutes.
- Tried reducing the ConfigMaxPriority parameter of FreeRTOS config from 56(cube ide default) to 16.[Operating time increased]
- tried changing FreeRTOS main heap memory and LWIP thread stack memory [no difference]
I think, its a memory issue. But not sure how to resolve. can anyone advice me on this ?
