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.

QDMA not moving all frames

Hi

I am trying to do a QDMA from EMIFB address to EMIFA address.  I am trying to move more than 64k of data so I have to use more than one frame or a block move.  The problem is it only move like 2 Frames of data below is my code snipet

EDMA_Config qEdmaXmtFpga =
   {
      EDMA_FMKS(OPT, PRI, HIGH) |       // Priority
      EDMA_FMKS(OPT, ESIZE, 16BIT) |    // Element size
      EDMA_FMKS(OPT, 2DS, YES) |         // 2 dimensional source?
      EDMA_FMKS(OPT, SUM, INC) |        // Src increment by element size
      EDMA_FMKS(OPT, 2DD, YES) |         // 2 dimensional dest
      EDMA_FMKS(OPT, DUM, INC) |       // Dest is DDR fix address
      EDMA_FMKS(OPT, TCINT, NO) |      // Cause EDMA interrupt?
      EDMA_FMKS(OPT, TCC, DEFAULT) |     // Transfer complete code
      EDMA_FMKS(OPT, LINK, NO) |       // Enable link parameters?
      EDMA_FMKS(OPT, FS, YES),           // Use frame sync?

      EDMA_FMKS(SRC, SRC, OF(0)),   // Src address

      EDMA_FMK (CNT, FRMCNT, NULL) |    // Frame count
      EDMA_FMK (CNT, ELECNT, ELEMENT_CNT), // Element count

      EDMA_FMKS(DST, DST, OF(0)),       // Dest address

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

      EDMA_FMK (RLD, ELERLD, NULL) |   // Reload element
      EDMA_FMK (RLD, LINK, NULL)       // Reload link

 

     qEdmaXmtFpga.src = (unsigned int)(0x64000000);            
     qEdmaXmtFpga.cnt = 0XFFFF;           
     qEdmaXmtFpga.dst = (unsigned int)(0x80200000);;                      
     qEdmaXmtFpga.idx = 0;                  
     EDMA_qdmaConfig(&qEdmaXmtFpga);
     wait();  //// wait for transfer to complete

looking at the data I see only 2 blocks of 64K moved.  What did I do wrong with my config?

 

Dusty,


   };

  • Sorry, I have an incorrect frame in my snipet.   The frame count should be "9".   I am trying to move 10 frames of data.

     

  • Please re-post your code EXACTLY as it is written.  When you say the frame count should be 9, where did you make that change and how?  I see that you have a frame count "NULL" in the structure followed by a write of 0xFFFF to the cnt field below it.  Which did you modify?  How did you modify it?

    When you write to the cnt field that is a 32-bit field.  Your current code writing 0xFFFF would be writing 0 to the upper bits (frame count).  Is that where you changed it or did you change it in the structure?

  • I changed directly in the config structure.  The code below is updated.

     

    EDMA_Config qEdmaXmtFpga =
       {
          EDMA_FMKS(OPT, PRI, HIGH) |       // Priority
          EDMA_FMKS(OPT, ESIZE, 16BIT) |    // Element size
          EDMA_FMKS(OPT, 2DS, YES) |         // 2 dimensional source?
          EDMA_FMKS(OPT, SUM, INC) |        // Src increment by element size
          EDMA_FMKS(OPT, 2DD, YES) |         // 2 dimensional dest
          EDMA_FMKS(OPT, DUM, INC) |       // Dest is DDR fix address
          EDMA_FMKS(OPT, TCINT, NO) |      // Cause EDMA interrupt?
          EDMA_FMKS(OPT, TCC, DEFAULT) |     // Transfer complete code
          EDMA_FMKS(OPT, LINK, NO) |       // Enable link parameters?
          EDMA_FMKS(OPT, FS, YES),           // Use frame sync?

          EDMA_FMKS(SRC, SRC, OF(0)),   // Src address

          EDMA_FMK (CNT, FRMCNT,  9 ) |    // Frame count
          EDMA_FMK (CNT, ELECNT, ELEMENT_CNT), // Element count

          EDMA_FMKS(DST, DST, OF(0)),       // Dest address

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

          EDMA_FMK (RLD, ELERLD, NULL) |   // Reload element
          EDMA_FMK (RLD, LINK, NULL)       // Reload link

     

         qEdmaXmtFpga.src = (unsigned int)(0x64000000);            
         qEdmaXmtFpga.cnt = 0XFFFF;           
         qEdmaXmtFpga.dst = (unsigned int)(0x80200000);;                      
         qEdmaXmtFpga.idx = 0;                  
         EDMA_qdmaConfig(&qEdmaXmtFpga);
         wait();  //// wait for transfer to complete

  • Look at your struct in a watch window.  I think this line:

    EDMA_FMK (CNT, FRMCNT,  9 ) |    // Frame count

    will set the upper half of cnt to 9.  However, I think this line

         qEdmaXmtFpga.cnt = 0XFFFF;           

    will set it back to 0.

    I'm not quite sure why you're seeing two frames transferred yet.  I would have thought that with FRMCNT=0 you would only get 1 frame.

    Why do you have your code structured this way?  That is, why don't you write the whole struct in one shot when using all the EDMA_FMK macros?  It seems like you are doing twice the amount of work.

    Brad

  • There is other reason other than that I am reusing the code some where else where I have some what dynamic conditions to change the source and destination.  I just copy that code to test QDMA to see if it can do what I want it to do within secondary bootloader.   I can change the code to use all to EDMA_FMK but I don't think it would make any difference.   I will give it a try.

     

    Dusty.

  • It's not the fact that you've done it two ways that is the problem.  It's that when you did it the second time you wrote the wrong value (FRMCNT=0).

  • I never thought the ".cnt" will wipe out the frame count.   I figure that is just element count.   I will try it again using all config. 

    Dusty,

     

  • Brad,

    That was the problem.  I am clearing out the frame count by setting it again below.  It works correctly once I set all the parameters in one location.  Thanks.

    Dusty,