I have some problem with the output of my DAC and I hope you have some idea, what went wrong...
I am trying to play a WAV audio file with the DAC of my STM32F407VET. I use a double buffer, the DMA and I trigger the DAC with a Timer which has the frequency of the ~SampleRate of the track.
SDIO (µSD Card),
DAC with output buffer (CubeMX),
Timer to trigger DAC,
DMA (double buffer to DAC),
DMA Callback Functions for "Half/Full Transfer Completed" to notify the free buffer part
I can play the WAV file and the quality of the 12Bit output is "ok", but there is always a droning in the sound - some audible frequency which shouldn't be there. As I found out I can change the frequency of the droning by changing the size of my buffer. Smaller buffer => higher frequency...
I attach the schematic of my board and some of the code. I really hope you experts can find my bug...
Ps.: I had to change the HAL_DAC_Start_DMA for double buffering.