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


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