cancel
Showing results for 
Search instead for 
Did you mean: 

STM32WB55 + SGTL5000: No Audio Output Unless Analog Test Mode Enabled (SAI MCLK + I2C Setup)

imium
Associate II

Hello ST Community,

I’m currently testing an SGTL5000 audio codec with the STM32WB55 Nucleo board, and I’ve run into an issue where audio only works when analog test mode is enabled. I’m using the Hathor SGTL5000 audio breakout board from PCBWay (project link).

System Configuration

  • STM32WB55 Nucleo-Board

  • STM32CubeIDE Version: 1.18.1

  • STM32CubeMX Version: 6.14.1

  • SGTL5000 Board: Hathor Breakout (PCBWay project)

  • Connections to SGTL5000:

    • VDDIO, VDDA, VDDD = 1.8V (external LDO)

    • I²C only, pulled up with 4.7 kΩ

    • MCLK = 12 MHz from STM32WB55 via SAI

    • No SCLK, LRCLK, or I²S DIN/DOUT connected

  • Mic connected to MIC_L; HP_L/R used for headphone output


Goal

To establish an internal audio path on the SGTL5000:

MIC → ADC → DAP (optional) → DAC → Headphones

without using I²S (just internal routing).


Problem

  • SGTL5000 only outputs audio when analog test mode is enabled

    CHIP_ANA_TEST1.TESTMODE = 1;
    CHIP_ANA_TEST1.TM_SELECT_MIC = 1;
    CHIP_ANA_TEST1.TM_ADCIN_TOHP = 1;
    CHIP_ANA_TEST1.HP_HOLD_GND = 0;
    CHIP_ANA_TEST1.HP_HOLD_GND_CENTER = 0;
    CHIP_ANA_TEST1.HP_CLASSAB = 1;
    CHIP_ANA_TEST1.HP_I1_ADJ = 2;
    CHIP_ANA_TEST1.HP_IALL_ADJ = 2;
    CHIP_ANA_TEST1.VAG_CLASSA = 0;
    CHIP_ANA_TEST1.VAG_DOUB_CURRENT = 0;​
  • If I disable analog test mode and try internal signal path with DAP/DAC, I get no audio at all.


Observations

  1. I²C wasn’t functional until I enabled MCLK from STM32 SAI block.

  2. Even when MCLK output was selected in CubeMX, it wasn’t enabled in generated code.

  3. I had to manually enable MCLK in MX_SAI1_Init() like this:

hsai_BlockA1.Init.MckOutput = SAI_xCR1_MCKEN;
  • Once MCLK started, I²C communication with SGTL5000 worked fine.

  • Analog test mode gives audible output, confirming that power, mic, and HP output are functional.


What Works

  • MCLK generation from SAI (12 MHz)

  • I²C communication

  • Analog path (mic → headphone) works when analog test mode is enabled

  • Verified power rails at 1.8 V


What’s Not Working

  • Internal SGTL5000 path (ADC → DAC) produces no audio

  • DAP mixer enable/disable doesn’t help

  • Normal SSS/DAP/ANA_CTRL path silent when analog test mode is off


Questions

  1. Is MCLK enough? Does SGTL5000 require LRCLK/SCLK to be present even for internal ADC→DAC path?

  2. Should SGTL5000’s internal DAC clocking work standalone with just MCLK?

  3. Is it valid to use STM32 SAI just for MCLK-only operation?

  4. Am I missing any mandatory SGTL register setups (e.g. DAC volume, headphone mute, etc.)?


Extra Info

  • Breakout board used: Hathor SGTL5000 for ESP32

  • Issue already posted on NXP Community, but no response yet.

  • SGTL5000 registers all respond correctly via I²C.

  • All analog power sections appear functional.

  • Attached Project Archive.

Any suggestions, working examples, or guidance would be greatly appreciated!
Thanks


Umair Jarullah.
Project: STM32WB55 + SGTL5000 codec loopback test (mic → HP)

0 REPLIES 0