AnsweredAssumed Answered

stm32F4Discovery audio codec problem

Question asked by doronin.michael on Jul 19, 2012
Latest reply on May 13, 2014 by sugny.francois
Hi, I'm trying to play audio from flash, using your stm32f4_discovery_audio_codec and audio_sample.c from project examples that comes with this board.

Here is my code

int main(void)
{
    HardwareInit();
 
/*
    xTaskCreate( vTaskLED1, ( signed char * ) "LED1", configMINIMAL_STACK_SIZE, NULL, 2,
                            ( xTaskHandle * ) NULL);
                            */
    xTaskCreate( vTaskLED2, ( signed char * ) "LED2", configMINIMAL_STACK_SIZE, NULL, 2,
                            ( xTaskHandle * ) NULL);
 
//  GPIO_SetBits(GPIOD, GPIO_Pin_12 | GPIO_Pin_13);
    EVAL_AUDIO_Play((uint16_t*)((uint16_t*) (&AUDIO_SAMPLE+58)),  990000-58);
 
    vTaskStartScheduler();
    for (;;);
 
}
I've taken audio sample from expample and changed it's to header file, otherwise it CoIDE couldn't compile it.
EVAL_AUDIO_SetAudioInterface(AUDIO_INTERFACE_I2S);
if (EVAL_AUDIO_Init(OUTPUT_DEVICE_AUTO, 50, 8000) == 0) {
    GPIO_SetBits(GPIOD, GPIO_Pin_12);
}
This what I am doing in HardwareInit(); function.
Green led is lightning (which means that codec initialization became without errors), but I don't hear anything in my headphones.

Example project is working though.
Please, help me.

Outcomes