Just out of curiosity: are you using external memory? Or is the source of your data Flash? (The PSoC5 has 64k RAM, so it cannot fit 2 times 40k)
To your question: probably you did configure the DMA (with CyDmaChEnable()) to reset the TDs when they are finished. Set the second parameter to 0.
But then the target address also doesn't get set. So what you need is a chained, self-modifying DMA config. Add another DMA that transfers the constanst target base address into the TD that needs to be reset.
Probably you need to look into AN84810 (advanced DMA topics): http://www.cypress.com/?rID=82680 , it has a chapter about modifying a DMA dynamically.
Btw: whats your use case? Why the intermediate buffer, and not a direct transfer?
Some useful DMA references -
http://www.cypress.com/?rID=37793 AN52705 Getting Started with DMA
http://www.cypress.com/?rID=82680 AN84810 PSoC® 3 and PSoC 5LP Advanced DMA Topics
http://www.cypress.com/?rID=44335 AN61102 PSoC® 3 and PSoC 5LP - ADC Data Buffering Using DMA
http://video.cypress.com/video-library/search/dma/ Videos on DMA
https://www.youtube.com/results?search_query=dma+psoc Videos on DMA (some overlap)
@hli: Yes i am using extenal memory buffer from where i am transfering 100Bytes of data to each two small buffer and from those two small buffer i am transfering 200bytes to the destination buffer. Similarly i want to transfer 200bytes every time from external memory to intermediate buffer and then to the destination.
I already have tried with these options but it doesn't work.
Just changing the second parameter of CyDmaChEnable() won't work alone. As I wrote - you need a self-modifying DMA configuration.
- DMA must be configured not to reset the configuration after a TD has finished
- first TD transfers data from memory 1 to the buffer, 100 bytes
- second TD transfer 100 bytes from the buffer to memory 2
- third TD sets the destination address of TD1 back to start og buffer
- fourth TD sets source address of TD2 back to start of buffer
- then repeat
- you probably need a counter to somehow count the number of times this loop has repeated - one TD can at most transfer 4095 bytes. The chain needs to end after TD4, and needs to be restarted automatically until it has run 40 times