AnsweredAssumed Answered

STM32F7 SAI/I2S slave issue?

Question asked by lenham.steve on Mar 9, 2016
Latest reply on Mar 15, 2016 by lenham.steve
Hi,

I am working on an application that streams audio from a WAV file on SD card. The core of the code is a hugely simplified version of the "audio playback and record" application from the Cube package. Audio output is via SAI1_B, running as a slave transmitter at 96kHz.

The SAI is set up for standard I2S with a 64-bit frame, two 32-bit slots. HAL data size is set to 16_BITEXTENDED (i.e. 16-bit data in a 32-bit slot).

In a nutshell, it doesn't quite work. The audio appears on the left output channel at half-speed while the right channel outputs noise. Examining the datastream clearly shows that 16-bit data is appearing in the slot for the left channel (with the remainder of the slot all zeroes, as it should be) but that the 32 bits of the right channel slot are either all high or all low.

So the device does not seem to be responding to the frame sync correctly; it is ignoring the second edge that marks the channel change. I have used the debugger to go through the config registers in fine detail and really cannot see anything incorrect.

I have read that there is a problem with I2S slave operation on some earlier STM32 devices. Is this still the case with the F7? The F7 errata refers to an issue with short frame sync pulses, but that does not seem to apply to standard I2S.

Has anyone else encountered this issue? Is there anything that I could be missing that might explain what I am observing?

Thanks for any insight.

Steve

Outcomes