This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

about tm4c freertos + lwip, use socket API problem

hi, i am a user of tm4c1294, about the examples of freertos_demo.

it used a combination of freertos + lwip + raw api, i have modify it to use the BSD socket. but i have met a problem.

in my application, i created several task, one is establish socket connection, receive ethernet data and send them to comm port; the other task is to send data to  remote server using same socket fd.

now the problem comes, after a long time continuous running, the system hangs, it may respond to ping, or just dead. 

i have checked about the interrupt priority setting ok, so where is the cause?

  • Hello Rubin

    Did you check if the stack has not overflowed?

    Regards
    Amit
  • i checked the freertos's stack it didn't overflow.
    first, by enable configCHECK_FOR_STACK_OVERFLOW = 2, it will enable a overflow hook function, but in debug, the program didn't gointo it; and by using INCLUDE_uxTaskGetStackHighWaterMark = 1, i check the stack depth value each time data received, no abnormal too.
    but there is an interesting thing, when i limit each socket in their own task(the same socket won't be handled in more than 1 task), the problem seems disappeared. in other words, each socket only run in their created task.
  • according to my test, it seems that if the each socket only runs in the task who created them, the system will works fine, this seem that there is a problem in the internal configuration opt of lwip or freertos's mbox.