This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DRA821U: Failure to initialize audio codec J7200

Part Number: DRA821U
Other Parts Discussed in Thread: DRA821, PCM3168

Hello,
A student who is currently working with a product recently bought from TI (Jacinto 7 + DRA821) is having the following issue:
 
I am currently working with the Jacinto 7 DRA821 and J7200 RTOS SDK v11.01, modifying the MCASP_DeviceLoopback example to enable physical audio input and output. However, I am facing issues initializing the audio codec.
 
 
This are the modifications I've made and the current status of the system:
Base code: Disabled DEVICE_LOOPBACK in audioSample.io.c
Porting: Since J7200-specific codec examples are limited, I am using the J721S2 implementation as a reference for I2C_CodecInit() and Board_pcm3168Config().
 
 
 
The initialization fails at the very first register write attempt within Board_pcm3168Config(). The function returns a status error during the following loop:
for(regCount = 0; regCount < 31; regCount++) {
    boardStatus = Board_pcm3168RegWrite(handle, slaveAddr, pcmConfigs[regCount][0], &(pcmConfigs[regCount][1]));
    if(BOARD_SOK != boardStatus) return boardStatus; // Fails here on regCount 0
}
 
I have tested the system iteratively, both with and without each of these modifications. Regardless of the combination of changes, the result is always the same: "I2C communication failed with codec". This suggests that a fundamental step to activate the I2C bus or power the codec is still missing.
 
  Also I have a concern about the reference Clock, user's guide manual mentions AUDIO_EXT_REFCLK2 as the source for the codec's SCKI. However, in the J7200 code, I only see options for AUDIO_EXT_REFCLK1, and I haven't found a way to switch it for this specific SoC.
 
 
 
image.png
  • Hi,

    Could you please share the complete set of changes you have made in the McASP example (including modifications to mcasp_cfg.c, audioSample_io.c, build flags, and I2C configuration )?

    Regards,
    Karthik

  • Hi Karthik, the following are the complete set of changes:
    Base code: Disabled DEVICE_LOOPBACK in audioSample.io.c
    Porting: Since J7200-specific codec examples are limited, I am using the J721S2 implementation as a reference for I2C_CodecInit() and Board_pcm3168Config().
    I2C Configuration:
        I2C_CODEC_INSTANCE: 1
             I2C_CODEC_SLAVE_ADDRESS: 0x44 (as per the user's guide).
    MCASP Config (mcasp_cfg.h/.c):
        Configured 1 serializer for RX (Serializer 6) and 1 for TX (Serializer 3).
        Set buffer format to Mcasp_BufferFormat_1SER_MULTISLOT_INTERLEAVED.
    IO Expander (audio_evminit.c):
        Set MUX_S0 to HIGH 
        Added MUX_S2 configuration, setting PIN_NUM_3 to LOW. (I am assuming PIN_NUM_3 is correct for S2, as it wasn't explicitly defined).
  • Hi Juan Cortes,
    The MCASP DeviceLoopback example in Processor SDK RTOS is intended for peripheral-level validation of the McASP and UDMA data path. It performs internal loopback and does not provide a complete reference implementation for external codec-based audio playback/record.

    External codec integration (e.g., PCM3168) requires additional board-level configuration such as I2C initialization, clock configuration and proper serializer routing setup.

    For reference, full codec-based audio support is available in the Processor SDK Linux, where the PCM3168 codec driver, McASP machine driver, device tree configuration, and ALSA framework are already integrated.

    Please refer to the Linux Audio documentation here:
    https://software-dl.ti.com/jacinto7/esd/processor-sdk-linux-jacinto7/latest/exports/docs/linux/Foundational_Components/Kernel/Kernel_Drivers/Audio.html

    Regards,

    Karthik