各位专家好:
我在FFTC的例程中加入EDMA3时,发现EDMA3函数(EDMA3_DRV_enableTransfer)与QMSS(Qmss_init)冲撞,不能进入中断函数;将EDMA3_DRV_enableTransfer 放在 Qmss_init 前可以进入中断函数,放在 Qmss_init 后边不能进入中断函数。 这可能是哪里出了问题?
关于QMSS的程序如下所示:
memset (&qmssInitConfig, 0, sizeof (Qmss_InitCfg));
/* Set up QMSS configuration.
*
* Use internal linking RAM.
*/
qmssInitConfig.linkingRAM0Base = 0;
qmssInitConfig.linkingRAM0Size = 0;
qmssInitConfig.linkingRAM1Base = 0;
qmssInitConfig.maxDescNum = FFTC_NUM_HOST_DESC;
#ifdef xdc_target__bigEndian
qmssInitConfig.pdspFirmware[0].pdspId = Qmss_PdspId_PDSP1;
qmssInitConfig.pdspFirmware[0].firmware = &acc48_be;
qmssInitConfig.pdspFirmware[0].size = sizeof (acc48_be);
#else
qmssInitConfig.pdspFirmware[0].pdspId = Qmss_PdspId_PDSP2; //Qmss_PdspId_PDSP1
qmssInitConfig.pdspFirmware[0].firmware = &acc48_le;
qmssInitConfig.pdspFirmware[0].size = sizeof (acc48_le);
#endif
/* Initialize the Queue Manager */
if ((result = Qmss_init (&qmssInitConfig, &qmssGblCfgParams)) != QMSS_SOK)
{
System_printf ("Error initializing Queue Manager SubSystem, Error code : %d\n", result);
return -1;
}
关于EDMA程序如下所示:
hEdma = edma3init(edmaInstance, &edmaResult);
if (hEdma)
{
printf("edma3init() Passed\n");
}
else
{
printf("edma3init() Failed, error code: %d\n", (int)edmaResult);
}
// tcc = EDMA3_DRV_TCC_ANY;
// chId= EDMA3_DRV_DMA_CHANNEL_ANY;
result = EDMA3_DRV_requestChannel (hEdma, &chId, &tcc, (EDMA3_RM_EventQueue)0, &callback1, NULL); //&callback1
if (result == EDMA3_DRV_SOK)
{
printf("DMA channel 0: %d\n", chId);
}
else
{
printf("DMA channel 0 request failed!\n");
}
/* Fill the PaRAM Set with transfer specific information */
paramSet.srcAddr = (uint32_t)(Data);
paramSet.destAddr = (uint32_t)(Data_Twi);
/**
* Be Careful !!!
* Valid values for SRCBIDX/DSTBIDX are between -32768 and 32767
* Valid values for SRCCIDX/DSTCIDX are between -32768 and 32767
*/
paramSet.srcBIdx = acnt;
paramSet.destBIdx = acnt*ccnt;
paramSet.srcCIdx = acnt*bcnt;
paramSet.destCIdx = acnt;
/**
* Be Careful !!!
* Valid values for ACNT/BCNT/CCNT are between 0 and 65535.
* ACNT/BCNT/CCNT must be greater than or equal to 1.
* Maximum number of bytes in an array (ACNT) is 65535 bytes
* Maximum number of arrays in a frame (BCNT) is 65535
* Maximum number of frames in a block (CCNT) is 65535
*/
paramSet.aCnt = acnt;
paramSet.bCnt = bcnt;
paramSet.cCnt = ccnt;
paramSet.linkAddr = 0xFFFFU;
paramSet.opt = 0x00900004u;
result = EDMA3_DRV_setPaRAM(hEdma, chId, ¶mSet);
if (result == EDMA3_DRV_SOK)
{
printf("EDMA3_DRV_setPaRAM() Passed\n");
}
else
{
printf("EDMA3_DRV_setPaRAM() Failed, error code: %d\n", (int)edmaResult);
}
// for (i = 0; i < ccnt; i++)
// {
irqRaised1 = 0;
result = EDMA3_DRV_enableTransfer (hEdma, chId, EDMA3_DRV_TRIG_MODE_MANUAL);
if (result != EDMA3_DRV_SOK)
{
printf ("edma3_test: EDMA3_DRV_enableTransfer " \
"Failed, error code: %d\r\n", (int)result);
// break;
}
// printf ("%d \n", i);
while (irqRaised1 == 0u)
{
/* Wait for the Completion ISR. */
printf ("waiting for interrupt...\n");
}
/* Check the status of the completed transfer */
if (irqRaised1 < 0)
{
/* Some error occured, break from the FOR loop. */
printf ("\r\nedma3_test: Event Miss Occured!!!\r\n");
/* Clear the error bits first */
result = EDMA3_DRV_clearErrorBits (hEdma, chId);
// break;
}
for(k=0; k<128; k++)
{
for(jj=0; jj<2048; jj++)
{
if((Data[jj*128+k].real == Data_Twi[k*2048+jj].real) || (Data[jj*128+k].imag == Data_Twi[k*2048+jj].imag))
{
;
}
else
{
printf("(%d , %d)", k,jj);
}
}
}
k = 0;
// }