MDF: HAL_MDF_AcqCpltCallback triggered in the middle of recording
Hey there,
I'm currently working on an audio application for the STM32U5A5 (which I'll later port to the STM32N657), using MDF.
The application closely follows the MDF/ADF examples for audio recording found in the U5/N6 Cube firmware packages, with the difference that it does not output the transformed audio signal immediately via SAI, but instead stores it in a large buffer to download it later via the STMCubeProgrammer.
Although the application generally works great, it does not record more than ~2 seconds of audio, even if I increase the size of the storage buffer (e.g., to a size corresponding to 4 seconds of audio recording capacity). No matter how large I set the buffer, the function HAL_MDF_AcqCpltCallback is called approximately 2 seconds after the recording starts. Within the implementation of this function, HAL_MDF_AcqStop_DMA is called to stop the recording.
I would be interested in the criteria according to which the HAL_MDF_AcqCpltCallback function is called. I would have assumed that this happens after the memory buffer is completely full, but that does not seem to be the case in my situation...
For reference, here's my configuration...
...of MDF:


...of GPDMA:

...of the clocks for MDF:

And here's the code to start the recording, from main.c:

(REC_BUFF_SIZE is currently set to 64000 elements, which should be enough for 4 seconds of 16-bit PCM @ 16 kHz).
Any hints or help would be greatly appreciated!
Best regards,
Jens
