cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F769I-DISC1 no speaker output via WM8994

JFour.6
Associate

Hi,

I am currently developing with the STM32F769I-DISC1 development kit and get audio output via the CN7 Line Out connector when setting the initialisation to OUTPUT_DEVICE_HEADPHONE in the sample example as below:

 if(0 != audio_drv->Init(AUDIO_I2C_ADDRESS, OUTPUT_DEVICE_HEADPHONE, 40, AUDIO_FREQUENCY_22K))

 {

  Error_Handler();

 }

I need to use the speaker but get no sound out on either SPKR_L or SPKR_R when the output device is changed to either OUTPUT_DEVICE_BOTH or OUTPUT_DEVICE_SPEAKER

I have changed the unmute command from

CODEC_IO_Write(DeviceAddr, 0x36, 0x0300); to CODEC_IO_Write(DeviceAddr, 0x36, 0x0303);

as another help thread recommended but this did not help.

Please advise if there is a solution to this problem.

1 REPLY 1
JFour.6
Associate

I received an answer from ST stating that the folllowing changes should be made in the MX_SAIx_Init() function according to the required channels:

Active Slots:

  1. for headphones --> HSIx.SlotInit.SlotActive = SAI_SLOTACTIVE_0 | SAI_SLOTACTIVE_2
  2. for speaker --> HSIx.SlotInit.SlotActive = SAI_SLOTACTIVE_1 | SAI_SLOTACTIVE_3
  3. for both --> HSIx.SlotInit.SlotActive = SAI_SLOTACTIVE_0 | SAI_SLOTACTIVE_1 | SAI_SLOTACTIVE_2 | SAI_SLOTACTIVE_3

Then you would also need to adjust the FrameLength, ActiveFrameLength and SlotNumber as follow:

  • HSIx.FrameInit.FrameLength = 64;
  • HSIx.FrameInit.ActiveFrameLength = 32;
  • HSIx.SlotInit.SlotNumber = 4;