2 Replies Latest reply on May 21, 2020 3:22 AM by NiVa_4337911

    DMA -  Dynamically Changing TD properties using CyDmaTdSetConfiguration

    NiVa_4337911

      Hi,

      I have a set of chained TDs to transfer data from SRAM bytes to a peripheral, and I need to change ending TD dynamically. Since it is required to get signal from DMA after each byte transfer, I used separate TDs for each byte with DMA__TD_TERMOUT_EN for each TD properties.

       

      The problem is, the number of bytes to transfer is not fixed and hence I tried to change the end TD property as shown below:

           for(i = 0; i < (numberOfBytes - 1); i++)
          {
              CyDmaTdSetConfiguration(DmaTd[i], 1, DmaTd[i+1], DMA1__TD_TERMOUT_EN);
          }
          CyDmaTdSetConfiguration(rfDmaTd[i], 1, DMA_DISABLE_TD, DMA1__TD_TERMOUT_EN);

       

      But the above is not working unless re-configuring the DMA each time from the beginning, i.e. DMA Release, DMA Initialize, Free TDs etc. is there any problem in using CyDmaTdSetConfiguration to change a configuration later?

       

      AN84810 Advanced DMA topics Indexed DMA seems too complex for adopting to the above situation. Also, I didn't use the option for preserveTDs when channel enabling.