cancel
Showing results for 
Search instead for 
Did you mean: 

DMA not resuming after stopping

L42Liam
Associate

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.

L42Liam_1-1742062985097.png

L42Liam_3-1742063084487.png

L42Liam_1-1742063249226.png

 

 

1 REPLY 1
AScha.3
Chief III

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 ?

If you feel a post has answered your question, please click "Accept as Solution".