Question
Using DMA in Circular mode does not update the data array
Posted on July 25, 2016 at 16:41
Hi guys,
I'm working on STM32F746-Discovery and I'm trying to read through DMA the digital microphone. I would like to save in a circular buffer the readed data, so that I can process it using DSP. The code is pretty simple and I started from the Audio Record and Playback application provided by ST. Firstly I define the buffer array of size 4096uint16_t audioBuffer[AUDIO_BUFFER_SIZE];
Then inside the ''main function'' I start the recording process
BSP_AUDIO_IN_Init(INPUT_DEVICE_DIGITAL_MICROPHONE_2, 100, DEFAULT_AUDIO_IN_FREQ);
BSP_AUDIO_IN_Record(&audioBuffer[0], AUDIO_BUFFER_SIZE);
Then I'm just checking the array everytime the DMA transfer finish callback is called
void
BSP_AUDIO_IN_TransferComplete_CallBack(
void
)
{
uint32_t index;
for
(index=1000;index<1020;index++)
printf
(
''%d ''
, audioBuffer[index]);
printf
(
''\r\n''
);
}
I obtain the same sequence outputted every half second more or less (maybe a quarter of second). Why the array is not updated? The rest of the code is exactly the same from the demo application.
Thanks in advance
#cache-coherence #adc #dma #discovery #stm32f7 #board #cache