DMA - Dynamically Changing TD properties using CyDmaTdSetConfiguration

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
NiVa_4337911
Level 3
Level 3
First like received

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, 1, DmaTd[i+1], DMA1__TD_TERMOUT_EN);

    }

    CyDmaTdSetConfiguration(rfDmaTd, 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.

0 Likes
1 Solution

Thanks for the reply, but it started working. I have to use the option to preserve TDs, probably there may be a better way of doing this.

View solution in original post

0 Likes
2 Replies
lock attach
Attachments are accessible only for community members.
Hari
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hello NiVa_4337911

I have created a sample project where I am doing something similar. I am loading the bytes from SRAM into the Tx FIFO. Please have a look and let me know if there are any queries.

The reason you are seeing this issue is because the parameter configuration which is the 4th parameter is set as DMA1__TD_TERMOUT_EN in your code. This will prevent the other TDs from executing.


Thanks,
Hari

0 Likes

Thanks for the reply, but it started working. I have to use the option to preserve TDs, probably there may be a better way of doing this.

0 Likes