How to initialize a DMA channel for a circular buffer?

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

How to initialize a DMA channel for a circular buffer?

跳至解决方案
3,778 次查看
dieterfalk
Contributor II

I want to initialize a DMA channel to transfer input capture values (e.g. FTM2_CH0) to a circular destination buffer using the modulo feature. This DMA should run continuously. The buffer will be checked periodically (reading the DADDR register value to determine the current write pointer.

I am not clear about the initialization of the DOFF register and minor-/major loop operation register if I want to use the continuous running DMA with the modulo feature. Can you help me with an example code? Thank you.

标签 (2)
0 项奖励
回复
1 解答
3,167 次查看
dieterfalk
Contributor II

Hello,

thanks for these examples. They mainly show the general use of DMA in different examples. The modulo feature is not used.

In any case I think these example will help me to find a solution for my problem. Therefore I will close this task.

Dieter

在原帖中查看解决方案

0 项奖励
回复
7 回复数
3,166 次查看
rendy
NXP Employee
NXP Employee

Hi,

please try attached example code which should demonstrate using of DMA. Let me know in case of any problems. Project are created with IAR version 7.10, will not work withe lesser version. You can download 30 day trial here: http://supp.iar.com/Download/SW/?item=EWARM-EVAL

Rene

3,168 次查看
dieterfalk
Contributor II

Hello,

thanks for these examples. They mainly show the general use of DMA in different examples. The modulo feature is not used.

In any case I think these example will help me to find a solution for my problem. Therefore I will close this task.

Dieter

0 项奖励
回复
3,166 次查看
timesyssupport
Senior Contributor II

Hello Dieter,

Are you looking to do this in MQX or Linux? Let me know, and I will see if there is any similar code available.

Thanks,

Timesys Support

0 项奖励
回复
3,166 次查看
dieterfalk
Contributor II

Hello,

the code should be independent on any OS.

Dieter

0 项奖励
回复
3,166 次查看
timesyssupport
Senior Contributor II

Hello Dieter,

I have reviewed all Linux driver source for the Vybrid Tower that uses eDMA (serial, dspi, asrc, sound), but unfortunately, none of these use the eDMA modulo feature.  karinavalencia, does the Freescale team have any input about how the DMAx_TCDn_DOFF, DMAx_TCDn_NBYTES*, DMAx_TCDn_BITER*, and DMAx_TCDn_CITER* registers should be configured when using the modulo feature of eDMA (bits 3-7 of DMAx_TCDn_ATTR set)? Dieter, feel free to clarify if this is not what you are looking for.

Thanks,

Timesys Support

3,166 次查看
karina_valencia
NXP Apps Support
NXP Apps Support

rendy can you review  previous update  from Timesys and share your comments?

0 项奖励
回复
3,166 次查看
karina_valencia
NXP Apps Support
NXP Apps Support

timesyssupport can you help with this case?

0 项奖励
回复