FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [December 2014 Threads]
Hi,
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.
Thanks
Hi,
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.
Regards.
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?
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
Hi,
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?
Regards.
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!
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.