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

FreeRTOS+TCP sockets will not connect to localhost, does connect to remote hosts.

Posted by emesbee on October 27, 2016

I am using the FreeRTOS+TCP IP stack on my STM32F429 based board. I have both a HTTP and Telnet server (which feeds FreeRTOS+CLI) running, and am able to access both of them from a PC via ethernet. I also have a client task running, that properly opens a socket to a listening server on my PC.

What I cannot seem to get working is having the client task connect to either of the servers running on the same device. I have tried using both 127.0.0.1 and the device's own IP (10.200.100.10 in this case). FreeRTOSconnect() returns -pdFREERTOSERRNO_ETIMEDOUT in both cases.

For the networkIF driver, I am using the STM32Fxx/NetworkInterface.c driver supplied with FreeRTOS+TCP.

Am I missing something simple here?


FreeRTOS+TCP sockets will not connect to localhost, does connect to remote hosts.

Posted by edwards3 on October 27, 2016

Is there a loopback interface?


FreeRTOS+TCP sockets will not connect to localhost, does connect to remote hosts.

Posted by emesbee on October 28, 2016

I guess not. Forgive my ignorance, but would that require a separate network interface? I had assumed loopback was handled in the stack.

This same project was working this far with LWIP, in which I believe I didn't have a separate interface driver for loopback. However the lack of thread saftey in LWIP made for problems further down the line.


FreeRTOS+TCP sockets will not connect to localhost, does connect to remote hosts.

Posted by rtel on October 28, 2016

The easiest way to do this would be to update the driver to return packets going to its own IP address back to itself.

For example, in the driver there is a send function that writes data onto the wire, and a receive function that posts received packets on a queue for processing the by the IP task. You can update the send driver to check the destination - if the destination is not itself the packet can be written onto the wire like normal, if the destination is itself the packet can be sent on the queue to be processed by the IP task just as if it had been received from the network.


FreeRTOS+TCP sockets will not connect to localhost, does connect to remote hosts.

Posted by heinbali01 on October 28, 2016

There is no loopback interface yet in the FreeRTOS+TCP IP stack.

Formally it is a different interface with its own netmask and routing rules.

Yes it should be added.

There is a new version of FreeRTOS+TCP available for testing: it allows to use multiple interfaces and it recognises IPv6. We will add the loopback interface to it (has not been done yet).


FreeRTOS+TCP sockets will not connect to localhost, does connect to remote hosts.

Posted by emesbee on March 29, 2017

I'm just returning to this issue now again. How do I access the versions of FreeRTOS+TCP which are available for testing?


FreeRTOS+TCP sockets will not connect to localhost, does connect to remote hosts.

Posted by heinbali01 on March 29, 2017

Would you mind to drop an email to h dot tibosch [at] freertos dot org ? The thing is, we don't just publish software that hasn't been fully been tested. Also, the documentation is not yet complete. Regards, Hein


[ 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