DMA re-enable question

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

DMA re-enable question

Jump to solution
1,257 Views
mtenw
Contributor I

Hi all,

I have a question about re-enabling a DMA memory to memory copy on LPC4370.

I have successfully set up the DMA controller to do a one time memory to memory copy using the scatter/gather method (user manual 21.8.5). If I would like to do the copy from the same source address to the destination address again, do I need to program all the same registers again?

If re-programming the registers is not needed, how is the re-enabling DMA transfer achieved?

Please help! Thank you.

Labels (2)
0 Kudos
1 Solution
1,004 Views
jeremyzhou
NXP Employee
NXP Employee

Hi mtenw,

Thanks for your reply.

I'd like to exemplify the register change between the two break points, then you can figure out the root cause of the issue.

2017-05-25_15-46-21.jpg

2017-05-25_15-24-09.jpg

                                                                      Fig 1

2017-05-25_15-24-09.jpg

                                                               Fig 2

Hope it helps.
Have a great day,
TIC

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
6 Replies
1,004 Views
mtenw
Contributor I

Hi jeremyzhou

I figured out the problem, the channel configuration register must be re-initialized.

Thank you for your help.

0 Kudos
1,004 Views
jeremyzhou
NXP Employee
NXP Employee

Hi mtenw,

Thank you for your interest in NXP Semiconductor products and the opportunity to serve you.

I'd highly recommend you to create a sort of function which includes some parameters to setup the Scatter/gather mode and call this function every time to utilize the feature.

Hope this helps.
Have a great day,
TIC

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
1,004 Views
mtenw
Contributor I

Thank you for the quick response.

I do have a function to set up the scatter/gather mode, and another function to start the DMA transfer. My question is if the destination and source address is the same, saving the time of setting up DMA is beneficial. Can I just call "setup" once, then call "start" for the subsequent transfers?

Your answer suggests calling "setup" and "start" every time is necessary. Is there any way to save the "setup" time for the subsequent transfers?

Thank you.

0 Kudos
1,004 Views
jeremyzhou
NXP Employee
NXP Employee

Hi mtenw,

Thanks for your reply.

Recalling the function is the safest way, however I think your idea is feasibly.

I was wondering if you can share the demo code and let me to do some investigations.
Have a great day,
TIC

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
1,004 Views
mtenw
Contributor I

Please refer to the .c file. The first DMA transfer is successful. But without calling the "init" function again, the second one DMA transfer failed.

Also, can you share the demo code in main() to check if DMA transfer is completed? Can we assume the transfer is completed right after dma_start() in the .c file?

Thank you for you help.

0 Kudos
1,005 Views
jeremyzhou
NXP Employee
NXP Employee

Hi mtenw,

Thanks for your reply.

I'd like to exemplify the register change between the two break points, then you can figure out the root cause of the issue.

2017-05-25_15-46-21.jpg

2017-05-25_15-24-09.jpg

                                                                      Fig 1

2017-05-25_15-24-09.jpg

                                                               Fig 2

Hope it helps.
Have a great day,
TIC

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos