Hello guys,
Im currently working on the TMS320C6474 EVM and for your information Im still a newbie with DSPs. Ive gone through a few TI workshop guides before embarking in this and now im a bit stuck.
I tried to implement memory data transfer with EDMA3 and followed all necessary steps including resuing/testing on one of the example codes that was available. The codes seem to build and execute as I want it but when I look at the memory map, no data is being transfered at all. Do you guys have an idea what the problem is.
Btw Im using ccs4 and Ive done all necessary steps according to the guides ive seen for example:
void edma_sub_frame_xfer (void)
{
CSL_Edma3Handle hModule;
// CSL_Edma3HwSetup hwSetup;
CSL_Edma3Obj edmaObj;
CSL_Edma3ParamHandle hParamBasic;
CSL_Edma3ChannelObj chObj;
CSL_Edma3CmdIntr regionIntr;
CSL_Edma3CmdDrae regionAccess;
CSL_Edma3ChannelHandle hChannel;
CSL_Edma3ParamSetup myParamSetup;
CSL_Edma3Context context;
CSL_Edma3ChannelAttr chAttr;
CSL_Status status;
// CSL_Edma3HwDmaChannelSetup dmahwSetup;
volatile Uint32 loopIndex;
printf ("Running Edma Example\n");
/* Module Initialization */
status = CSL_edma3Init(&context);
if (status != CSL_SOK) {
printf ("Edma module initialization failed\n");
return;
}
/* Module level open */
hModule = CSL_edma3Open(&edmaObj,CSL_EDMA3,NULL,&status);
if ( (hModule == NULL) || (status != CSL_SOK)) {
printf ("Edma module open failed\n");
return;
}
#if 0
/* Module setup */
dmahwSetup.paramNum = 0;
dmahwSetup.que = CSL_EDMA3_QUE_0;
hwSetup.dmaChaSetup = &dmahwSetup;
hwSetup.qdmaChaSetup = NULL;
status = CSL_edma3HwSetup(hModule,&hwSetup);
if (status != CSL_SOK) {
printf ("Hardware setup failed\n");
CSL_edma3Close (hModule);
return;
}
#endif
/* DRAE enable(Bits 0-15) for the shadow region 5 */
regionAccess.region = CSL_EDMA3_REGION_5 ;
regionAccess.drae = 0xFFFF ;
regionAccess.draeh = 0x0000 ;
status = CSL_edma3HwControl(hModule,CSL_EDMA3_CMD_DMAREGION_ENABLE, \
®ionAccess);
if (status != CSL_SOK) {
printf ("Edma region enable command failed\n");
return;
}
/* Channel 0 open in context of shadow region 5 */
chAttr.regionNum = CSL_EDMA3_REGION_5;
chAttr.chaNum = CSL_EDMA3_CHA_TEVTLO0;
hChannel = CSL_edma3ChannelOpen(&chObj, CSL_EDMA3, &chAttr, &status);
if ((hChannel == NULL) || (status != CSL_SOK)) {
printf ("Edma channel open failed\n");
return;
}
CSL_edma3HwChannelSetupParam(hChannel, CSL_EDMA3_CHA_TEVTLO0);
if (status != CSL_SOK) {
printf ("Edma channel setup param failed\n");
return;
}
/* Change Channel Default queue setup to 0 */
status = CSL_edma3HwChannelSetupQue(hChannel,CSL_EDMA3_QUE_0);
if (status != CSL_SOK) {
printf ("Edma channel setup que failed\n");
return;
}
/* Obtain a handle to parameter set 0 */
hParamBasic = CSL_edma3GetParamHandle(hChannel,0,NULL);
if (hParamBasic == NULL) {
printf ("Edma get param handle for param entry 0 failed\n");
return;
}
/* Setup the first param set */
myParamSetup.option = CSL_EDMA3_OPT_MAKE (CSL_EDMA3_ITCCH_DIS, \
CSL_EDMA3_TCCH_DIS, \
CSL_EDMA3_ITCINT_DIS, \
CSL_EDMA3_TCINT_EN,\
0, CSL_EDMA3_TCC_NORMAL,\
CSL_EDMA3_FIFOWIDTH_NONE, \
CSL_EDMA3_STATIC_EN, \
CSL_EDMA3_SYNC_AB, \
CSL_EDMA3_ADDRMODE_INCR, \
CSL_EDMA3_ADDRMODE_INCR
);
myParamSetup.srcAddr = (Uint32)srcBuff1;
myParamSetup.aCntbCnt = CSL_EDMA3_CNT_MAKE(20,12);
myParamSetup.dstAddr = (Uint32)dstBuff1;
myParamSetup.srcDstBidx = CSL_EDMA3_BIDX_MAKE(40,20);
myParamSetup.linkBcntrld = CSL_EDMA3_LINKBCNTRLD_MAKE(CSL_EDMA3_LINK_NULL,0);
myParamSetup.srcDstCidx = CSL_EDMA3_CIDX_MAKE(0, 1);
myParamSetup.cCnt = 1;
status = CSL_edma3ParamSetup(hParamBasic, &myParamSetup);
if (status != CSL_SOK) {
printf("Edma parameter entry setup is failed\n");
return;
}
/* Enable channel */
status = CSL_edma3HwChannelControl(hChannel,CSL_EDMA3_CMD_CHANNEL_ENABLE, \
NULL);
if (status != CSL_SOK) {
printf("Edma channel enable command is failed\n");
return;
}
/* Initialize data */
for (loopIndex = 0; loopIndex < 41; loopIndex++) {
srcBuff1[loopIndex] = loopIndex;
dstBuff1[loopIndex] = 0;
}
for (loopIndex = 41; loopIndex < NOF_BYTES_XFR; loopIndex++) {
srcBuff1[loopIndex] = loopIndex + 12;
dstBuff1[loopIndex] = 0;
}
/* Manually trigger the channel */
status = CSL_edma3HwChannelControl(hChannel,CSL_EDMA3_CMD_CHANNEL_SET,NULL);
if (status != CSL_SOK) {
printf("Edma channel set command is failed\n");
return;
}
regionIntr.region = CSL_EDMA3_REGION_5;
regionIntr.intr = 0;
regionIntr.intrh = 0;
do {
/* Poll on interrupt bit 0 */
CSL_edma3GetHwStatus(hModule,CSL_EDMA3_QUERY_INTRPEND,®ionIntr);
} while (!(regionIntr.intr & 0x1));
/* Clear interrupt bit 0 */
status = CSL_edma3HwControl(hModule,CSL_EDMA3_CMD_INTRPEND_CLEAR, \
®ionIntr);
if (status != CSL_SOK) {
printf("Edma clear interrupt bit 0 command is failed\n");
return;
}
/* Check transfer */
if(Verify_Transfer(20, 12, 1, 40, 20, 0, 0, srcBuff1, dstBuff1,TRUE)
== FALSE) {
passStatus = 0;
}
if (passStatus == 1)
printf ("<<EXAMPLE PASSED>>: Edma Sub Frame Transfer Passed\n");
else {
printf ("<<EXAMPLE FAILED>>: Edma Sub Frame Buffer Transfer Failed\n");
return;
}
/* Close channel */
status = CSL_edma3ChannelClose(hChannel);
if (status != CSL_SOK) {
printf("Edma channel close failed\n");
return;
}
/* Close edma module */
status = CSL_edma3Close(hModule);
if (status != CSL_SOK) {
printf("Edma module close failed\n");
return;
}
printf ("=============================================================\n");
return;
}
The status checks have all turned out ok but it just doesnt do anything after manually triggering.
Thanks, danny