How stop and restart DMA?

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

cross mob
RoBO_1287886
Level 4
Level 4
First solution authored 25 replies posted 10 replies posted
 

Dear all,

We are using DMA for our project. The DMA works well after the power up of the board. We have the expected behavior.

Currently we are not able to stop and restart correctly the DMAs.

We have a start / stop functions, it seems works. However all "restart" of the DMA seems don't begin with the TD0. The DMA seems starts with another TD (may be the latest used).

179388.png

How we can force to use the TD0 when we restart DMA?

 

regards,

Robin.

0 Likes
1 Solution
BragadeeshV
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hi @RoBO_1287886 ,

I believe that you are terminating the DMA Channel either using the terminate HW signal or by calling CyDmaChDisable() API. To restart the channel, you should be calling the CyDmaChEnable() API. However, this API will not reset the TD pointer to TD[0] and the execution will start from the TD where it left. To restart the DMA channel from TD[0], you need to call CyDmaChSetInitialTd() and set the initial TD to TD[0]. This will restart the DMA channel from TD[0].

Example Snippet:

if(event)

{

       //Terminate DMA 

     //Perform additional actions

     CyDmaChSetInitialTd(DMA_Chan, DMA_TD[0]); //This resets the TD to TD[0]
     CyDmaChEnable(DMA_Chan,1); // Restart the channel 

}

Let us know if this works at your end.

Regards,
Bragadeesh

View solution in original post

1 Reply