cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F7 + FreeRTOS + LWIP tasks disappearing

Krasnoloodek
Associate

Hello,

I ask for support as I do not have much experience with RTOS + LWIP implementation on STM boards.

Problem: After processing TCP message, other RTOS tasks are getting killed.

Program:

I have made a simple program to test TCP server functionality with LWIP and FreeRTOS. For now I am trying to process incoming TCP message with a server socket on STM. I am using netconn API with LWIP, the processing is done in TCP_Server_Task. Besides that I have created two generic taks blinking the user LEDs to get the idea of the RTOS working (TEST_Task and TEST1_Task).

Board: STM32F7676ZI

Observed behaviour:

  1. System power on
  2. Both user LEDs blinking, TEST_Task and TEST1_Task running, TCP server socket listening on port 5555. (state shown in Screenshot1 attached)
  3. send a message "A" to the TCP server port 5555 from PC based client (connection directly via ETH crossover cable)
  4. Message gets processed (state shown in Screenshot2 attached)
  5. After message being processed all the tasks including the TEST_Task and TEST1_Task are gone/killed, LEDs stop blinking. (state shown in Screenshot3 and Screenshot4 attached)

Debugging results:

What I have found out is that the tasks are killed after executing netconn_write function in process_connection function. netconn_write, however, returns ERR_OK.

main.c attached.

3 REPLIES 3
alister
Lead

tcpip_thread stack overflow?

Suggest step the code.

Thanks for the reply, I am trying to step debug but did not find any root cause.

I think worth mentioning is that it happens with the first try of the TCP communication.

I have tried to increase the TCP stack size to 2048 but it did not help.

Try Googling "freertos task disappear" for discussions.