AnsweredAssumed Answered

K(60) DMA arbitration and pre-emption

Question asked by comsosysarch on Feb 27, 2012
Latest reply on Mar 5, 2012 by comsosysarch

I am seeing "slips" or missed samples when sampling an external audio ADC using the I2S via DMA with continuously looping scatter-gather.

 

There could be a number of reasons this is occurring but what I am wondering here is if there is something with channel priority / arbitration / pre-emption that I am not doing the best way which could be causing my problem.

Currently I have the channel priority at the defaults (priority equal to channel number), my channel in question is channel 15 (highest priority), the DMA is left on fixed (not round robin) arbitration.

 

According to the channel priority register channel 15 (or any other) *can* pre-empt lower-priority channels which seems to be the default.

 

According to the channel priority register *no* channel can *be* pre-empted by higher-priority channels which also seems to be the default.

Depending on the details of how DMA channel arbitration works (ie is it per-peripheral-hardware-request, per TCD block access, or when exactly)... it may be that activity on lower priority DMA channels is causing the highest priority channel to stall waiting for some minor or major cycle completion, since the lower priority channels may not be pre-empted by the higher priority channel?


Might this be true? If so, what is the effect on the lower priority
channel(s) if I enable pre-emption? Do they suspend and then resume
where they left off when the higher priority channel is done (and is
this when the single transfer is done or when the minor/major loop is
done)?

I do believe what I am seeing is more than just a one-transfer (one
external ADC sample) "slip" but I do have several other lower-priority DMA
activity going on some of which uses iteration counts which are fairly
lengthy.

Outcomes