2025-03-15 11:34 AM
Hello,
I am currently using the Hal library to do send and receive I2S signals over DMA. I am constantly calling the DMA receive and transmit functions, because I cannot figure out how to work it in circular mode. I am struggling because whenever I stop calling the functions, it becomes impossible to resume. Even without calling the stop and resume functions. For example, when I press a button on my device it triggers an interrupt. This immediately stops all audio output from the device, even if the interrupt doesn't do anything. What's even stranger is that when I use it in debug mode, running straight through plays audio just fine, but as soon as I pause it, it stops never to be resumed again.
I've attached screenshots of my while loop, DMA configuration code, and the interrupt handler. I use 2 different I2S1 and 2 for receiving and transmitting, and their DMA config is the same apart from the direction.
2025-03-15 1:48 PM - edited 2025-03-15 1:50 PM
Hi,
the I2S is for an audio stream, so it is intended to be continuous.
So you should use circular DMA, and start the streams just at begin of your program.
I use the H743 for audio player, working fine; but i use the SAI , in I2S mode, this working perfect.
And "pause" is just loading the send buffer with 0x0 (in callbacks) , and not using the receive.
Just let it run...never stop! (btw i use16 KB buffers.)
clear now ?