Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training




Loading

TCP server infinite blocking

Posted by iamtherealeimer on July 14, 2016

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

Posted by rtel on July 14, 2016

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

Posted by iamtherealeimer on July 14, 2016

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

Posted by sbrauss on July 14, 2016

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

Posted by iamtherealeimer on July 15, 2016

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

Posted by sbrauss on July 15, 2016

Good Morning Unknown

The constants in the stack and in the demo are mainTCPSERVERTASKPRIORITY and ipconfigIPTASK_PRIORITY

Best regards, Stephan


TCP server infinite blocking

Posted by iamtherealeimer on July 15, 2016

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

Posted by rtel on July 15, 2016

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

Posted by sbrauss on July 15, 2016

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

Posted by iamtherealeimer on July 15, 2016

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

Attachments

CondencedVersion.zip (369177 bytes)


[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]




Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists