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.

算法移植到8127,运行多帧后死掉



算法创建成功,内存分配正确,初始化的值在函数中打印出来也是正确的

 [c6xdsp ]  GMM_Detecion pData:0x8ba03660 !!!
 [c6xdsp ]  GMM_Detecion pBFBuf:0x8bdf7e60 !!!
 [c6xdsp ]  GMM_Detecion pGmmBuf:0x8bef5060 !!!
 [c6xdsp ]  GMM_Detecion m_pGMM:0x10800140 !!!

但是在使用这些内存空间时,运行多帧后,dsp会莫名的死掉,从打印的值看分配的空间够用,没有越界,如:

    for ( j=0; j<ImageHeight; j++)
 {
  for (  k=0; k<ImageWidth; k++ )
  {
   Gray = 0;//如果Gray = temp[j*ImageWidth+k],dsp运行多帧后也会死掉

   videncObj->pParams->pData[j*ImageWidth*3+k*3+0]= Gray;
   videncObj->pParams->pData[j*ImageWidth*3+k*3+1]= Gray;
   videncObj->pParams->pData[j*ImageWidth*3+k*3+2]= Gray;
  }
 }

for( i=0; i<m_dwHeight; i++)
   {
    for( j=0; j<m_dwWidth; j++)
    {
      for( k=0; k<m_dwWindowSize; k++)
      {
       for( l=0; l<m_dwWindowSize; l++)
       {
        row = i * m_dwWindowSize + k;
        col = j * m_dwWindowSize + l;
       }
    }
  }
}

其他部分都屏蔽掉,就运行这几行也会死掉,如果把四重for循环去掉两重,则运行不会死掉,类似这样奇怪的问题。。。。求原因

  • 你好;

    在运行的时候,你有查看dsp的处理器的使用率吗?

  • 你好,

    非常感谢你的回复,请问如何查看dsp处理器的使用率了?算法是在ccs下封装为库下载到demo板上运行看打印输出的,是有调用函数可以查看使用率吗?

  • 你好;

    你可以在mcfw中查一下这个函数:MultiCh_prfLoadPrint(TRUE,TRUE);

    Int32 MultiCh_prfLoadPrint(Bool printTskLoad,Bool resetTskLoad)
    {
        UInt32 numProcs, procId;
    
        numProcs = sizeof(gMultiCh_enabledProcs)/sizeof(gMultiCh_enabledProcs[0]);
    
        for(procId=0; procId<numProcs; procId++)
        {
            SystemCommon_PrintStatus printStatus;
    
            memset(&printStatus, 0, sizeof(printStatus));
    
            printStatus.printCpuLoad = TRUE;
            printStatus.printTskLoad = printTskLoad;
            System_linkControl(
                       gMultiCh_enabledProcs[procId],
                       SYSTEM_COMMON_CMD_PRINT_STATUS,
                       &printStatus,
                       sizeof(printStatus),
                       TRUE);
            if (resetTskLoad)
            {
                System_linkControl(
                   gMultiCh_enabledProcs[procId],
                   SYSTEM_COMMON_CMD_CPU_LOAD_CALC_RESET,
                   NULL,
                   0,
                   TRUE);
            }
            OSA_waitMsecs(500); // allow for print to complete
        }
        return 0;
    }

    这里会打印出各cpu的负载