lpcware

LPC1765 moving FreeRTOS heap to RamAHB32.

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by Bill@medsignals.com on Mon May 05 11:26:11 MST 2014
I recently started getting "ramloc32 overflowed by xxbytes" messages which lead to the discovery that my project is only properly utilizing the first 32kB of ram.  I found the code red page describing the enhanced linker scripts but haven't been successful in moving data to RAM2 (RamAHB32).  I am aware that this ram block is shared with ethernet and usb on some models but the 1765 does not have ethernet and we are not using usb.

EnhancedManagedLinkerScripts

I would like to move the FreeRTOS heap to RAM2 to free up a lot of space on RamLoc32 all at once.

/* Allocate the memory for the heap.  The struct is used to force byte
alignment without using any non-portable code. */
static union xRTOS_HEAP
{
#if portBYTE_ALIGNMENT == 8
volatile portDOUBLE dDummy;
#else
volatile unsigned long ulDummy;
#endif
unsigned char ucHeap[ configTOTAL_HEAP_SIZE ];
} xHeap __BSS(RAM2);


When I try assigning the freertos heap to RAM2 using the macro from cr_section_macros.h the result is hard fault errors.

I think moving the FreeRTOS heap is the best solution but I am open to suggestions.

Lastly the code red page mentions moving the heap and stack to ramAHB32 using a linker script template.  Is this the same as the heap for FreeRTOS or is there a heap for the chip and another heap for the OS?

Outcomes