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.

HSP demo - Clock problems

Other Parts Discussed in Thread: CC2564, TLV320AIC3100
 While debugging tests with the HeadSet Demo profile I've tried to look at the
AUD_CLK and AUD_FSYNC signals (with a scope) and couldn't see anything (no clock signal),
The cc2654 which is supposed to be the master is not producing the clocks as expected. 
I would love some help resoling this issue.
 
thank you very much.
Yuri.
  • Yuri,

    The HSPDemo included in the CC256XSTBTBLESW is for out of box demo purposes on the CC2564 (QFN or module) EM + CC256xEM-STADAPT + STM3240G-EVAL HW configuration. 

    In this demo, the I2S interface is being initialized in the initializeAudio function of the AUDIO.c. This function is only called from the application (HSPDemo.c) when the demo in Headset mode is connected to a phone and the etHDSET_Audio_Connection_Indication event occurs in the HDSET_Event_Callback function of the HSPDemo.c. Meaning that the I2S is only initialized when the phone is answering/receiving a call and the audio is needed. So, you will only be able to observe the I2S signals on a scope when this happens.

    Moreover, as documented in the HDSET_Event_Callback function, the initializeAudio function is setting the STM32F I2S as master, the CC256X PCM as slave and the DAC CS43L22 as slave. All at 8KHz sample rate. Since the master STM32F will be providing clock signals to the slaves, you might want to probe on the master pins to observe the clock signals in case the HW is not properly set up for the HSPDemo. The HW modifications required on the CC256xEM-STADAPT boards can be found in the Quick Start Guide for this board.

    Best regards,

    Vihang

    Best regards,

    Vihang

  • Hi Vihang!

    All my experiments were conducted with the process you just described, meaning, i have triggered the (HDSET_Event_Callback) with
    the (etHDSET_Audio_Connection_Indication) event. Moreover, i have probed the lines on both the master and the slave to make sure i am not missing anything.

    In order to save time and effort i want to say that this matter was discussed couple of months ago and i have tried all the suggestion from this thread: e2e.ti.com/.../515664

    I hope this helps you to help me :)

    Thank you again for your responses.

    Yuri.
  • Yuri,

    Are you using the CC2564 (QFN or module) EM + CC256xEM-STADAPT + STM3240G-EVAL HW setup? And running the unmodified HSPDemo?

    If no, what changes have you made? If using different HW platform, have you verified the relevant porting regarding the I2S lines on the STM32 since it is the master and it provide the clock to the slaves?

    Best regards,
    Vihang
  • I am running the cc2564 module on my custom board which MCU is STM32L476M.
    The cc2564 is my master and it provides the clocks (and hopfully data in the future) for an audio codec which is connected to him.
    Both the master (cc2564 ) and slave (audiocodec) lines were verified.

    I have made some minimal changes to the code:
    * instead of using the whole ( initializeAudio() ) function i am only using the ( VS_PCM_Codec_Config_Slave_I2S() ) with the relevent parameters.
    * i have added code for initializing my audio codec right after the ( VS_PCM_Codec_Config_Slave_I2S() ) command.

    i can share the code if it helps.

  • Hi Yuri,

    That will help, please share the changed code so that I can get better understanding.

    Also, I would recommend getting the out of box demo working on the STM3240G eval + CC256xEM-STADAPT + CC256x EM first. This is the platform that the demo was tested on. Once this is working with the HSPDemo included in the Bluetooth stack, we can track one change at a time. Otherwise, we are dealing with multiple variables that can cause this problem.

    Best regards,
    Vihang
  • Vihang Hello!

    first to the code, this is the part of the "etHDSET_Audio_Connection_Indication" event,

    As i explained before, i am not using the  "initializeAudio" function since it contains many things i do not need.

    Actually the only thing needed (as i see it) is "VS_PCM_Codec_Config_Slave_I2S", i also tried to use "HCI_VS_Write_CODEC_Config_Enhanced".

    here is the code:

    case etHDSET_Audio_Connection_Indication:
    /* An Audio Connection Indication was received, display the */
    /* relevant information. */
    Display(("HDSET Audio Connection Indication, ID: 0x%04X.\r\n", HDSET_Event_Data->Event_Data.HDSET_Audio_Connection_Indication_Data->HDSETPortID));

    CurrentConnectionState = csAudioConnected;

    /* Initialize the STM32F I2S as master, the CC256X PCM as slave and DAC CS43L22 I2S as slave. all at 8KHz sample rate */
    //(void) initializeAudio(BluetoothStackID, CVSD_FREQUENCY);

    int status;


    // Hold the codec at reset state while configuring the PCM lines
    HAL_GPIO_WritePin(GPIOB, AUD_EN_1V8_Pin, GPIO_PIN_RESET);
    HAL_Delay(1000);



    status = VS_PCM_Codec_Config_Slave_I2S(BluetoothStackID, I2S_CLK_FREQ_IN_FS_8KHZ, CVSD_FREQUENCY);
    status = HCI_VS_Write_CODEC_Config_Enhanced(BluetoothStackID);

    HAL_GPIO_WritePin(GPIOB, AUD_EN_1V8_Pin, GPIO_PIN_SET);
    HAL_Delay(1000);

    //status = VS_Set_Pcm_Loopback(BluetoothStackID,0x01);


    TLV320AIC3100_Init(I2CHandle);
    TLV320AIC3100_SetVolume(220);
    TLV320AIC3100_GenerateBeep(63, 2000, 10000);//

    Regarding the platform, i will look into it and if it will be possible i will let you know that i am trying.

    let me know what you think about the code, is there something missing?

    Thank you,

  • Vihang Hello!



    first to the code, this is the part of the "etHDSET_Audio_Connection_Indication" event,

    As i explained before, i am not using the "initializeAudio" function since it contains many things i do not need.

    Actually the only thing needed (as i see it) is "VS_PCM_Codec_Config_Slave_I2S", i also tried to use "HCI_VS_Write_CODEC_Config_Enhanced".

    here is the code:

    case etHDSET_Audio_Connection_Indication:
    /* An Audio Connection Indication was received, display the */
    /* relevant information. */
    Display(("HDSET Audio Connection Indication, ID: 0x%04X.\r\n", HDSET_Event_Data->Event_Data.HDSET_Audio_Connection_Indication_Data->HDSETPortID));

    CurrentConnectionState = csAudioConnected;

    /* Initialize the STM32F I2S as master, the CC256X PCM as slave and DAC CS43L22 I2S as slave. all at 8KHz sample rate */
    //(void) initializeAudio(BluetoothStackID, CVSD_FREQUENCY);

    int status;


    // Hold the codec at reset state while configuring the PCM lines
    HAL_GPIO_WritePin(GPIOB, AUD_EN_1V8_Pin, GPIO_PIN_RESET);
    HAL_Delay(1000);



    status = VS_PCM_Codec_Config_Slave_I2S(BluetoothStackID, I2S_CLK_FREQ_IN_FS_8KHZ, CVSD_FREQUENCY);
    status = HCI_VS_Write_CODEC_Config_Enhanced(BluetoothStackID);

    HAL_GPIO_WritePin(GPIOB, AUD_EN_1V8_Pin, GPIO_PIN_SET);
    HAL_Delay(1000);

    //status = VS_Set_Pcm_Loopback(BluetoothStackID,0x01);


    TLV320AIC3100_Init(I2CHandle);
    TLV320AIC3100_SetVolume(220);
    TLV320AIC3100_GenerateBeep(63, 2000, 10000);//



    Regarding the platform, i will look into it and if it will be possible i will let you know that i am trying.

    let me know what you think about the code, is there something missing?

    Thank you,
  • Thanks for the code details. I am looking into it.
  • Hi Yuri,

    I do not see anything wrong with the code. if you can compare it in detail with the demo code, you might find if anything is missing.

    BR,
    Vihang
  • Why you use  VS_PCM_Codec_Config_Slave_I2S() if your cc2564 in master mode?

    VS_PCM_Codec_Config_Slave_I2S() - The following function is used to write the codec interface as Slave