AnsweredAssumed Answered

LwIP code hang on TCP socket creation/connection

Question asked by andy b on Jul 21, 2017
Latest reply on Jul 21, 2017 by andy b

I am currently trying to communicated to a pc via a tcp socket.I am using LwIP and FreeRTOS on my discoveryF4 board.My problem is thta the code hangs on an assert when I try to use functions for socket creation/management but what is weird is that the assert on which the code is hung changes depending on where I call these functions.If I create a seperate thread for my tcp socket the code hangs when trying to execute the socket() function (which is used to create the socket)But if I try the same code but place it in a function and call that function from the defaul thread the code executes socket() with no problem but then hangs on an assert while trying to execute the connect() function.I have seen a similar problem on this forum on this post :STM32F407, LwIP, FreeRTOS socket - connect infinite loop in vPortRaiseBASEPRI .The fix that is being suggested cannot work in my case since I only have ethernet enable as peripheral.

Could it be that I'm running out of stack/heap ? Which would be surprising since im running  0x4000 of heap and 0x6000 of stack.I've tried changing the priority of my ethernet peripheral but that didn't work.

Are there any LwIP configs I should look at ? Or perhaps this is an issue with FreeRTOS ?


Any help , suggestions,tips ,opinions are apreciated.


Have a wonderful day