# FreeRtos+UDP and FreeRtos+TCP with LPC1769

**URL:** <https://forums.freertos.org/t/freertos-udp-and-freertos-tcp-with-lpc1769/6278>\
**Category:** Kernel\
**Created:** [November 17, 2016, 1:16pm UTC](https://forums.freertos.org/t/freertos-udp-and-freertos-tcp-with-lpc1769/6278 "2016-11-17T13:16:22Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [November 17, 2016, 1:16pm UTC](https://forums.freertos.org/t/freertos-udp-and-freertos-tcp-with-lpc1769/6278/1 "2016-11-17T13:16:22Z")

</div>

**[hardware-dev](https://sourceforge.net/u/hardware-dev/)** wrote on [Thursday, November 17, 2016](https://sourceforge.net/p/freertos/discussion/382005/thread/61899549/#3ec9):

Hello,

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.0\FreeRTOS-Plus\Source\FreeRTOS-Plus-UDP\portable\NetworkInterface\LPC17xx

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:**

- lpc17xx\_emac.c
- lpc17xx\_emac.h
- and all other files which were needed.

**Now the compiler can’t find the following functions:**

- EMAC\_NextPacketToRead();
- EMAC\_SetNextPacketToSend();
- 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.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [November 17, 2016, 1:29pm UTC](https://forums.freertos.org/t/freertos-udp-and-freertos-tcp-with-lpc1769/6278/2 "2016-11-17T13:29:35Z")

</div>

**[paw3l](https://sourceforge.net/u/paw3l/)** wrote on [Thursday, November 17, 2016](https://sourceforge.net/p/freertos/discussion/382005/thread/61899549/#3ec9/9be3):

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.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [November 17, 2016, 1:41pm UTC](https://forums.freertos.org/t/freertos-udp-and-freertos-tcp-with-lpc1769/6278/3 "2016-11-17T13:41:51Z")

</div>

**[hardware-dev](https://sourceforge.net/u/hardware-dev/)** wrote on [Thursday, November 17, 2016](https://sourceforge.net/p/freertos/discussion/382005/thread/61899549/#3ec9/9be3/f7f8):

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.

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [November 17, 2016, 3:06pm UTC](https://forums.freertos.org/t/freertos-udp-and-freertos-tcp-with-lpc1769/6278/4 "2016-11-17T15:06:34Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Thursday, November 17, 2016](https://sourceforge.net/p/freertos/discussion/382005/thread/61899549/#3ec9/48a5):

In the LPC18xx example EMAC\_NextPacketToRead() is implemented in the  
lpc18xx\_emac.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 lpc17xx\_emac.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 lpc17xx\_emac 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.

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [November 18, 2016, 9:33am UTC](https://forums.freertos.org/t/freertos-udp-and-freertos-tcp-with-lpc1769/6278/5 "2016-11-18T09:33:29Z")

</div>

**[hardware-dev](https://sourceforge.net/u/hardware-dev/)** wrote on [Friday, November 18, 2016](https://sourceforge.net/p/freertos/discussion/382005/thread/61899549/#3ec9/48a5/a730):

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** :

BaseType\_t EMAC\_Init(EMAC\_CFG\_Type \*EMAC\_ConfigStruct);  
int32\_t EMAC\_UpdatePHYStatus(void);  
**uint32\_t EMAC\_GetReceiveDataSize(void);  
void EMAC\_StartTransmitNextBuffer( uint32\_t ulLength );  
void EMAC\_SetNextPacketToSend( uint8\_t \* pucBuffer );**  
void EMAC\_NextPacketToRead( xNetworkBufferDescriptor\_t \*pxNetworkBuffer );  
void EMAC\_UpdateRxConsumeIndex(void);  
BaseType\_t EMAC\_CheckReceiveIndex(void);  
BaseType\_t EMAC\_CheckTransmitIndex(void);

Whereas in **lpc17xx\_emac.c** I can find:

Status EMAC\_Init(EMAC\_CFG\_Type \*EMAC\_ConfigStruct);  
void EMAC\_DeInit(void);  
int32\_t EMAC\_CheckPHYStatus(uint32\_t ulPHYState);  
int32\_t EMAC\_SetPHYMode(uint32\_t ulPHYMode);  
int32\_t EMAC\_UpdatePHYStatus(void);  
void EMAC\_SetHashFilter(uint8\_t dstMAC\_addr[], FunctionalState NewState);  
void EMAC\_SetFilterMode(uint32\_t ulFilterMode, FunctionalState NewState);  
void EMAC\_WritePacketBuffer(EMAC\_PACKETBUF\_Type \*pDataStruct);  
void EMAC\_ReadPacketBuffer(EMAC\_PACKETBUF\_Type \*pDataStruct);  
void EMAC\_IntCmd(uint32\_t ulIntType, FunctionalState NewState);  
IntStatus EMAC\_IntGetStatus(uint32\_t ulIntType);  
Bool EMAC\_CheckReceiveIndex(void);  
Bool EMAC\_CheckTransmitIndex(void);  
void EMAC\_UpdateRxConsumeIndex(void);  
void EMAC\_UpdateTxProduceIndex(void);  
FlagStatus EMAC\_CheckReceiveDataStatus(uint32\_t ulRxStatType);  
uint32\_t EMAC\_GetReceiveDataSize(void);  
FlagStatus EMAC\_GetWoLStatus(uint32\_t ulWoLMode);

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

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [November 18, 2016, 3:04pm UTC](https://forums.freertos.org/t/freertos-udp-and-freertos-tcp-with-lpc1769/6278/6 "2016-11-18T15:04:32Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Friday, November 18, 2016](https://sourceforge.net/p/freertos/discussion/382005/thread/61899549/#3ec9/48a5/a730/184f):

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.
