DMA re-enable question

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

DMA re-enable question

跳至解决方案
2,361 次查看
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.

标签 (2)
0 项奖励
回复
1 解答
2,108 次查看
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 项奖励
回复
6 回复数
2,108 次查看
mtenw
Contributor I

Hi jeremyzhou

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

Thank you for your help.

0 项奖励
回复
2,108 次查看
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 项奖励
回复
2,108 次查看
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 项奖励
回复
2,108 次查看
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 项奖励
回复
2,108 次查看
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 项奖励
回复
2,109 次查看
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 项奖励
回复