This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi, when I initialize EDMA3 in c6657, it got error after executing "hModule = CSL_edma3Open(&edmaObj, 0, NULL, &status);". When I debugged the code, the value of hModule is NULL. What's the problem? thanks.
The following is part of the code:
void main()
{
//3.1 edma initialization for ddr3 test
CSL_Edma3Handle hModule;
CSL_Edma3Obj edmaObj;
CSL_Edma3ParamHandle hParam;
CSL_Edma3ChannelObj chObj;
CSL_Edma3ChannelHandle hChannel;
CSL_Edma3ParamSetup myParamSetup;
CSL_Edma3Context context;
CSL_Edma3ChannelAttr chAttr;
CSL_Edma3CmdIntr regionIntr;
uint32_t instNum;
uint32_t channelNum;
uint8_t *srcBuff1;
uint8_t *dstBuff1;
uint32_t index;
instNum = 0;
channelNum = 0;
srcBuff1 = (uint8_t *)0x80000000;
dstBuff1 = (uint8_t *)0xA0000000;
for(index=0; index<256; index++)
srcBuff1[index] = index;
/* Module initialization */
if (CSL_edma3Init(&context) != CSL_SOK)
{
printf ("Error: EDMA module initialization failed\n");
return;
}
/* Open the EDMA Module using the provided instance number */
hModule = CSL_edma3Open(&edmaObj, 0, NULL, &status);
if ( (hModule == NULL) || (status != CSL_SOK))
{
printf ("Error: EDMA module open failed\n");
return;
}
/* Channel open */
chAttr.regionNum = CSL_EDMA3_REGION_GLOBAL;
chAttr.chaNum = channelNum;
hChannel = CSL_edma3ChannelOpen(&chObj, instNum, &chAttr, &status);
if ((hChannel == NULL) || (status != CSL_SOK))
{
printf ("Error: Unable to open EDMA Channel:%d\n", channelNum);
return;
}
.............................................
}
Hi,
Thanks for your post.
I presume that, you are using CSL initialization procedure for EDMA in your example.
You have CSL based EDMA examples at the below loaction for C6678 which could be used as sample reference for C6657 as well:
~\ti\mcsdk_2_01_02_06\pdk_C6678_1_1_2_6\packages\ti\csl\example\edma\edma_test.c
The above is the EDMA example test code uses the EDMA CSL functional layer for the c6678 device. You can build it for other targets (C6670, C6657 ) too through copying the above EDMA test source code into a new empty CCS project and link the functional CSL EDMA library (file name : ti.csl.ae66 ) by adding the directory to the library search path to the project properties->File Search Path. Then you can build this EDMA example in CCS and run without any issues.
http://processors.wiki.ti.com/index.php/CSL#Chip_Support_Library_for_C6670
May be, i could recommend few suggestion below:
1. Ensure whether TCINTEN bit is enabled in channel OPT and only then, the interrupt pending register (IPR / IPRH) relevant bit position appropriate to the DMA event would be set on transfer completion
2. Also, please ensure the TCCMODE bit in OPT which would indicate normal or early completion of data transfer. To clarify you that any TCC value cannot be set in the PaRAM and the fact is that the 6-bit TCC would be posted by the TC to the CC after it receives the transfer completion signal from the destination peripheral in normal completion mode. This 6-bit code sets the relevant bit in the interrupt pending register (IPR [TCC] / IPRH [TCC]) for interrupt triggered.
3. I would suggest you to validate the received TCC code in OPT first and obviously, the corresponding bit position in IPR/IPRH would be set which is directly the TCC value and thereafter, the corresponding IER[TCC] / IERH [TCC] bit would be set to generate a EDMA completion interrupt to the DSP
Thanks & regards,
Sivaraj K
-------------------------------------------------------------------------------------------------------
Please click the Verify Answer button on this post if it answers your question.
-------------------------------------------------------------------------------------------------------