Reply by Khawar Shahzad July 18, 20082008-07-18
HI,
I am using dsk6416 and i am trying to write a program to transfer data
using edma...
I am using dsp bios and i am setting HWI_INT8 to edma controller in
dsp bios and my isr name is "hwi8"
But my problem is that although the data get copied but :
1) edma is not generating transfer complete interupt.
2) If i am transfering 16 elements then i have to call EDMA_setChannel
function 16 times (does edma transfer occur in this way?)
please help me solve this problem.
The code is:

#include
#include
EDMA_Handle handle1;
void hwi8(void);
void initedma(void);
void initIrq(void);
Uint32 buff1[16];
Uint32 buff2[16];
int intr_don=0; //this variable is used to check whether interupt
//occured

Int16 g;

EDMA_Config gEdmaConfigXmt = {
EDMA_FMKS(OPT, PRI, HIGH) | // Priority
EDMA_FMKS(OPT, ESIZE, 32BIT) | // Element size
EDMA_FMKS(OPT, 2DS, NO) | // 2 dimensional source?
EDMA_FMKS(OPT, SUM, INC) | // Src update mode
EDMA_FMKS(OPT, 2DD, NO) | // 2 dimensional dest
EDMA_FMKS(OPT, DUM, INC) | // Dest update mode
EDMA_FMKS(OPT, TCINT, YES) | // Cause EDMA interrupt?
EDMA_FMKS(OPT, TCC, OF(0)) | // Transfer complete code
EDMA_FMKS(OPT, LINK, NO) | // Enable link parameters?
EDMA_FMKS(OPT, FS, NO), // Use frame sync?
//0x20000000,

(Uint32)&buff1, // Src address

EDMA_FMK (CNT, FRMCNT, 0) | // Frame count
EDMA_FMK (CNT, ELECNT, 16), // Element count

(Uint32)&buff2, // Dest address

EDMA_FMKS(IDX, FRMIDX, DEFAULT) | // Frame index value
EDMA_FMKS(IDX, ELEIDX, DEFAULT), // Element index value

EDMA_FMK (RLD, ELERLD, 0) | // Reload element
EDMA_FMK (RLD, LINK, 0) // Reload link
};

void main(void)
{

int i;

for(i=0;i<16;i++)
{
buff1[i]=i+234; //initializing the buff1[] array
buff2[i]=0;
}

IRQ_globalDisable(); // Disable global interrupts during setup

initedma(); // Initialize the EDMA controller

initIrq(); // Initialize interrupts

IRQ_globalEnable();

for(i=0;i<16;i++)
EDMA_setChannel(handle1);

i; //it is just for putting braek point for debugging
}

void initedma()
{
handle1 = EDMA_open(EDMA_CHA_ANY, EDMA_OPEN_ENABLE);
g = EDMA_intAlloc(-1); // get an open TCC

gEdmaConfigXmt.opt |= EDMA_FMK(OPT,TCC,g);

EDMA_config(handle1, &gEdmaConfigXmt);

EDMA_intClear(g);
// clear any possible spurious interrupts

EDMA_intEnable(g); // enable EDMAinterrupts(CIER)

EDMA_enableChannel(handle1);

}

void initIrq(void)
{
/* Enable EDMA interrupts to the CPU */
IRQ_clear(IRQ_EVT_EDMAINT); // Clear any pending EDMA interrupts
IRQ_enable(IRQ_EVT_EDMAINT); // Enable EDMA interrupt
}
void hwi8(void) //this is the isr for edma interrupt
{

intr_don=1;
}
"

thanks.

Khawar Shahzad