Skip to main content
Graduate
October 25, 2024
Question

example with analog microphone crashes on STM32F412G-Discovery

  • October 25, 2024
  • 1 reply
  • 1292 views

Hello, 

I'm trying to do a quick test with the STM32F412G-Discovery kit and the analogue microphone input.
I use this example https://github.com/STMicroelectronics/STM32CubeF4/tree/master/Projects/STM32F412G-Discovery/Examples/BSP

with the menu #### AUDIO REC ANALOG ####.

The problem is that the firmware crashes at the line BSP_AUDIO_IN_Record(internal_buffer, AUDIO_BLOCK_SIZE);

 

void AudioRecAnalog_demo (void)
{
 AudioRec_SetHint();

 /* Initialize Audio Recorder */
 if (BSP_AUDIO_IN_InitEx(INPUT_DEVICE_ANALOG_MIC, DEFAULT_AUDIO_IN_FREQ, DEFAULT_AUDIO_IN_BIT_RESOLUTION, DEFAULT_AUDIO_IN_CHANNEL_NBR) == AUDIO_OK)
 {
 BSP_LCD_SetBackColor(LCD_COLOR_WHITE);
 BSP_LCD_SetTextColor(LCD_COLOR_GREEN);
 BSP_LCD_DisplayStringAt(0, BSP_LCD_GetYSize() - 95, (uint8_t *)" AUDIO RECORD INIT OK ", CENTER_MODE);
 }
 else
 {
 BSP_LCD_SetBackColor(LCD_COLOR_WHITE);
 BSP_LCD_SetTextColor(LCD_COLOR_RED);
 BSP_LCD_DisplayStringAt(0, BSP_LCD_GetYSize() - 95, (uint8_t *)" AUDIO RECORD INIT FAIL", CENTER_MODE);
 BSP_LCD_DisplayStringAt(0, BSP_LCD_GetYSize() - 80, (uint8_t *)" Try to reset board ", CENTER_MODE);
 }

 audio_rec_buffer_state = BUFFER_OFFSET_NONE;

 /* Display the state on the screen */
 BSP_LCD_SetBackColor(LCD_COLOR_WHITE);
 BSP_LCD_SetTextColor(LCD_COLOR_BLUE);
 BSP_LCD_DisplayStringAt(0, BSP_LCD_GetYSize() - 80, (uint8_t *)" RECORDING... ", CENTER_MODE);


 /* Start Recording */ crash here
 BSP_AUDIO_IN_Record(internal_buffer, AUDIO_BLOCK_SIZE);

 /* Wait end of one block recording */
 while((audio_rec_buffer_state & BUFFER_OFFSET_FULL) != BUFFER_OFFSET_FULL);

 /* Stop recorder */
 BSP_AUDIO_IN_Stop();

 

Does anyone have an idea?

 

 

    This topic has been closed for replies.

    1 reply

    Technical Moderator
    November 5, 2024

    Hello,

    Internal ticket 195718 for follow up and confirmation of the issue / fix if there is one ..

    Technical Moderator
    November 18, 2024

    FYI,

    Behavior reproduced internally. Analysis is ongoing.