Skip to main content
Visitor II
April 11, 2022
Question

STM32L552ZE-Q: SAI - I2S, problem on FS signal

  • April 11, 2022
  • 1 reply
  • 952 views

Hi,

I'm using SAI in I2S mode to play stereo wav file. Audio Data is sent to TAS5722l which is a Mono Audio amplifier. My problem is that the FS (Frame Synchronization) signal

stays always at level High. This results in a stereo audio file being played in twice its original duration as each samples from both channels are read by the amplifier.

Bellow is SAI initialilzation generated by CubeMx:

 hsai_BlockA1.Instance = SAI1_Block_A;
 hsai_BlockA1.Init.AudioMode = SAI_MODEMASTER_TX;
 hsai_BlockA1.Init.Synchro = SAI_ASYNCHRONOUS;
 hsai_BlockA1.Init.OutputDrive = SAI_OUTPUTDRIVE_DISABLE;
 hsai_BlockA1.Init.NoDivider = SAI_MASTERDIVIDER_ENABLE;
 hsai_BlockA1.Init.FIFOThreshold = SAI_FIFOTHRESHOLD_EMPTY;
 hsai_BlockA1.Init.AudioFrequency = SAI_AUDIO_FREQUENCY_48K;
 hsai_BlockA1.Init.SynchroExt = SAI_SYNCEXT_DISABLE;
 hsai_BlockA1.Init.MonoStereoMode = SAI_STEREOMODE;
 hsai_BlockA1.Init.CompandingMode = SAI_NOCOMPANDING;
 hsai_BlockA1.Init.TriState = SAI_OUTPUT_NOTRELEASED;
 if (HAL_SAI_InitProtocol(&hsai_BlockA1, SAI_I2S_STANDARD, SAI_PROTOCOL_DATASIZE_32BIT, 2) != HAL_OK)
 {
 Error_Handler();
 }

Thanks in advance for your help

    This topic has been closed for replies.

    1 reply

    Visitor II
    July 6, 2022

    Hi, did you already solve your problem? I have a similar problem like you, I have my stereo wav file and I wanna play it on a stereo audio amplifier, but how can I control the WS(Word Select, left/right channel select) pin? Does WS pin automatically switch between 0 and 1 when every frame is sent?