2024-03-08 05:13 AM
I’ve created an STM32 project using STM32CubeIDE and enabled LWIP and FreeRTOS. My purpose is to run a basic TCP Server program on the STM3240G-Eval board using BSD sockets, containing two threads. I need to use most of the BSD socket calls such as lwip_socket(..), as mentioned in the sockets.h file.
I’ve created a basic tcp server program and run it as the default task in FreeRTOS. The APIs lwip_socket(..), lwip_bind(..) and lwip_listen(..) have passed. The program got blocked in lwip_accept(..). When debugged, the execution sequence is found to be as follows:
lwip_accept(..) --> netconn_accept(..) --> sys_arch_mbox_fetch(..) --> OS function calls. No error seen, but the program blocked at this point.
Could you please help resolving this issue? Am I missing setting any configuration parameter in opt.h?
2024-06-05 08:53 AM
Hello @VSomasekhar ,
Thank you for your report. I would like to clarify that lwip_accept is used to accept a new connection on a TCP socket that is set to listen mode. By default, lwip_accept functions in blocking mode, which means that the program's execution is halted until an incoming connection is detected.
With Regards,