下面是我自己写的一个DMA搬数据的测试但在运行时会出错
/*********************************DMA_TEST***************************************/
Vps_printf("===============================DMA is start!\n");
int buf[1000] = {1,2,3,4,5,6,7,9,10,32,99,66,88};
int dst[1000] = {0}; Int32 retVal;
Utils_DmaChObj dumpFramesDmaObj;
Utils_DmaChCreateParams dmaParams; Utils_DmaCopy1D dmaPrm;
Utils_dmaInit();
Utils_DmaChCreateParams_Init(&dmaParams);
Vps_printf("================1===============DMA is succeed!\n");
dmaParams.edmaInstId = UTILS_DMA_SYSTEM_EDMA_INST_ID;
Vps_printf("DMA:maxTransfers = %d,edmaInstId = %d\n",dmaParams.maxTransfers,dmaParams.edmaInstId);
retVal = Utils_dmaCreateCh(&dumpFramesDmaObj,&dmaParams); UTILS_assert(SYSTEM_LINK_STATUS_SOK == retVal);
Vps_printf("================2===============DMA is succeed!\n");
dmaPrm.srcAddr = (Ptr)((UInt32)buf);
dmaPrm.destAddr = (Ptr)((UInt32)dst);
dmaPrm.length = sizeof(int)*1000;
retVal = Utils_dmaCopy1D(&dumpFramesDmaObj,&dmaPrm);
UTILS_assert(SYSTEM_LINK_STATUS_SOK == retVal);
Utils_dmaDeleteCh(dumpFramesDmaObj);
Utils_dmaInit();
Vps_printf("DMA_TEST: dst[0] = %d,dst[1] = %d,dst[2] = %d,dst[3] = %d,dst[4] = %d \
dst[5] = %d,dst[6] = %d\n",dst[0],dst[1],dst[2],dst[3],dst[4],dst[5],dst[6]);
/*********************************DMA_TEST***************************************/
出错后打印出的log
[DSP2 ] 5.222320 s: ===============================DMA is start!
[DSP2 ] 5.223113 s: ================1===============DMA is succeed!
[DSP2 ] 5.223144 s: DMA:maxTransfers = 1,edmaInstId = 0
[DSP2 ] 5.223205 s: UTILS: DMA: Allocated CH (TCC) = 60 (60)
[DSP2 ] 5.223235 s: UTILS: DMA: 0 of 1: Allocated PaRAM = 60 (0x43304780)
[DSP2 ] 5.223266 s: ================2===============DMA is succeed!
[DSP2 ] 5.223449 s:[DSP2 ] 5.223449 s: ### XDC ASSERT – ERROR CALLBACK START ###[DSP2 ] 5.223479 s:[DSP2 ] 5.223510 s: assertion failure: A_badContext: bad calling context. Must be called from a Task.
[DSP2 ] 5.223540 s:[DSP2 ] 5.223540 s: ### XDC ASSERT – ERROR CALLBACK END ###
Shine:
请问用的是哪款器件?参考的是哪个软件包?
Yuan Feng3:
回复 Shine:
用的TDA2xx芯片,VISION_SDK_02_10_00_00,这个软件包
Shine:
回复 Yuan Feng3:
抱歉,汽车芯片不通过德仪论坛进行支持,可以找你的TI销售获取技术支持或者到e2e上咨询。
https://e2e.ti.com/support/arm/automotive_processors/
Yuan Feng3:
回复 Shine:
但这个函数的调用都是差不多的,
我刚才把dmaParams.edmaInstId = UTILS_DMA_SYSTEM_EDMA_INST_ID
改成dmaParams.edmaInstId = UTILS_DMA_LOCAL_EDMA_INST_ID
它可以执行过,但出来的结果有问题,dst数组里面的数据没变。