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.

DSP MMU Error Fault! MMU_IRQSTATUS = [0x1].

Other Parts Discussed in Thread: DM3730

你好,我在DM3730的CE中的codec部分修改了部分代码,其中使用了malloc()函数申请了部分内存,如:

scratchData= (unsigned char*)malloc(sizeof(unsigned char)*pixelNums);
gradX= (short*)malloc(sizeof(short)*pixelNums);
gradY= (short*)malloc(sizeof(short)*pixelNums);
gradM= (short*)malloc(sizeof(short)*pixelNums);
nonMax= (unsigned char*)malloc(sizeof(unsigned char)*pixelNums);
numItems = (int*)malloc(sizeof(numItems));
listptr= (unsigned int*)malloc(sizeof(unsigned int)*pixelNums);

总共784K内存,编译能通过,执行时报错如下:

DSP MMU Error Fault!  MMU_IRQSTATUS = [0x1]. Virtual DSP addr reference that generated the interrupt = [0xe6fffdd8].

我尝试在all_evm3530.tci中修改相应内存配置,尝试用如下命令将malloc()分配的内存定位到DDRALGHEAP(24MB)中,

prog.module("MEM").MALLOCSEG  = bios.DDRALGHEAP;

结果仍然执行失败,我想请问:

1.DSP端的codec中使用的malloc()申请的内存本来是定位到哪部分段的?为什么784K就已经报错了?

2.我该如何修改内存分配才能解决该问题,望答复,谢谢;

  • 下面内存摘抄至论坛分享:《SYS-BIOS中malloc和Memory_alloc的区别》

    • Malloc是标准C的函数,它是从system heap上分配buffer。在使用BIOS的情况下,通过BIOS.heapSize = 0x2000设定system heap的大小,在不使用BIOS的情况下要在cmd文件中用-heap设定sytem heap的大小。函数API是 void *malloc(unsigned int num_bytes);定义在stdilb.h头文件中。Malloc得到的buffer用free释放,API是void   free(void *_ptr);