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.
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;
/* 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);
/* 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;
while ((err = netconn_recv(newconn, &buf)) == ERR_OK)
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.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.