2025-07-19 2:26 AM - edited 2025-07-19 2:27 AM
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).
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
To establish an internal audio path on the SGTL5000:
without using I²S (just internal routing).
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.
I²C wasn’t functional until I enabled MCLK from STM32 SAI block.
Even when MCLK output was selected in CubeMX, it wasn’t enabled in generated code.
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.
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
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
Is MCLK enough? Does SGTL5000 require LRCLK/SCLK to be present even for internal ADC→DAC path?
Should SGTL5000’s internal DAC clocking work standalone with just MCLK?
Is it valid to use STM32 SAI just for MCLK-only operation?
Am I missing any mandatory SGTL register setups (e.g. DAC volume, headphone mute, etc.)?
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.
Any suggestions, working examples, or guidance would be greatly appreciated!
Thanks
—
Umair Jarullah.
Project: STM32WB55 + SGTL5000 codec loopback test (mic → HP)