AnsweredAssumed Answered

strange question about MPC5744p DMA

Question asked by UWin F on Aug 10, 2016
Latest reply on Aug 11, 2016 by Martin Kovar

i use dma transfer data from source --> destination,the program lists below.(See appendix for detailed code)

 

the question was caused by "dly = destination[10];   "

if there is no read of destination[], for example  use "dly = 100" instead of " dly = destination[10];   "    this program will work well

about dly = destination[X];  if X< 8  it seems that the first 8 data of   destination[] cannot be update by dma 

                                           if X>=8  it seems that the last 8 data of   destination[] cannot be update by dma  (PS: i am not try every index)

Thank you very much!

 

uint32_t source[16]={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16};  
uint32_t destination[16]={0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0};

__attribute__ ((section(".text")))

int main(void)
{
uint32_t k,counter = 0;
uint32_t dly;

xcptn_xmpl ();              /* Configure and Enable Interrupts */

CLK_Init();
AIPS_0_Init();
DMA_0_Init();

for(;;)
{

       dly = destination[10];   /*this will cause strange phenomenon*/    

        for(k=0;k<dly;k++);

 

     //SoftTrig DMA
  DMA_0.TCD[0].CSR.B.START = 1u;
  while(DMA_0.TCD[0].CSR.B.DONE == 0u){};
  DMA_0.TCD[0].CSR.B.DONE = 0u;

        for(k=0;k<100000;k++);

        /*update the source data */
        for(k=0;k<16;k++)
        {
         source[k] = counter;
        }
        counter++;

}

return 0;

}

Original Attachment has been moved to: Example_Base.c.zip

Outcomes