Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


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 ]    [ Privacy ]    [ Sitemap ]    [ ]


Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

Meet Richard Barry and learn about running FreeRTOS on RISC-V at FOSDEM 2019

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


Careers

FreeRTOS and other embedded software careers at AWS.



FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Renesas

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

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

OpenRTOS and SafeRTOS

Xilinx Microblaze and Zynq partner