I use C64+ dsp. I want to use “code II” to instead of “code I”.
//-------------------------------------------------------------------------------------------------
codeI:
“ for (y=0; y<144; y++)
for (x=0; x<176; x++)
imgY_org_frm [y][x] = imgY_org_buffer[y*176+x]; ”
codeII:
status = CSL_edmaInit(&context);
hModule = CSL_edmaOpen(NULL,CSL_EDMA_1,NULL,&status);
regionAccess.region = CSL_EDMA_REGION_1 ;
regionAccess.drae = 0xFFFF ;
regionAccess.draeh = 0x0 ;
status = CSL_edmaHwControl(hModule,CSL_EDMA_CMD_DMAREGION_ENABLE,®ionAccess);
regParam.regionNum = CSL_EDMA_REGION_1;
CSL_edmaRegionOpen(&RegionObj,CSL_EDMA_1,®Param,&status);
chAttr.regionNum = CSL_EDMA_REGION_1;
chAttr.chaNum = CSL_EDMA_CHA0;
hChannel = CSL_edmaChannelOpen(&chObj, CSL_EDMA_1, &chAttr, &status);
hParamBasic = CSL_edmaGetParamHandle(hChannel,CSL_EDMA_CHA0, &status);
myParamSetup.option = CSL_EDMA_OPT_MAKE( FALSE, \
FALSE, \
FALSE, \
TRUE,\
8,
CSL_EDMA_TCC_NORMAL,\
CSL_EDMA_FIFOWIDTH_NONE, \
TRUE, \
CSL_EDMA_SYNC_AB, \
CSL_EDMA_ADDRMODE_INCR, \
CSL_EDMA_ADDRMODE_INCR
);
myParamSetup.srcAddr = (Uint32)(0x80270588); //the address of “imgY_org_buffer”
myParamSetup.aCntbCnt = CSL_EDMA_CNT_MAKE(176,144);
myParamSetup.dstAddr = (Uint32)(0x80279C58); // the address of “imgY_org_frm”
myParamSetup.srcDstBidx = CSL_EDMA_BIDX_MAKE(176,176);
myParamSetup.linkBcntrld = CSL_EDMA_LINKBCNTRLD_MAKE(CSL_EDMA_LINK_NULL,0);
myParamSetup.srcDstCidx = CSL_EDMA_CIDX_MAKE(0,0);
myParamSetup.cCnt = 1;
myParamSetup.triggerWord = CSL_EDMA_TRIGWORD_NONE;
status = CSL_edmaParamSetup(hParamBasic, &myParamSetup,CSL_EDMA_PARAM_BASIC);//??????
status = CSL_edmaHwChannelControl(hChannel,CSL_EDMA_CMD_CHANNEL_ENABLE, NULL);
CSL_edmaHwChannelControl(hChannel,CSL_EDMA_CMD_CHANNEL_SET,NULL);
do {
CSL_edmaGetHwStatus(hModule,CSL_EDMA_QUERY_INTERRUPT_PENDSTATUS,®ionIntr);
} while (!(regionIntr[0] & 0x100));
status = CSL_edmaHwControl(hModule,CSL_EDMA_CMD_INTERRUPT_CLEAR,®ionIntr);
regionAccess.region = CSL_EDMA_REGION_1 ;
regionAccess.drae = 0xFFFF ;
regionAccess.draeh = 0x0 ;
CSL_edmaHwControl(hModule,CSL_EDMA_CMD_DMAREGION_DISABLE, ®ionAccess);
CSL_edmaHwChannelControl (hChannel, CSL_EDMA_CMD_CHANNEL_DISABLE, NULL);
CSL_edmaHwChannelControl (hChannel, CSL_EDMA_CMD_CHANNEL_CLEAR, NULL);
CSL_edmaChannelClose(hChannel);
CSL_edmaClose(hModule);
//---------------------------------------------------------------------------------------------------------------------
now my question is :
when the first time ,process run here。the first time source data ==the first time destination data,the transfer is right;
when the second time , process run here。the second time source data !=the second time destination data,and the second time destination data == the first time source data,the transfer is wrong!!
when the third time , process run here。the third time source data !=the third time destination data,and the third time destination data == the second time source data,the transfer is wrong!!
when the forth time , process run here。the forth time source data !=the forth time destination data,and the forth time destination data == the third time source data,the transfer is wrong!!
……
you can see that except the first time , the other time “current source data != current destination data” and “current destination data == the old source data ”, BUT my aim is make “current source data == current destination data”,I think codeII may have same problem,and same parameter may have problem ,so the channel or other things can’t updata the data.could you help me find out the problem?