LPC1765 moving FreeRTOS heap to RamAHB32.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC1765 moving FreeRTOS heap to RamAHB32.

467 Views
lpcware
NXP Employee
NXP Employee
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?
0 Kudos
2 Replies

332 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Bill@medsignals.com on Wed May 07 10:42:58 MST 2014
I don't have any information on the starting point of FreeRTOS, I did not start this project and do not know what they used.  The heap model is heap_2.

I have found out that I2S is using DMA.  I found a pointer declared as:
#define AUDIO_BUFF_ADR (AudioLinkListBuffer*)0x2007e000

I have tried to change this to use the __DATA(RAM2) macro but whenever I do this some of my static arrays go uninitialised in RAM1, then if I try to write to RAM1 manually using strcpy or memcpy I receive a hard fault.

When using the DMA ram what steps need to be taken so that it can be used for both DMA and general purpose?
0 Kudos

332 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Tue May 06 06:57:18 MST 2014
What are you using as the starting point of your FreeRTOS project? For example, are you using the FreeRTOS example that ships in LPCOpen bundles for LPC17xx?

And which of the FreeRTOS heap models are you using? See the FreeRTOS documentation for more details on the choices here.

And for reference - information on debugging hard faults can be found at:

http://www.lpcware.com/content/faq/lpcxpresso/debugging-hard-fault

Regards,
LPCXpresso Support
0 Kudos