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




Loading

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) */
ETH_BSP_Config();
/* Initilaize the LwIP stack */
LwIP_Init();
/* Initialize tcp echo server */
tcpecho_init();
...
/* Start scheduler */
vTaskStartScheduler();
/* 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,\
DEFAULT_THREAD_STACKSIZE, TCPECHO_THREAD_PRIO);
}

static void tcpecho_thread(void *arg)
{
struct netconn *conn, *newconn;
err_t err;
LWIP_UNUSED_ARG(arg);
/* 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. */
netconn_listen(conn);
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)
{
do
{
netbuf_data(buf, &data, &len);
netconn_write(newconn, data, len, NETCONN_COPY);
}
while (netbuf_next(buf) >= 0);
netbuf_delete(buf);
}
/* Close connection and discard connection identifier. */
netconn_close(newconn);
netconn_delete(newconn);
}
}
}
else
{
printf(" can not bind TCP netconn");
}
}
else
{
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.

Regards.



[ 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