ADSP-21065L Memory DMA

I am supporting a legacy product that is using the 21065L.  I would like to replace a memcpy() with a DMA copy to improve the throughput.

The original code is:

UNSIGNED32 *extMem = 0x10000000;

UNSIGNED32 *intMem = 0x0000D000;

memcpy(extMem, intMem, 100);

The DMA code is:

    // DMA off
    *pDMAC1 = 0;


    // set DMA control regs
    *pIIEP1 = (UNSIGNED32)(intMem); // internal RAM     
    *pIMEP1 = 1; // single increment
    *pCEP1 = 100; // count
    *pEIEP1 = (UNSIGNED32)(extMem); // external RAM
    *pEMEP1 = 1; // single increment
    *pECEP1 = 100; // count


    // turn DMA on
    *pDMAC1 = (DEN | TRAN | MASTER);


    // wait for DMA to finish, to keep the same flow as with memcpy
    while ((*pDMASTAT & DMA7ST) != 0);  

When I run this, nothing happens.  It doesn't hang, it just falls through with no memory writes at all.

I'm sure it's something simple, as I'm not familiar with this device.

TIA.

Parents
  • Hi Dan,

            I would like to first clarify on the DMA channel need to be used for External port channel 1. Please refer the ADSP-21065L user manual on the below link:

    http://www.analog.com/static/imported-files/processor_manuals/37788354774923823818314265L_book_um.pdf.

     

    Table 6-1 and Table 6-2 shows that the External port channel 1 is associated with DMA channel 1. On the def21065l.h file,the below definitions show the same:

     

    #define      IIEP1      0x48      /* DMA channel 9 index reg.            */
    #define      IMEP1      0x49      /* DMA channel 9 modify                */
    #define      CEP1       0x4A      /* DMA channel 9 count reg.            */
    #define      CPEP1      0x4B      /* DMA channel 9 chain pointer reg.    */
    #define      GPEP1      0x4C      /* DMA channel 9 general purpose reg.  */
    #define      EIEP1      0x4D      /* DMA channel 9 external index reg.  
    */
    #define      EMEP1      0x4E      /* DMA channel 9 external modify       */
    #define      ECEP1      0x4F      /* DMA channel 9 external count reg.  
    */

     

     

    #define      II9      0x48        /* DMA channel 9 index reg.            */
    #define      IM9      0x49        /* DMA channel 9 modify                */
    #define      C9       0x4A        /* DMA channel 9 count reg.            */
    #define      CP9      0x4B        /* DMA channel 9 chain pointer reg.    */
    #define      GP9      0x4C        /* DMA channel 9 general purpose reg.  */
    #define      EI9      0x4D        /* DMA channel 9 external index reg.  
    */
    #define      EM9      0x4E        /* DMA channel 9 external modify       */
    #define      EC9      0x4F        /* DMA channel 9 external count reg.   */

     

    I feel the comments used on the def21065l.h is not applicable for ADSP-21065L completely. I will take care of this and make sure that these comments are updated correctly.

     

    Also refer the Table 5-2 which shows the memory map for the processor. The maximum external memory address supported by the processor is on 0x03FFFFFF.  But the example sequence you have posted uses the external memory address of 0x10000000. I feel this might be the reason for the DMA not starting up.

     

    I have also added an example code which uses the DMA channel 9 for transfering data to the external SDRAM on the EZ-KIT. I have tested this code for both interrupt driven and polling mode. This code works fine.

     

    Best Regards,

    Jeyanthi

     

Reply
  • Hi Dan,

            I would like to first clarify on the DMA channel need to be used for External port channel 1. Please refer the ADSP-21065L user manual on the below link:

    http://www.analog.com/static/imported-files/processor_manuals/37788354774923823818314265L_book_um.pdf.

     

    Table 6-1 and Table 6-2 shows that the External port channel 1 is associated with DMA channel 1. On the def21065l.h file,the below definitions show the same:

     

    #define      IIEP1      0x48      /* DMA channel 9 index reg.            */
    #define      IMEP1      0x49      /* DMA channel 9 modify                */
    #define      CEP1       0x4A      /* DMA channel 9 count reg.            */
    #define      CPEP1      0x4B      /* DMA channel 9 chain pointer reg.    */
    #define      GPEP1      0x4C      /* DMA channel 9 general purpose reg.  */
    #define      EIEP1      0x4D      /* DMA channel 9 external index reg.  
    */
    #define      EMEP1      0x4E      /* DMA channel 9 external modify       */
    #define      ECEP1      0x4F      /* DMA channel 9 external count reg.  
    */

     

     

    #define      II9      0x48        /* DMA channel 9 index reg.            */
    #define      IM9      0x49        /* DMA channel 9 modify                */
    #define      C9       0x4A        /* DMA channel 9 count reg.            */
    #define      CP9      0x4B        /* DMA channel 9 chain pointer reg.    */
    #define      GP9      0x4C        /* DMA channel 9 general purpose reg.  */
    #define      EI9      0x4D        /* DMA channel 9 external index reg.  
    */
    #define      EM9      0x4E        /* DMA channel 9 external modify       */
    #define      EC9      0x4F        /* DMA channel 9 external count reg.   */

     

    I feel the comments used on the def21065l.h is not applicable for ADSP-21065L completely. I will take care of this and make sure that these comments are updated correctly.

     

    Also refer the Table 5-2 which shows the memory map for the processor. The maximum external memory address supported by the processor is on 0x03FFFFFF.  But the example sequence you have posted uses the external memory address of 0x10000000. I feel this might be the reason for the DMA not starting up.

     

    I have also added an example code which uses the DMA channel 9 for transfering data to the external SDRAM on the EZ-KIT. I have tested this code for both interrupt driven and polling mode. This code works fine.

     

    Best Regards,

    Jeyanthi

     

Children
No Data