Announcements
IMPORTANT: Cypress Developer Community is transitioning on October 20th. To learn more and be prepared for this change, check out our latest announcement.
cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 5, 3 & 1 MCU

RoBO_1287886
New Contributor II
 

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

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
BragadeeshV
Moderator
Moderator

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