Quality RTOS & Embedded Software

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


FreeRTOS LWIP LPC1769 LPCXpresso

Posted by calagan on November 20, 2012
Hi all,

My design is based on FreeRTOS+IO and FreeRTOS+CLI demo 2 functionality provided by FreeRtos.
I used it to make a socket server application (TCP server), the function is good but I want to investigate about the speed.

I monitor my "conection" with WireShark, and send data from the PC to by board. I've got a custom application which send me data (around 88 Bytes in 5 packets).

And I found that the speed is slow 2Mbits/sec.
I use the socket api.

And I would like to know how to increase this speed I know that I can expect 100Mbits/sec ( also I use a TCP server) but I'm expected around 40Mbits/sec.

Thanks for help.

RE: FreeRTOS LWIP LPC1769 LPCXpresso

Posted by Richard on November 20, 2012
Note an update to the FreeRTOS+IO code has just been released. You can download it from the existing FreeRTOS+IO featured demo web page.

The sockets interface is going to be the slowest of the three available lwIP APIs. I know there has been some discussion on the lwIP mailing list about the sockets performance, I would recommend looking in their archive.


RE: FreeRTOS LWIP LPC1769 LPCXpresso

Posted by calagan on November 26, 2012
Ok thanks for the reply.
Maybe someone can show me how to use the netconn api, I want to make a simple tcp server.

I tried this piece of code

struct netconn *conn, *newconn;
err_t err;

/* create a connection structure */
conn = netconn_new(NETCONN_TCP);

/* bind the connection to port 2000 on any local IP address */
netconn_bind(conn, NULL, 7);

printf("Now listening\n");
/* tell the connection to listen for incoming connection requests */

/* Grab new connection. */
err = netconn_accept(conn, &newconn);
printf("accepted new connection %p\n", newconn);

/* Process the new connection. */
if (err == ERR_OK)
struct netbuf *buf;
void *data;
u16_t len;

while ((err = netconn_recv(newconn, &buf)) == ERR_OK)
printf("Received data\n");
netbuf_data(buf, &data, &len);
err = netconn_write(newconn, data, len, NETCONN_COPY);
if (err != ERR_OK)
printf("tcpecho: netconn_write: error \"%s\"\n", lwip_strerr(err));
}while (netbuf_next(buf) >= 0);

/* Close connection and discard connection identifier. */

There is something I don't understand (sorry but I'am not familiar with tcp/ip stack) to initialize the emac driver and the lwip stack, on the example (from freeRtos) we could see :

tcpip_init( lwIPAppsInit, NULL );

Why I can't write

tcpip_init( NULL, NULL );

For now this doesn't work, the server start receiving data then nothing and the data rate goes near 0bps.

[ 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.


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


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