AnsweredAssumed Answered

STM32 I2S Transmit Slave DMA issue

Question asked by Phil Quinton on Sep 23, 2014
Latest reply on Sep 24, 2014 by waclawek.jan
Hi,

I'm currently running a STM32F4 Discovery board, connected to a AD1938 Codec. The STM32 is running as I2S Transmit Slave, with the clocks for WS(LRCLK) and BCLK coming from the AD1938. The STM32F4 is using the USB Audio device driver stack from CubeMX 1.3.0.

I originally attempted to send audio packets, from the USB stack, to the Codec via interrupt driven I2S and found that I continually got buffer underrun interrupts. I decided to attempt DMA ( Circular, No FIFO ).

The issue ( don't laugh ) is that I don't get any DMA errors under deliberate fault conditions.

For instance, I flash an LED when I get DMA half and full transfer complete interrupts. If I pull the power from the AD1938 Codec, the clocks from the codec to the STM32 stop. I expected a DMA buffer underrun. All that happens is the half/full interrupts "stop". As soon as I reconnect the power to the codec, the half/full interrupts start again.

My assumption is that the way the I2S/SPI and DMA peripheral communicates is based on the clocking coming into the I2S module. When the clocks to the I2S stop, the I2S module never requests any more data from the DMA. The DMA just waits until it gets another request from the I2S module. Under this configuration ( I2S TX slave ) I'll never get any errors as nothing is essentially going wrong.

Am I correct, or should I be getting some errors when the clocks stop to the I2S?

Thanks,
Phil.

Outcomes