Hello:
i am trying to trigger EDMA processes by rising edges of a GPIO pin. for one trigger, it is OK. but it seems that when a second EDMA process is finished, the DSP refuses to execute the EDMA complete interrupt function.
i find that when a second rising edge is attached to the GPIO pin, the data transportion is done, but corresponding EDMACC IPR bit is still 1,and corresponding EDMATC SCANT bits is (which as far as i know should be zero once the transportion is finished). is there anything i have missed?
follewed is some related functions:
interrupt void c_int04() {// GPIO interrupt handle...trigger a new transportion
IER &= 0xFFFFFFEF; //disable GPIO bank2 interrupt
/* so that any toggling of the HF flag is disregarded until the DMA*/
EDMA_ESR |= 0x1; /* Starts the DMA transfer, if haven’t transferred the desired number of frames. */
printf("a new frame is started\n");
}
interrupt void c_int05(){ /* DMA complete Interrupt */
printf("one frame has been transmitted\n");
EDMA_ICR |= 0x01;
EDMA_SECR |=0x01;
EMCR |= 0x01;
set_EDMA();
IER |= 0x01<<4; /* enable GPIO bank2 interrupt, to detect the next rising edge of HF */
done = 0;
src[0] = 3;}
void set_EDMA(){
/* Step 1: EDMA initialization */
SAOPT0 = 0x00100071; // lowest priority
QWMTHRA =(16<<8u)|(16 & 0xFF); // when event number equals in queue or exceeds it, errs are generated
EMCR = 0xFFFFFFFF; // clear previous missed events
CCERRCLR = 0xFFFFFFFF; // Clear previous errs
EDMA_DARE1 |=0x01;
/* Step 2: Programming DMA Channel (and Param set) */
DMAQNUM0=0x0; // Event is queued in queue 0
CH0_OPT = 0x00100000;
CH0_SRC = (Uint32)&src;
CH0_A_B_CNT = ((1 << 16u) | (0x000F & 0xFFFFu)); /* ACNT = 128, BCNT = 1 */
CH0_DST = (Uint32)&dst;
CH0_SRC_DST_BIDX = (0 << 16u) | (0 & 0xFFFFu); /* SRC_BIDX = 0, DST_BIDX = 128 */
CH0_LINK_BCNTRLD = ((0 & 0xFFFFu) << 0u) | 0xFFFFu; /* LINK = 0xFFFF, BCNTRLD = 1 */
CH0_SRC_DST_CIDX = 0;
CH0_CCNT = 1;
/* Step 3: Triggering the Transfer and Waiting for Transfer Completion */
EDMA_ISER |= 0x01; //enable channel0 complete interrupt
//EDMA_ICR = 0x01;
}