You are here

DMA stops working | Cypress Semiconductor

DMA stops working

Summary: 3 Replies, Latest post by hli on 23 Jul 2013 05:06 AM PDT
Verified Answers: 0
Last post
Log in to post new comments.
tutajsen's picture
7 posts

Hi all!

I'm using DMA to transfer data from an ADC to a buffer. First of all: Everything works and I can work with the buffered Data, but then...

After a time of about 230 seconds the pulse on the 'nrq' output of the DMA component stops and therefore the ISR isn't entered.

The ADC is working with 182250 SPS at 8 bit resolution and I'm saving 50 bytes.

A DMA_release and reinitializing didn't help. The only solution I have so far is reseting the device.

Attached find the TopDesign part of the DMA. I'm meassuring on 'ADC_eoc' to check for the pulse.


The DMA Configuration looks as follows: 

<p>void DMA_ADC_Buffer(void)


#define DMA_ADC_Buffer_BYTES_PER_BURST 1




uint8 DMA_ADC_Buffer_Chan;

uint8 DMA_ADC_Buffer_TD[1];


DMA_ADC_Buffer_TD[0] = CyDmaTdAllocate();

CyDmaTdSetConfiguration(DMA_ADC_Buffer_TD[0], 50, DMA_DISABLE_TD, DMA_ADC_Buffer__TD_TERMOUT_EN | TD_INC_DST_ADR);

CyDmaTdSetAddress(DMA_ADC_Buffer_TD[0], LO16((uint32)Rx_ADC_DEC_SAMP_PTR), LO16((uint32)ADC_Buffer));

CyDmaChSetInitialTd(DMA_ADC_Buffer_Chan, DMA_ADC_Buffer_TD[0]);

CyDmaChEnable(DMA_ADC_Buffer_Chan, 1);




tutajsen's picture
7 posts

 I'm sorry for the layout. The code was supposed to be displayed as code.

And of course many thanks in advance!


tutajsen's picture
7 posts


I found the solution!

I don't know if it's an internal bug with the memory mapping but it seems like it.

After checking every possible source and reading tons of paper about the DMA, I still couldn't find any solution. I couldn't explain why it stopped after 230 seconds and why it stopped at all.

My idea was, that the DMA isn't able to map the destianation address properly and therefore hangs after some time. Maybe it's in the memory nirvana and doesn't find a way out. 

I then tried to change the SPS from the ADC into a by-8-devidable figure. I changed it from 182250 to 182248. And these two little samples solved my problem! Maybe there are more, who experienced a similar problem and didn't know how to fix it.



user_78878863's picture
2553 posts

When you observe this 'stop' condition, does the ADC still generate end-of-conversion pulses?

What do you do in the IRQ handler which gets triggered when the 50 bytes are read? Do you re-start the DMA then? (the DMA configuration doesn't loop the TD to itself, so it will stop after 50 bytes)

Log in to post new comments.