Problem allocation on LPC1788 with FreeRTOS+TCP


I was using the FreeRTOS+TCP using heap_5 on an external RAM, and was working well.
But now in other project i need to use without external RAM. The LPC1788 has two blocks of memory, one with 64KB, and other 32KB for peripherals (USB, Ethernet, LCD, etc). When i work using heap on RAM_32, this works, but don’t have space enough, because i need to allocate space for USB and Ethernet, but when i try use heap for freertos on RAM_64 doesn’t work.

Why on external RAM and RAM_32 works, and RAM_64 doesn’t work?
What i do to solve this problem?

Hello @ulysses,

Thanks for reaching out, can you please share some details about you hardware / board and what error messages are you seeing ?


Do you need to enable RAM_64 first?
Do you have to place the vector table in RAM_32 even if everything else is in RAM_64?

Hi @abhidixi ,

This hardware use a board from Embedded Artists, and our base board. The error that occours is don’t resolve the DHCP, don’t connect to local network on my router.

Hi @rtel,

I think doesn’t matter, because i try use RAM_32 and allocate the freertos on RAM_64, but don’t work. The only problem on RAM_32 i have is the space, because i need majority for USB and Ethernet.


i found what occours, in this line lPacketCount = ( BaseType_t ) listCURRENT_LIST_LENGTH( &( pxSocket->u.xUDP.xWaitingPacketsList ) ); on function FreeRTOS_recvfrom not return never a valid value for lPacketCount.

Can you step into the function to see why that is? Also, is this the first time the failing function is called, or does it pass a few times first?

Into this function the pxList->uxNumberOfItems return the value 0, i don’t understand why.

When don’t work, stay in a infinit loop, calling this function. But when works, using external ram or RAM_32, the first time with pass in this part with error, but the next pass with success.

Could it be variables stored in the larger RAM are not being initialised correctly in the C startup code? I think this issue is to do with the linker or chip configuration rather than FreeRTOS itself.


I don’t find anything to solve this problem about RAM. So i share my code with you for try solve this.


I think the problem is related with send, because i open the wireshark to analyze, and on external RAM and RAM_32 the board sends the package DHCP, and on RAM_64 didn’t.

@ulysses : I’m afraid I don’t know much of your MCU.
Are you sure what RAM areas are implemented?
Have you tested the different RAM areas?
Are there areas that can not be used for DMA?

Hi @htibosch,

Are you sure what RAM areas are implemented?
Have you tested the different RAM areas?

Yes, all this RAM areas i use now in other projects.

Are there areas that can not be used for DMA?

The RAM_64 and RAM_32 are internal of microcontroller, and SDRAM is an external RAM that uses DMA.