2017-08-01 02:53 PM
I'm trying to configure my STM32F7xx device to DMA stereo audio samples from RAM (SampleBuffer1[] and SampleBuffer2[]) to the SAI using the Double Buffer mode of the DMA controller. However, I can't seem to find any sample code for setting this up. Is there any demo code with this specific configuration? I have found lots of sample code for much simpler configurations, but it does me little good.
#double-buffer-dma2017-08-01 03:15 PM
Take the single-buffer case, fill in the other memory-side address register, set the double-buffer bit in CR, and that's all.
JW
2017-08-02 04:31 AM
Wow, golly gee, why didn't I think of that! If this is so trivial, would you mind providing tested code? Here's the configuration:
SAI1A master using DMA with interrupt at completion
I2S standard protocol
48K/16bit audio samples
Sample Buffers contain 320 stereo samples each.
Please show both configuration of the SAI and DMA, as well as the DMA trigger statement.
Thanks for providing such a well thought out, comprehensive answer.