K26 multi channel DMA issue

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

K26 multi channel DMA issue

650 次查看
aescov
Contributor I

I have a setup using using 4 DMA channel for SAI RX/TX and SPI RX/TX.

SAI DMA is running in circular mode ( 10 chained tcd's) , and the for SPI DMA is handling data transaction of fixed specified length, writing data to external memory. (Single tcd)

Both DMA setups run perfectly if the running alone. And when operating in a synchronous setup where data received from SAI is written to SPI immediately after SAI DMA has finished a tcd, the system seems to operate fine.

But when SPI transaction are started asynchronous to the SAI part, i see that the ERQ bit of the channel handling SPI TX often gets cleared and the SPI DMA stalls. 

I have tried using different DMA channel, but so far it is always the ERQ bit of the SPI TX channel that gets cleared. 

When the DMA stalls i can break my system and set the relevant bit in the ERQ register and the system is able to continue operation for a short time before failing again. I see no errors reported in the DMA status registers.

I have set breakpoint in all parts of the code accessing the ERQ bits ( ERG/SERQ/CERG registers), but none of these are triggered when failing..

Any suggestions will be appreciated.

/Anders

标记 (5)
0 项奖励
2 回复数

526 次查看
jingpan
NXP TechSupport
NXP TechSupport

Hi Anders,


As I know, ERQ bits will not change automaticlly, it must be changed by software or reset. If you can't find how this bit get changed, maybe you can trace it.  For example, KEIL can set data access breakpoint. If you still can't solve the problem, would you mind to show me the corresponding code so that I can take a look?

Regards

Jing

0 项奖励

526 次查看
aescov
Contributor I

Hi Jing

I have tried catching writes to the register, but so far i have not been able to do that..

As decribed, the issue occurs only when SAI DMA is running in i circular mode in parrallel with the SPI DMA transations.

The TCD's are able to clear the ERQ via the TCDn_CSR reg but this should be related to the specific channel.

Br Anders

0 项奖励