Quantcast
Channel: Processors forum - Recent Threads
Viewing all articles
Browse latest Browse all 17527

Polling for EDMA completion

$
0
0

Hi,

 

I've an application which uses interrupts to set flags when DMA transfers are done. For some reason the dramatically slows down my code and since the CPU is polling waiting for the flags to be set, I figured I could just as well poll for the IPR bit to get set and disable interrupts for the DMA.

Although the code is almost the same, polling does not work and causes the application to run incorrect. Condensed code is attached.

(Please visit the site to view this file)

I've two transfers going at a time. One transfer collects samples from the McASP and buffers them. When the buffer is full the main processing loop is notified. The main processing loop is always done long before the McASP buffer is full, so it waits for the 'stream_buffer_index' flag to be set.

The second transfer is a pingpong structure to fetch buffers from/to DDR because they don't fit in L1 at once. This sub-loop has also always finished processing when the 'buffers_transfered' flag is set.

When I replace the poll loops, with loops that poll on IPR, which AFAIK should not influence the working of the app, audio gets distorted. Of course I disable the corresponding interrupts by clearing IER.What could go wrong when I poll IPR directly?

Thanks in advance.

Kind regards,

Remco Poelstra


Viewing all articles
Browse latest Browse all 17527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>