cancel
Showing results for 
Search instead for 
Did you mean: 

DMA: last written buffer position?

PRenn.1
Associate III

DMA buffer 32 words, ADS converts 4 channels in scan mode.
So every 8 ADC-starts  DMA will start at buffer[0]  (circular buffer is ticked).
CubeIDE HAL is being used.

How do I find out / look up  the buffer offset most recently written to?

2 REPLIES 2
MasterT
Lead

Look into DMA registers, there is a counter

If you use DMA and the callbacks (for Half or Full) - you should know where you are (which buffer was filled recently).

Yes, you might be able to read back also DMA registers (e.g. address pointer). Easier is to use callbacks, double buffering and knowing when DMA INT comes which buffer was (completely) written...