TCP server infinite blocking

Hi, I am currently trying to implement the TCP server example from the labs demo onto my stm32f429_eval board. So far I am able to compile the project with armcc (Keil). I just encounter a problem, my prvConnectionListeningTask, respectively the FreeRTOS_accept never unblocks or should I say, it waits forever for the event. I tried the echotool to trigger the event, but the it returns “Can not connect to server”. I have the same problem when I try to ping the device. A hint where the unblocking event is generated would be highly appreciated. Or any other ideas that direct me in the right direction. I gladly provide more details if need be. Thanks.

TCP server infinite blocking

First question – as we don’t have one in the download ourselves – have you implemented the packstructstart.h and packstructend.h header files for the Keil environment? This is very important and, if wrong, could result in some protocols appearing to work (like the ICMP pings) while others do not.

TCP server infinite blocking

Hi Richard, yes, I did implement my own. _start.h ~~~ __packed ~~~ _end.h: ~~~ ; ~~~ see http://www.keil.com/support/man/docs/armcc/armccchr1359124980173.htm and http://www.keil.com/support/man/docs/armcc/armccchr1359124230944.htm I am sorry, I messed up the ping. I obviously pinged another device in the network.

TCP server infinite blocking

Hi! I maybe faced the same bug, it took me a long time to find… The priority of the task running your TCP server must be lower than the priority of the Ethernet task. Best regards, Stephan

TCP server infinite blocking

Good morning Stephan, Thank you for your hint, by ethernet task you mean the prvIPTask called from FreeRTOS_IPInit? Best regards,

TCP server infinite blocking

Good Morning Unknown The constants in the stack and in the demo are mainTCPSERVERTASKPRIORITY and ipconfigIPTASK_PRIORITY Best regards, Stephan

TCP server infinite blocking

Hi Stephan, Am I right that I am missing the TCP server task, because I only want to use the echo server ? So I think I need to modify the mainECHOSERVERTASK_PRIORITY. Even by using the defaults provided by the demo I am stuck in the prvConnectionListeningTask and the Echo server task is never created. My priorities are: /#define mainECHOSERVERTASKPRIORITY ( tskIDLEPRIORITY + 2 ) = 2 /#define tskIDLEPRIORITY ( ( UBaseTypet ) 0U ) /#define ipconfigIPTASKPRIORITY ( configMAXPRIORITIES – 2 ) = 5 /#define configMAXPRIORITIES (7) Best regards, Fabian

TCP server infinite blocking

You are right, the “server work task” is not needed for the echo server example, only examples that have state such as the FTP, HTTP and Telnet servers. So I can get it clear in my mind some questions:
I am currently trying to implement the TCP server example from the labs demo onto my stm32f429_eval board.
Did you start with the code from this demo? http://www.freertos.org/FreeRTOS-Plus/FreeRTOSPlusTCP/TCP-IPFATExamplesSTSTM32F407.html
So far I am able to compile the project with armcc (Keil).
So it is clear you ported the demo to Keil. Did you make any other changes? For example, take tasks out, or add new tasks, or change any FreeRTOSConfig/FreeRTOSIPConfig.h settings? If you built the original project with the [free] Atollic tools, did it work then? Maybe it would be good to get that working before porting to Keil.
my prvConnectionListeningTask, respectively the FreeRTOS_accept never unblocks
Is this function in FreeRTOS-PlusDemoCommonFreeRTOSPlusTCP_DemosSimpleTCPEchoServer.c

TCP server infinite blocking

Hi Fabian no, you don’t need FreeRTOSTCPserver.c for the Echo server in SimpleTCPEchoServer.c. prvConnectionListeningTask() (and better also prvServerConnectionInstance()) must run at a lower priority than ipconfigIPTASKPRIORITY. Best regards, Stephan

TCP server infinite blocking

I am not sure, I didn’t compare the sources but I used this demo: FreeRTOSLabs160112FreeRTOS-PlusDemoFreeRTOSPlusTCPandFAT_STM32F4xxx from the FreeRTOSLabs. I concensed the main to fit my needs ands also skip some initializion I am already doing in a startup task. I zipped all the modification and used files in the attachment. I believe this compiles. I will try the attolic approach and go from there. I suspect also some issues with my network configuration. But I can see a Broadcast of the device announcing its ip. Not the server ip obviously. Edit: In mz edited code I didn’t activate the ETH_IRQn so abviously I can’t get an event. Nonetheless, after enabling the interrupt the according IRQ handler calls the eth error callback because the ais flag is set. I think the NetworkInterface / DMA is not configured right. The example ist for a f409 and i am using an f429. Best Regards, Fabian