Quality RTOS & Embedded Software

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


Regarding Netconn API sample example for atme

Posted by Anurag on July 5, 2012
Dear Sir

Is their any example for support Netconn API sample like echo server or webserver for Atmel microcontroller AT91SAM9XE-EK.i have done changes example as per LwIP TCP/IP stack demonstration
for STM32F2x7xx microcontrollers Application for echo using netconn API.code is compile and echo server is not running.please guide me How i can fixed this issue.

Sampple code is

Example of a TCP echoserver demo using the Netconn API
From the application point of view, the Netconn API offers a simpler way for developing
TCP/IP applications than the raw API. This is because it has a more intuitive sequential API.
The following example shows a TCP echoserver demo developed with the Netconn API. It is
an extract of the main.c file.
int main(void)
/* configure Ethernet (GPIOs, clocks, MAC, DMA) */
/* Initilaize the LwIP stack */
/* Initialize tcp echo server */
/* Start scheduler */
/* We should never get here as control is now taken by the
scheduler */
for( ;; );

void tcpecho_init(void)
sys_thread_new("tcpecho_thread", tcpecho_thread, NULL,\

static void tcpecho_thread(void *arg)
struct netconn *conn, *newconn;
err_t err;
/* Create a new connection identifier. */
conn = netconn_new(NETCONN_TCP);

if (conn!=NULL)
/* Bind connection to well known port number 7. */
err = netconn_bind(conn, NULL, 7);
if (err == ERR_OK)
/* Tell connection to go into listening mode. */
while (1)
/* Grab new connection. */
newconn = netconn_accept(conn);
/* Process the new connection. */
if (newconn)
struct netbuf *buf;
void *data;
u16_t len;
while ((buf = netconn_recv(newconn)) != NULL)
netbuf_data(buf, &data, &len);
netconn_write(newconn, data, len, NETCONN_COPY);
while (netbuf_next(buf) >= 0);
/* Close connection and discard connection identifier. */
printf(" can not bind TCP netconn");
printf("can not create TCP netconn");

RE: Regarding Netconn API sample example for atme

Posted by Richard on July 5, 2012
Sorry - I cannot provide free support for other peoples code.

Previous responses on questions regarding the Netconn API can be seen here.


[ Back to the top ]    [ About FreeRTOS ]    [ Privacy ]    [ Sitemap ]    [ ]

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

Latest News

FreeRTOS v10.2.0 is available for immediate download. MIT licensed, and including RISC-V and ARMv8-M (Cortex-M33) demos.

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

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

Cadence Tensilica Cortes

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