AnsweredAssumed Answered

STM32F769I-DISCO: No audio output from wm8994

Question asked by J B on Oct 14, 2017
Latest reply on Feb 26, 2018 by guidi.daniele

With STM32CubeF7 V1.8.0, there is no audio output from the wm8994 audio chip via the 3.5 mm blue audio output jack on the STM32F769I-Discovery board when parameter OUTPUT_DEVICE_HEADPHONE (or alias OUTPUT_DEVICE_HEADPHONE1) is passed to BSP_AUDIO_OUT_Init().


As a result, example SAI_AudioPlay in folder "STM32Cube_FW_F7_V1.8.0\Projects\STM32F769I-Discovery\Examples\SAI\SAI_AudioPlay" does not work.


The problem does not occur with STM32CubeF7 V1.7.0.


In file wm8994.c of STM32CubeF7 V1.8.0 (in folder "STM32Cube_FW_F7_V1.8.0\Drivers\BSP\Components\wm8994"), the following "cold / warm / soft start" code (lines 470 to 496) has been added since V1.7.0 that gets run when OUTPUT_DEVICE_HEADPHONE is passed to BSP_AUDIO_OUT_Init():


    if (output_device == OUTPUT_DEVICE_HEADPHONE)
      /* Select DAC1 (Left) to Left Headphone Output PGA (HPOUT1LVOL) path */
      counter += CODEC_IO_Write(DeviceAddr, 0x2D, 0x0100);
      /* Select DAC1 (Right) to Right Headphone Output PGA (HPOUT1RVOL) path */
      counter += CODEC_IO_Write(DeviceAddr, 0x2E, 0x0100);    
      /* Startup sequence for Headphone */
        counter += CODEC_IO_Write(DeviceAddr,0x110,0x8100);
        /* Add Delay */
      else /* Headphone Warm Start-Up */
        counter += CODEC_IO_Write(DeviceAddr,0x110,0x8108);
        /* Add Delay */


      /* Soft un-Mute the AIF1 Timeslot 0 DAC1 path L&R */
      counter += CODEC_IO_Write(DeviceAddr, 0x420, 0x0000);

This code gets run INSTEAD of this existing output configuration code that starts:

      /* Analog Output Configuration */



Solution: I've found that increasing the first delay in the new code from 300 to 350 (i.e. AUDIO_IO_Delay(350)) solves the problem. I've not investigated why this works or whether it is a complete solution.


A workaround, that doesn't involve editing wm8994.c, is to call BSP_AUDIO_OUT_Init() twice.


*** Moderator: Please pass this information to the relevant (STM32CubeF7) personnel. ***




#Bug in wm8994.c in STM32CubeF7 V1.8.0 re audio output.