Hi wang,
I have meet same problem early. because freertos define it's heap as a normal variable. you should make some change like follow,
1. in FreeRTOSConfig.h,
#define configAPPLICATION_ALLOCATED_HEAP 1
2. in any .c file, may be in main.c
unsigned char __attribute__((section (".heap"))) ucHeap[configTOTAL_HEAP_SIZE];
3. in .ld file add a .heap define inside SECTIONS
.heap :
{
. = ALIGN(8);
__end__ = .;
PROVIDE(end = .);
__HeapBase = .;
. += HEAP_SIZE;
__HeapLimit = .;
__heap_limit = .; /* Add for _sbrk */
} > m_data_2
hope this help.
Cai.