HI, 最近在调试6678 的QMSS,出现以下的问题:如果直接导入D:\ti\pdk_C6678_1_0_0_17\packages\ti\drv\exampleProjects\qmInfraExampleProject下的工程,运行正常。但是如果我自己新建一个C66x的工程,将所有源文件拷入该工程,结果运行到result = Qmss_insertMemoryRegion (&hostMemInfo)语句时,总是出现如下错误:Error Core 0 : Inserting memory region 0 error code : -131。经过查询相关文件得知:-131的意思是QMSS LLD queue open error。请问为什么会出现这种错误,谢谢!
Jane Lu:
Hi wayne,
从现象上看,是申请硬件队列失败,相关驱动函数为Qmss_internalQueueOpen(), 建议对照这个函数的源码查一下对应的队列变量设置是否合理:
static Qmss_QueueHnd Qmss_internalQueueOpen (Qmss_QueueType queType, int queNum, uint8_t *isAllocated)
{
uint32_t index, startQueue, endQueue;
*isAllocated = 0;
if (queNum >= 0)
{
/* Invalidate queueFree Object */
Qmss_osalBeginMemAccess ((void *) &queueFree[queNum], 128);
queueFree[queNum]++;
/* Writeback queueFree Object */
Qmss_osalEndMemAccess ((void *) &queueFree[queNum], 128);
*isAllocated = queueFree[queNum];
return (Qmss_QueueHnd) queNum;
}
/* Get the range to allocate from */
startQueue = qmssLObj.maxQueueNum[queType].startIndex;
endQueue = qmssLObj.maxQueueNum[queType].startIndex + qmssLObj.maxQueueNum[queType].maxNum;
/* Invalidate queueFree Object */
Qmss_osalBeginMemAccess ((void *) &queueFree[startQueue], qmssLObj.maxQueueNum[queType].maxNum);
for (index = startQueue; index < endQueue; index++)
{
if (queueFree[index] == 0)
{
queueFree[index]++;
/* Writeback queueFree Object */
Qmss_osalEndMemAccess ((void *) &queueFree[index], 128);
*isAllocated = queueFree[index];
return (Qmss_QueueHnd) index;
}
}
return (Qmss_QueueHnd) -1;
}