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/+TCP/+UDP

Posted by pugglewuggle on December 18, 2014


Do the IP stacks for FreeRTOS only work on MCUs with built-in ethernet peripherals, or can it be set up to work with the UART? We use a cellular modem and it requires tunneling anything to be sent through its socket with AT commands. Please advise.


FreeRTOS lwip/+TCP/+UDP

Posted by heinbali01 on December 19, 2014


FreeRTOS+TCP can also be used with external Ethernet peripherals. But it does not know the SLIP protocol, yet. It expects raw Ethernet IP-packets as input and it will also reply with Ethernet IP-packets.


FreeRTOS lwip/+TCP/+UDP

Posted by pugglewuggle on December 20, 2014

When you say ethernet IP packets - do you mean that it requires IP packets encapsulated with the ethernet protocol or are you just saying it requires raw IP? Do you have any examples of this?

FreeRTOS lwip/+TCP/+UDP

Posted by heinbali01 on December 21, 2014

With IP packets I mean a packet that would normally be sent on a LAN.

It has these fields:

~~~~~ The Ethernet header: uint8t destinationaddr[6] uint8t sourceaddr[6] uint16t frametype;

IP- or ARP-header

UDP / TCP / ICMP ~~~~~

Your platform will need to provide two things: a send routine and it must forward received packets to the IP-task:

~~~~~ /* A function which will forward / send the message to the NIC. / portBASETYPE xNetworkInterfaceOutput( xNetworkBufferDescriptort * const pxMessage, portBASE_TYPE bReleaseAfterSend ) { / Encapsulate and send a message. */ vSendMessage( pxMessage->pucEthernetBuffer, pxMessage->xDataLength ); }

/* Forward received packets to the IP-task. */ static void vPassMessage( xNetworkBufferDescriptort *pxMessage ) { xIPStackEventt xRxEvent;

xRxEvent.eEventType = eNetworkRxEvent;
xRxEvent.pvData = ( void * ) pxMessage;

if( xSendEventStructToIPTask( &xRxEvent, 1000ul ) != pdPASS )
    /* Could not deliver the message, release it now. */
    vReleaseNetworkBufferAndDescriptor( pxMessage );


/* A tasking polling the input from the modem. */ void vEthernetTask( void pvParameter ) { for( ; ; ) { xNetworkBufferDescriptor_t *pxMessage;

    /* Wait for a new message from the NIC. */
    pxMessage = pxWaitForMessage( 1000 );
    if( pxMessage != NULL )
        vPassMessage( pxMessage );



I hope that the pseudo code above make a little clear what is expected of your NIC interface.

Regards, Hein

FreeRTOS lwip/+TCP/+UDP

Posted by heinbali01 on December 27, 2014


Just wondering, was the above answer enough to get on with it?

If not, maybe you can describe the kind of hardware setup that you are using, along with the library?


FreeRTOS lwip/+TCP/+UDP

Posted by pugglewuggle on January 5, 2015

Very interesting. I'm not quite ready to do this right now so I'll have to explore it more when it is time. Thanks for the answers!

[ 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