porting i2s - pdm driver from idf 4.x.x to 5.3.1
Posted: Wed Feb 12, 2025 11:26 am
Hello,
we have a device with an ST-MEMS microphone IMP34DT05 on an ESP32 device, it worked with the idf 4.x.x. Here is the configuration:
This configuration worked well for the ESP32 and the idf version v4.x.x
Now we want to go to the ESP32 S3 and I take the esp-idf v. 5.3.1, the i2s-driver changed completly, and I cannot get my microphone to work. We also changed the PIO-Config to PDM_CLOCK is on PIO 3 and PDM_DATA is on PIO 6.
Can You give me a working code sample which works like the old configuration?
Thanks in advance:
Roland
we have a device with an ST-MEMS microphone IMP34DT05 on an ESP32 device, it worked with the idf 4.x.x. Here is the configuration:
Code: Select all
#define ICS41350_PIN_CLK 4
#define ICS41350_PIN_DATA 2
void ICS41350_init(void)
{
i2s_pin_config_t pin_config;
pin_config.bck_io_num = I2S_PIN_NO_CHANGE;
pin_config.ws_io_num = ICS41350_PIN_CLK;
pin_config.data_out_num = I2S_PIN_NO_CHANGE;
pin_config.data_in_num = ICS41350_PIN_DATA;
i2s_config_t i2s_config = {
.mode = I2S_MODE_MASTER | I2S_MODE_RX| I2S_MODE_PDM,
.sample_rate = 16000,
.bits_per_sample = I2S_BITS_PER_SAMPLE_16BIT,
.channel_format = I2S_CHANNEL_FMT_ALL_RIGHT,
.communication_format = I2S_COMM_FORMAT_I2S,
.intr_alloc_flags = 0,
.dma_buf_count = 6, //8,
.dma_buf_len = 320, //256
};
i2s_driver_install(I2S_NUM_0, &i2s_config, 0, NULL);
i2s_set_pin(I2S_NUM_0, &pin_config);
i2s_set_pdm_rx_down_sample(I2S_NUM_0, I2S_PDM_DSR_16S);
This configuration worked well for the ESP32 and the idf version v4.x.x
Now we want to go to the ESP32 S3 and I take the esp-idf v. 5.3.1, the i2s-driver changed completly, and I cannot get my microphone to work. We also changed the PIO-Config to PDM_CLOCK is on PIO 3 and PDM_DATA is on PIO 6.
Can You give me a working code sample which works like the old configuration?
Thanks in advance:
Roland