FreeRTOS+TCP with LPC17XX

Hello, Has there been made any port yet to the LPC17XX platform? I intend to use FreeRTOS+TCP with an LPC1769 on an own hardware platform. The LPCopen code does not seem to be maintained much so it would be nice if it was possible to use FreeRTOS+TCP instead. /Mike

FreeRTOS+TCP with LPC17XX

You will find an old LPC17xx lwIP demo on the following link, but as you say, the driver standard is out of date too: http://www.freertos.org/FreeRTOS-Plus/FreeRTOSPlusIO/DemoApplications/LPCXpressoLPC1769/NXPLPC1769Demo_Description.shtml There is a driver for the LPC18xx for FreeRTOS+TCP, but it has not been used in a while, and may therefore need a little tinkering to get it to build with the latest +TCP code.

FreeRTOS+TCP with LPC17XX

Where can that driver for the LPC18xx be found?

FreeRTOS+TCP with LPC17XX

I have attached what we have – note while this was working just fine some time ago, as you can see it was never completed, and may need work to use with the latest +TCP code. I hope it will be useful, but that’s all….

FreeRTOS+TCP with LPC17XX

A small correction on what Richard wrote. He attached this file:
FreeRTOS-Plus-TCP/portable/NetworkInterface/LPC18xx/NetworkInterface.c
which is from a very recent date, recently tested on a LPC1830, and compatible with the latest release of FreeRTOS+TCP. One of the users on this forum is adapting this LPC18xx/NetworkInterface.c to use it on a LPC43xx. However, if I’m not mistaken, the EMAC of LPC18xx is not compatible with the EMAC of a LPC17xx. I will attach the LPC17xx version. This version has not been tested for a long time. We only kept the naming of the functions up-to-date, so it should compile. But I guess that you will have some work on it before it runs. You can always write if you have more questions. Attachment LPC17xx/NetworkInterface.c:
FreeRTOS-Plus-TCP/portable/NetworkInterface/LPC17xx/NetworkInterface.c

FreeRTOS+TCP with LPC17XX

Hi Mike, I pretend to use the same FreeRTOS+TCP with the LPC1769 CMSIS DAP REV. D. Did you success with making it work with the driver attached by Hein?

FreeRTOS+TCP with LPC17XX

Hello Hein, Do you have the emac driver that goes with this example of NetworkInterface.c for the LPC17XX?
The example does refer to: extern void EMACStartTransmitNextBuffer( uint32t ulLength ); extern void EMACSetNextPacketToSend( uint8t * pucBuffer ); Which are not defined by the emac driver provided by NXP. Thus, I assume you had to modify it. Have you guys evolved this further for the LPC17XX?

FreeRTOS+TCP with LPC17XX

I am trying to bring up the FreeRtos+TCP on an Embedded Arttists EALPC1788 board. Thus, my quesion above.

FreeRTOS+TCP with LPC17XX

Hi, Iam trying to implement TCP on LPC1768 and facing the same problem. Iam getting errors like: undefined reference to EMACCheckReceiveIndex. Similarly undefined reference to EMACGetReceiveDataSize,EMACNextPacketToRead,EMACUpdateRxConsumeIndex, ucMACAddress,EMAC_CheckTransmitIndex,uxRand,vLoggingPrintf and so on. LPC18xx has lpc18xx_emac.c file bt its missing for LPC17xx series. Appreciate your help Thanks

FreeRTOS+TCP with LPC17XX

I’m struggling with this too. Here is what I’ve got working using the lpc177x8xemac.c driver. ~~~ BaseTypet xNetworkInterfaceOutput( NetworkBufferDescriptort * const pxNetworkBuffer , BaseTypet xReleaseAfterSend ) { BaseTypet xReturn = pdFAIL; int32_t x;
/* Attempt to obtain access to a Tx buffer. */
for( x = 0; x < niMAX_TX_ATTEMPTS; x++ )
{
    if( EMAC_CheckTransmitIndex() == TRUE )
    {
        /* Will the data fit in the Tx buffer? */
        if( pxNetworkBuffer->xDataLength < EMAC_ETH_MAX_FLEN ) /*_RB_ The size needs to come from FreeRTOSIPConfig.h. */
        {
            /* copy the buffer to the Tx DMA descriptor. */
            EMAC_PACKETBUF_Type TXBuffer;
            TXBuffer.ulDataLen = pxNetworkBuffer->xDataLength;
            TXBuffer.pbDataBuf = (uint32_t *)pxNetworkBuffer->pucEthernetBuffer;
            EMAC_WritePacketBuffer( &TXBuffer );
            EMAC_UpdateTxProduceIndex();

            /* The EMAC now owns the buffer. */
            pxNetworkBuffer->pucEthernetBuffer = NULL;

            iptraceNETWORK_INTERFACE_TRANSMIT();

            /* The Tx has been initiated. */
            xReturn = pdPASS;
        }

        break;
    }
    else
    {
        vTaskDelay( niTX_BUFFER_FREE_WAIT );
    }
}

/* Finished with the network buffer. */
if( xReleaseAfterSend != pdFALSE )
    vReleaseNetworkBufferAndDescriptor( pxNetworkBuffer );

return xReturn;
} ~~~

FreeRTOS+TCP with LPC17XX

The problem I run into though, is that after some random time, I get an assert error in pxDuplicateNetworkBufferWithDescriptor(). It looks like sometimes pxGetNetworkBufferWithDescriptor() will return a valid buffer but the pointer inside that points to pucEthernetBuffer is NULL. Maybe I should start a new thread on this.

FreeRTOS+TCP with LPC17XX

My above code isn’t complete. check over on github for a complete posting: https://github.com/aws/amazon-freertos/issues/365