Quality RTOS & Embedded Software

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


FreeRtos+UDP and FreeRtos+TCP with LPC1769

Posted by hardware-dev on November 17, 2016


We have tested the example code FreeRTOSPlusUDPandCLILPC1830GCC. It seems to work well. Now we would like to port this example to our microcontroller LPC1769.

In the zip-package from FreeRtos there is a folder with drivers for LPC1769: FreeRTOSv9.0.0FreeRTOS-PlusSourceFreeRTOS-Plus-UDPportableNetworkInterfaceLPC17xx

So I took the file "NetworkInterface.c" from this folder and put it into my project in place of original file for LPC1830.

I also added the driver files for emac: * lpc17xxemac.c * lpc17xxemac.h * and all other files which were needed.

Now the compiler can't find the following functions: * EMACNextPacketToRead(); * EMACSetNextPacketToSend(); * EMAC_StartTransmitNextBuffer();

I can find that functions in the driver for LPC1830 but they don't work with LPC1769.

The questions are as follows: * Is this driver "NetworkInterface.c" for 1769 incomplete? * What do I have to do to get it work?

Our target is to use the FreeRtos+TCP (we need webserver and UDP), but there is no example code for our LPC microcontrollers. That is why we would like to port the example FreeRTOSPlusUDPandCLILPC1830GCC. If it works correctly, then we will try to port the FreeRtos+TCP.

FreeRtos+UDP and FreeRtos+TCP with LPC1769

Posted by paw3l on November 17, 2016

Are you aware that you will need also Fat to get this system to work? Or modify the filesystem API to do some raw access to flash etc. Unless you have plenty of space on externel memory.

FreeRtos+UDP and FreeRtos+TCP with LPC1769

Posted by hardware-dev on November 17, 2016

Why do I need FAT? I thought it should also work without it. We have a sd-card and external Flash memory on our board, if it is needed.

FreeRtos+UDP and FreeRtos+TCP with LPC1769

Posted by rtel on November 17, 2016

In the LPC18xx example EMACNextPacketToRead() is implemented in the lpc18xxemac.c souce file - which is a driver file provided by NXP, and it seems the LPC17xx version of NetworkInterface.c expects the equivalent LPC17xx driver from NXP to provide the same function. It sounds like the version of lpc17xxemac.c that you are using (is that from NXP too?) is different to the one used when the networkinterface.c file for that chip was written. Look in your lpc17xxemac c and h source files to see what it calls the functions that you are missing - I'm sure they will be there but it sounds like they are named differently.

FreeRtos+UDP and FreeRtos+TCP with LPC1769

Posted by hardware-dev on November 18, 2016

Thank you very much for your answer. Yes, the file lpc17xx_emac.c is from NXP. The name of the library is: LPC175x_6x CMSIS-Compliant Standard Peripheral Firmware Driver Library

I also thought that the functions should be there but with other names.

There are following functions lpc18xx_emac.c:

BaseTypet EMACInit(EMACCFGType *EMACConfigStruct); int32t EMACUpdatePHYStatus(void); **uint32t EMACGetReceiveDataSize(void); void EMACStartTransmitNextBuffer( uint32t ulLength ); void EMACSetNextPacketToSend( uint8t * pucBuffer );** void EMACNextPacketToRead( xNetworkBufferDescriptort *pxNetworkBuffer ); void EMACUpdateRxConsumeIndex(void); BaseTypet EMACCheckReceiveIndex(void); BaseTypet EMACCheckTransmitIndex(void);

Whereas in lpc17xx_emac.c I can find:

Status EMACInit(EMACCFGType *EMACConfigStruct); void EMACDeInit(void); int32t EMACCheckPHYStatus(uint32t ulPHYState); int32t EMACSetPHYMode(uint32t ulPHYMode); int32t EMACUpdatePHYStatus(void); void EMACSetHashFilter(uint8t dstMACaddr[], FunctionalState NewState); void EMACSetFilterMode(uint32t ulFilterMode, FunctionalState NewState); void EMACWritePacketBuffer(EMACPACKETBUFType *pDataStruct); void EMACReadPacketBuffer(EMACPACKETBUFType *pDataStruct); void EMACIntCmd(uint32t ulIntType, FunctionalState NewState); IntStatus EMACIntGetStatus(uint32t ulIntType); Bool EMACCheckReceiveIndex(void); Bool EMACCheckTransmitIndex(void); void EMACUpdateRxConsumeIndex(void); void EMACUpdateTxProduceIndex(void); FlagStatus EMACCheckReceiveDataStatus(uint32t ulRxStatType); uint32t EMACGetReceiveDataSize(void); FlagStatus EMACGetWoLStatus(uint32t ulWoLMode);

I cannot find equivalent functions. Could you suggest which functions should I use?

FreeRtos+UDP and FreeRtos+TCP with LPC1769

Posted by rtel on November 18, 2016

Well the write and read packet buffers would seem the place to start, but really, just seeing the function names means all I can do is guess, which is not going to help you. You have the source files and presumably examples of how to use them, so study what you have.

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

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

Latest News

Version 10.1.0 of the FreeRTOS kernel is available for immediate download. MIT licensed.

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

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