- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Solved! Go to Solution.
- Labels:
-
PSoC 5LP
- Tags:
- dma
- dynamic td
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.