Hello,
From the DK schematic, PDM_SAI1_SD2 is connected to the audio connector, thus its feasible on the DK.
On the Designer FW side, you will need to modify to introduce a 4ch sys mic inputs. You can get inspiration from the existing code; here are few guidelines:
- update UTIL_AUDIO_MAX_IN_CH_NB to 4
- Then create an audio config with 4mic to be able to switch to it with the ac audio command in the terminal. This is in the file called stm32_audio_persist_config_setup.c (see example below)
- You will probably need to modify stm32_audio_sai_pdm.c:
- complete the s_gpio_init/s_gpio_deinit with new IOs,
- also get inspiration from the code around UTIL_AUDIO_SAI_PDM_D2_USED but with a SlotActive that match your need. As explain, this code is a trick to work around one of the DK that has no connection on D1 , so 2 microphones only but on D2... here you'll have 2mics on D1 & 2mics on D2.
stm32_audio_persist_config_setup.c proposed update:
{
.pConfigName = "stval_mic008",
.audioMs = 8U,
.audioInFreq = 16000U,
.audioInCh = 4U, // Modif here
.audioInHwInterleave = 0U,
.audioOutFreq = 16000U,
.audioOutCh = 2U,
.audioOutResolution = UTIL_AUDIO_RESOLUTION_16B,
.audioInResolution = UTIL_AUDIO_RESOLUTION_16B,
.audioInHwResolution = UTIL_AUDIO_RESOLUTION_8B,
.audioInHwCh = 4UL, // Modif here
.audioInDeviceSelect = AUDIO_IN_DEVICE_DIGITAL_MIC1,
.audioInVolume = 100UL,
.audioOutVolume = 100UL,
.audioInDeviceOutFormat = 1UL,
.audioInUsePdm2Pcm = 1U,
.audioInUsePdm = 1U,
.ac_sysInMicBuffType = ABUFF_FORMAT_FIXED16,
.audioChainLowLatency = 0U,
.usbResolution = UTIL_AUDIO_RESOLUTION_16B,
.ac_sysUsbBuffType = ABUFF_FORMAT_FIXED16
},