Hello people,
I'm actually working on EDMA3, and I think there is a problem in the configuration. I'm wondering why my destination buffer is not equal to my source buffer when I start a DMA transfert.
Here are the step that I follow to configure the EDMA3 module:
1)
I use 2 global variables :
Uint8 buffer_source1[512];
Uint8 buffer_destination1[512];
2)
I call all of this functions:
CSL_edma3Init();
CSL_edma3Open();
attr_canal.regionNum = CSL_EDMA3_REGION_GLOBAL;
attr_canal.chaNum = CSL_EDMA3_CMD_CHANNEL_4;
CSL_edma3ChannelOpen();
CSL_edma3GetParamHandle();
// Param configuration:
param_setup.option = CSL_EDMA3_OPT_MAKE
(
CSL_EDMA3_ITCCH_DIS,
CSL_EDMA3_TCCH_DIS,
CSL_EDMA3_ITCINT_DIS,
CSL_EDMA3_TCINT_DIS,
CSL_EDMA3_CMD_CHANNEL_4, // TCC (ex., match ch)
CSL_EDMA3_TCC_NORMAL,
CSL_EDMA3_FIFOWIDTH_NONE,
CSL_EDMA3_STATIC_DIS,
CSL_EDMA3_SYNC_A, // Sync mode (A or AB)
CSL_EDMA3_ADDRMODE_INCR,
CSL_EDMA3_ADDRMODE_INCR
);
param_setup.srcAddr = (Uint32)buffer_source1;
param_setup.aCntbCnt = CSL_EDMA3_CNT_MAKE(256, 1) ;
param_setup.dstAddr = (Uint32)buffer_destination1;
param_setup.srcDstBidx = CSL_EDMA3_BIDX_MAKE(1, 1) ;
param_setup.linkBcntrld = CSL_EDMA3_LINKBCNTRLD_MAKE(param_handle, 0);
param_setup.srcDstBidx = CSL_EDMA3_CIDX_MAKE(0 ,1);
param_setup.cCnt = 1;
CSL_edma3ParamSetup();
CSL_edma3HwChannelSetupParam(canal_handle, 1);
CSL_edma3HwChannelSetupQue(canal_handle,CSL_EDMA3_QUE_1);
// trigger the transfer
CSL_edma3HwChannelControl(canal_handle,CSL_EDMA3_CMD_CHANNEL_SET,NULL);
// I call this function in order to verify the transfer:
verifier_transfert(buffer_source1, buffer_destination1);
int verifier_transfert(Uint8 *buffer_source, Uint8 *buffer_destination)
{
Uint8* ptr_tab_source = (Uint8*)buffer_source ;
Uint8* ptr_tab_dest = (Uint8*)buffer_destination;
int i ;
CACHE_invL1d ((void *)buffer_source, 512, CACHE_WAIT);
CACHE_invL2 ((void *)buffer_source, 512,CACHE_WAIT);
CACHE_invL1d ((void *)buffer_destination, 512, CACHE_WAIT);
CACHE_invL2 ((void *)buffer_destination, 512, CACHE_WAIT);
for (i = 0; i < 512; i++)
{
if (ptr_tab_source[i] != ptr_tab_dest[i])
{
System_printf("ptr_tab_source[%d] = %d != ptr_tab_dest[%d] = %d.\n", i,
ptr_tab_source[i], i, ptr_tab_dest[i]);
return FALSE;
}
}
return TRUE;
}
So my question is: do you know what is wrong in my code? When I check the different ptr, they are not equal and I jump out of the loop at the 2nd iteration.
I'm wonderwing if the configuration is fine... I check the status after each call of each function and it's always equal to CSL_SOK.
I also have a second question: I want to use EDMA3 through hyperlink using two C6678. Do you know what are the steps to follow to map the signals into the hyperlink window?
Reguards.