DMA1 is not working

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

DMA1 is not working

跳至解决方案
1,749 次查看
x_dex
Contributor I

I tried to toggle a pin with the a DMA triggered by a timer. With DMA0 it works properly but if I try to do the same with DMA1 it doesn’t work. DMA0 and 1 have the equal settings. I work with the A5 processor of TWR-VF65GS10 development tower debugged by DS-5 tool. I used the Processor Expert tool to generate the DMA init code.

标签 (2)
0 项奖励
回复
1 解答
1,561 次查看
RossMcLuckie
NXP Employee
NXP Employee

There is a difference in the set up in DMA0 and DMA1 when using the DMA mux, please see the following -

Following are the key differences,

1) During TCD configuration of DMA0, say if channel N(0<=N<=16) of DMA_CH_MUX0 has been used, we are going to program all TCD(N) of DMA0

But for DMA1, since DMA_CH_MUX3 has been used, and say if channel N (0<=N<=16) of DMA_CH_MUX3 has been used, we would be programming TCD(N+16) registers of DMA1

The following piece of code can illustrate it,

if(DMA_CH_MUX_NO == 1 || DMA_CH_MUX_NO ==3) {
channel_num = channel_num + 16;
}


#define DMA_TCD_ADDR  (SPP_DMA20_BASEADDRESS + 0x1000) + (0x20 * channel_num) + ((DMA_NO)*0x80000) ; // DMA_NO is 0 or 1

PROGRAM DMA TCD registers

2) FOR DMA_CH_MUX configuration, programming is tantamount, but for first case we program DMA_CH_MUX0, and for the other case, we program DMA_CH_MUX3

So, to summarize, the cardinal thing to take care,

DMA0 + DMA_CH_MUX0 - Program channel N in DMA_CH_MUX, N in DMA

DMA0 + DMA_CH_MUX1 - Program channel N in DMA_CH_MUX, (N+16) in DMA


DMA1 + DMA_CH_MUX2 - Program channel N in DMA_CH_MUX, N in DMA
DMA1 + DMA_CH_MUX3 - Program channel N in DMA_CH_MUX, (N+16) in DMA

在原帖中查看解决方案

0 项奖励
回复
3 回复数
1,562 次查看
RossMcLuckie
NXP Employee
NXP Employee

There is a difference in the set up in DMA0 and DMA1 when using the DMA mux, please see the following -

Following are the key differences,

1) During TCD configuration of DMA0, say if channel N(0<=N<=16) of DMA_CH_MUX0 has been used, we are going to program all TCD(N) of DMA0

But for DMA1, since DMA_CH_MUX3 has been used, and say if channel N (0<=N<=16) of DMA_CH_MUX3 has been used, we would be programming TCD(N+16) registers of DMA1

The following piece of code can illustrate it,

if(DMA_CH_MUX_NO == 1 || DMA_CH_MUX_NO ==3) {
channel_num = channel_num + 16;
}


#define DMA_TCD_ADDR  (SPP_DMA20_BASEADDRESS + 0x1000) + (0x20 * channel_num) + ((DMA_NO)*0x80000) ; // DMA_NO is 0 or 1

PROGRAM DMA TCD registers

2) FOR DMA_CH_MUX configuration, programming is tantamount, but for first case we program DMA_CH_MUX0, and for the other case, we program DMA_CH_MUX3

So, to summarize, the cardinal thing to take care,

DMA0 + DMA_CH_MUX0 - Program channel N in DMA_CH_MUX, N in DMA

DMA0 + DMA_CH_MUX1 - Program channel N in DMA_CH_MUX, (N+16) in DMA


DMA1 + DMA_CH_MUX2 - Program channel N in DMA_CH_MUX, N in DMA
DMA1 + DMA_CH_MUX3 - Program channel N in DMA_CH_MUX, (N+16) in DMA

0 项奖励
回复
1,561 次查看
timesyssupport
Senior Contributor II

Hello Juergen,

Can you share some more information about the program you are running? Is it built from the MQX 4.0.2 Installer for Linux hosts, or something else? Which settings for DMA0 and 1 are you referring to?

Thanks,

Timesys Support

0 项奖励
回复
1,561 次查看
karina_valencia
NXP Apps Support
NXP Apps Support

timesyssupport can you attend this case?

0 项奖励
回复