Skip to main content
Associate III
Nov 9, 2026 3:38 PM UTC
Question

STM32U5G9J-DK2 X-CUBE-AUDIO Livetune 4 mic setup

Looking to add 4 mics to the most recent X-Cube-Audio release with livetune.

I’m not too familiar with the MDF peripheral but we were able to modify the existing release for the H5 and now are moving to the U5 series. 

I have added the following to stm32_audio.conf.h 

 

// data stream for mics 3 and 4
#define UTIL_AUDIO_MDF_DATA_IN_MIC34_PIN
#define UTIL_AUDIO_MDF_DATA_IN_MIC34_AF GPIO_AF6_MDF1
#define UTIL_AUDIO_MDF_DATA_IN_MIC34_ENABLE() __HAL_RCC_GPIOC_CLK_ENABLE()
#define UTIL_AUDIO_MDF_DATA_IN_MIC34_PIN GPIO_PIN_0
#define UTIL_AUDIO_MDF_DATA_IN_MIC34_PORT GPIOC
#define UTIL_AUDIO_MDF_INSTANCE0                MDF1_Filter0
#define UTIL_AUDIO_MDF_INSTANCE1 MDF1_Filter1
#define UTIL_AUDIO_MDF_INSTANCE2 MDF1_Filter2
#define UTIL_AUDIO_MDF_INSTANCE3 MDF1_Filter3

#define UTIL_AUDIO_MDF_OUTPUT_CLOCK_PIN MDF_OUTPUT_CLOCK_0
#define UTIL_AUDIO_MDF_MAX_CH_NB 4U
#define UTIL_AUDIO_DMA_USED
#define UTIL_AUDIO_MDF_INSTANCE MDF1_Filter0
#define UTIL_AUDIO_MDF_INSTANCE1 MDF1_Filter2
#define UTIL_AUDIO_MDF_CLK_ENABLE() __HAL_RCC_MDF1_CLK_ENABLE()
#define UTIL_AUDIO_MDF_CLK_DISABLE() __HAL_RCC_MDF1_CLK_DISABLE()

Also added define UTIL_AUDIO_MDF_DATA_IN_MIC34_PIN which should allow this code to be compiled in the stm32_audio_mdf.c file.
 

  #ifdef UTIL_AUDIO_MDF_DATA_IN_MIC34_PIN
UTIL_AUDIO_MDF_DATA_IN_MIC34_ENABLE();
gpio_init_structure.Pin = UTIL_AUDIO_MDF_DATA_IN_MIC34_PIN;
gpio_init_structure.Alternate = UTIL_AUDIO_MDF_DATA_IN_MIC34_AF;
HAL_GPIO_Init(UTIL_AUDIO_MDF_DATA_IN_MIC34_PORT, &gpio_init_structure);
#endif

Pretty sure I am missing something. I can see if the code where it defines mic arrays etc but not following the logic to enabling such functions. 

 

STM32U5-DK2 + 4 MICs + MDF + livetune

 

thanks

4 replies

Chloe Meunier
ST Employee
Nov 19, 2026 9:07 AM UTC

Hello,

 

Sorry for delay. Do you still need help about this subject?

Did you update the file acSdkAudioSetup.c to add a new audio configuration with “ .audioInCh = 4U,”?

 

BR

Chloé

mantwihAuthor
Associate III
Nov 19, 2026 2:02 PM UTC

Hi Chloé,

Yes please still need a little bit of guidance on this. We missed changing the .audioInCh to 4U. 

Any other configuration we need to adjust that you can think of?

Thanks

Chloe Meunier
ST Employee
Nov 19, 2026 2:07 PM UTC

Hello,

 

I think it should work with this modification.

 

BR

Chloé

mantwihAuthor
Associate III
Nov 19, 2026 2:03 PM UTC

.audioOutCh and .audioInHwCh would need to equal 4U as well correct?