我在cfg中定义了以下的heap:
// heap in DDR3; only to be used by core #0
var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');
var heapMemParams =new HeapMem.Params();
// heap in L2 SRAM; local to each core; can be used by all cores independnetly
heapMemParams.size = 0x40000; // 256 K
heapMemParams.sectionName = "l2Heap";
heapMemParams.align = 8;
Program.global.l2Heap = HeapMem.create(heapMemParams);
Program.sectMap["l2Heap"] = "L2SRAM";
// heap in MSMC SRAM;
heapMemParams.size = 0x200000;
heapMemParams.align = 8;
heapMemParams.sectionName = "msmcHeap";
Program.global.msmcHeap = HeapMem.create(heapMemParams);
Program.sectMap["msmcHeap"] = "MSMCSRAM";
然后调用下面的子函数:
voidfreeSpace()
{
//free up the memory used for range compression
Memory_free((IHeap_Handle) msmcHeap, wforFFT, config_loc->RFFT*4*sizeof(float));
Memory_free((IHeap_Handle) msmcHeap, ref_RC, config_loc->RFFT*2*sizeof(float));
Memory_free((IHeap_Handle) msmcHeap, wforIFFT, config_loc->RFFT*4*sizeof(float));
//free up the memory used for azimuth compression
Memory_free((IHeap_Handle) msmcHeap, ref_AC, config_loc->AFFT*2*sizeof(float));
Memory_free((IHeap_Handle) msmcHeap, wforFFT_AC, config_loc->AFFT*4*sizeof(float));
Memory_free((IHeap_Handle) msmcHeap, wforIFFT_AC, config_loc->AFFT*4*sizeof(float));
//free up memory on DDR3
Memory_free((IHeap_Handle) dataHeap, bufDDR3, (config_loc->rbins_c+config_loc->N_bound*2)*config_loc->abins*2*sizeof(float));
Memory_free((IHeap_Handle) dataHeap, bufDDR2, config_loc->rbins_c*config_loc->abins*2*sizeof(float));
}
系统提示错误为:
ERROR : identifier “msmcHeap” is undefined。
可是cfg里面明显是定义了的啊,不知道哪个地方出问题了,求支招!!!
Liu Chunjing:
还木有解决,郁闷中!!!
Shine:
回复 Liu Chunjing:
请问调用Memory_free释放内存前有先用Memory_alloc申请内存吗?
Liu Chunjing:
回复 Shine:
申请分配内存了,想办法避开这个问题了,但确实没有解决掉,只能暂时这样了