最近写算法,用Memory_alloc() 函数分配连续的720*576*4 字节的内存都不行,只能分配720*576*3 字节的连续内存空间,但6467 DDR2的容量是256M,想请教一下高手256M DDR2 内存都用在哪了,要怎样才能使得算法中可分配的内存更大一些,不胜感激。
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
你好,
请问你是在哪里申请连续的内存?ARM侧?如果是,TI软件默认是划分了一块连续的内存给CMEM,建议利用cmem来获取连续空间。
关于cmem的介绍,请参考:http://processors.wiki.ti.com/index.php/CMEM_Overview。
你好,
如果是通过CCS在DSP上使用malloc,应该是在heap段来获取buffer的,你要看看你的heap开的是否足够大。
malloc和memery_malloc的区别,请参考文档:1 关于malloc和Memory_alloc的区别.
你好,
我是使用的CE,我的DSP端DDR2分配如下:
var mem_ext = [
{
comment: "DDRALGHEAP: off-chip memory for dynamic algmem allocation",
name: "DDRALGHEAP",
base: 0x88000000, // 128MB
len: 0x07A00000, // 122MB
space: "code/data"
},
{
comment: "DDR2: off-chip memory for application code and data",
name: "DDR2",
base: 0x8FA00000, // 250MB
len: 0x00400000, // 4MB
space: "code/data"
},
{
comment: "DSPLINK: off-chip memory reserved for DSPLINK code and data",
name: "DSPLINKMEM",
base: 0x8FE00000, // 254MB
len: 0x00100000, // 1MB
space: "code/data"
},
{
comment: "RESET_VECTOR: off-chip memory for the reset vector table",
name: "RESET_VECTOR",
base: 0x8FF00000, // 255MB
len: 0x00000080, // 128 B
space: "code/data"
}
];
问题好像出在Memory_alloc()函数分配的内存在“DDR2"段,而不是在"DDRALGHEAP"段。
不知如何修改可使Memory_alloc()函数分配的内存处于"DDRALGHEAP"段。
1 关于malloc和Memory_alloc的区别.这个链接好像打不开
你好,
我认为和你使用的cfg/tcf文件的配置有关。CE例子里面的local.tcf有如下内容:
/* set all BIOS data and code sections to be in DDR2 */
bios.setMemDataHeapSections(prog, bios.DDR2);
bios.setMemDataNoHeapSections(prog, bios.DDR2);
bios.setMemCodeSections(prog, bios.DDR2);
下面论坛讨论你也可以看看:
https://e2e.ti.com/support/embedded/tirtos/f/355/p/66841/241910