TAS2110EVM: Unable to play .wav file with STM32U5 + TAS2110EVM (Getting noise/corrupted audio)

Part Number: TAS2110EVM
Other Parts Discussed in Thread: TAS2110

Tool/software:

Hello,

I am trying to play a .wav file using an STM32U5 microcontroller with the TAS2110EVM amplifier board, but I am only getting noise or corrupted audio output.

Hardware Setup:

  • STM32U5 MCU (using SAI peripheral for I²S audio)

  • TAS2110EVM board

  • External 5V / 3A power supply for TAS2110EVM

  • Connected pins:

    • FSYNC, SCLK (SBCK), SDIN → to TAS2110 for I²S

    • SDA, SCL → I²C control interface

  • External speaker connected to TAS2110EVM

  • Checked SDZ pin → voltage is 1.8V (so device seems enabled)

Issue:

  • WAV parsing works fine.

  • TAS2110 initialization (via I²C) is successful.

  • Playback via HAL_SAI_Transmit_DMA() produces only noise/corrupted audio instead of the WAV file.

SAI Configuration:

hsai_BlockA1.Instance = SAI1_Block_A;
hsai_BlockA1.Init.AudioMode = SAI_MODEMASTER_TX;
hsai_BlockA1.Init.Synchro = SAI_ASYNCHRONOUS;
hsai_BlockA1.Init.Protocol = SAI_FREE_PROTOCOL;
hsai_BlockA1.Init.DataSize = SAI_DATASIZE_16; 
hsai_BlockA1.Init.FirstBit = SAI_FIRSTBIT_MSB; 
hsai_BlockA1.Init.ClockStrobing = SAI_CLOCKSTROBING_FALLINGEDGE; 
hsai_BlockA1.Init.OutputDrive = SAI_OUTPUTDRIVE_ENABLE;
hsai_BlockA1.Init.NoDivider = SAI_MASTERDIVIDER_ENABLE;
hsai_BlockA1.Init.FIFOThreshold = SAI_FIFOTHRESHOLD_1QF;
hsai_BlockA1.Init.AudioFrequency = SAI_AUDIO_FREQUENCY_44K;
hsai_BlockA1.Init.SynchroExt = SAI_SYNCEXT_DISABLE;
hsai_BlockA1.Init.MckOutput = SAI_MCK_OUTPUT_DISABLE;
hsai_BlockA1.Init.MonoStereoMode = SAI_MONOMODE;
hsai_BlockA1.Init.CompandingMode = SAI_NOCOMPANDING;
hsai_BlockA1.Init.TriState = SAI_OUTPUT_NOTRELEASED;

Example code:

if (tas2110_init(&tas_data) != 0) {
HAL_UART_Transmit(&huart1, (uint8_t*)"TAS2110 Init Failed\n", 20, 100);
Error_Handler();
}
tas2110_set_samplerate(&tas_data, wav_info.sample_rate);
tas2110_set_bitwidth(&tas_data, wav_info.bits_per_sample);
tas2110_set_dai_fmt(&tas_data, 0x0020);
tas2110_set_dai_tdm_slot(&tas_data, 1, 0, 1, wav_info.bits_per_sample);
tas2110_set_volume(&tas_data, 84);
TAS2110_ReadDVC(&tas_data);
tas2110_power_on(&tas_data);
tas2110_mute(&tas_data, false);

// Test tone
for (int i = 0; i < AUDIO_BUFFER_SIZE; i++) {
audio_buffer[i] = (int16_t)(3276 * sinf(2 * M_PI * 1000 * i / 44100.0f)); // Low amplitude
}
HAL_SAI_Transmit_DMA(&hsai_BlockA1, (uint8_t*)audio_buffer, AUDIO_BUFFER_SIZE);

Question:

  • Is there any specific I²S format requirement for TAS2110 (e.g., word length / frame sync polarity / slot config)?

  • Do I need to use MCLK along with BCLK/LRCLK/SDIN, or can TAS2110 derive clock internally?

  • Could this be related to mono vs stereo configuration?

Any guidance on correct I²S + TAS2110 configuration or pointers to a working reference would be very helpful.

Thanks in advance!

  • Hi Jinal,

    • You should set registers 0x06 through 0x09 according to the host processor configuration.
      I2S is usually using RX_OFFSET of 1. You can try changing some other settings such as RX_EDGE and FRAME_START to check if they have any improvement.
    • MCLK is not used, just need to provide BCLK and WCLK.
    • Are you sending data on both channels from the host? On TAS2110 you can select to play the data on either channel or combine them based on RX_SCFG and RX_SLOT_R and RX_SLOT_L

    Best regards,
    -Ivan Salazar
    Applications Engineer

  • Hi Ivan,
    Thanks for response.
    I have already configured registers 0x06 through 0x09 according to the host processor setup.


    My register write sequence is as follows:
    tas_write_reg(tas2110_data_t *tas, uint8_t page, uint8_t reg, uint8_t val) {
    uint8_t buf[2];

    // Set page
    buf[0] = 0x00; //TAS2110_PAGE_CTRL;
    buf[1] = page;
    HAL_I2C_Master_Transmit(tas->hi2c, tas->dev_addr, buf, sizeof(buf), HAL_MAX_DELAY);

    // Write register value
    buf[0] = reg;
    buf[1] = val;
    HAL_I2C_Master_Transmit(tas->hi2c, tas->dev_addr, buf, sizeof(buf), HAL_MAX_DELAY);
    }

    My initial configuration looks like this:
    tas_write_reg(tas, 0, 0x01, 0x01); // Reset
    HAL_Delay(10); // Short delay after reset

    // Set default power to shutdown
    tas_write_reg(tas, 0, 0x02, 0x02);

    // Default TDM / I2S config
    tas_write_reg(tas, 0, 0x06, 0x09);
    tas_write_reg(tas, 0, 0x07, 0x02);
    tas_write_reg(tas, 0, 0x03, 0x20);

    I am currently sending mono audio data from the host.
    Could you please suggest if I am missing any additional configuration (for RX_OFFSET, RX_EDGE, FRAME_START, or channel routing using RX_SCFG, RX_SLOT_R, RX_SLOT_L)?

    Thanks,
    Jinal