ESP32S3-Korovo2-v3.1 ADC and DAC

woogeun shin
Posts: 1
Joined: Sun Mar 23, 2025 7:27 am

ESP32S3-Korovo2-v3.1 ADC and DAC

Postby woogeun shin » Sun Mar 23, 2025 8:05 am

Hello,

I’m using the ESP32S3-Korvo2-v3.1 board and have been testing the ADC and DAC functions with the ES8311 codec example code.
It supports two test modes: MP3 playback and echo mode.
I’ve modified several GPIO pins because the example code uses different GPIO assignments.
The board plays sound through the ES8311 and records sound with the ES7210.
I’ve configured them as shown below.
[Codebox]

Code: Untitled.c Select all

#define I2S_MCK_IO (GPIO_NUM_16) //(GPIO_NUM_0)
#define I2S_BCK_IO (GPIO_NUM_9)// (GPIO_NUM_4)
#define I2S_WS_IO (GPIO_NUM_45)//(GPIO_NUM_5)
#define I2S_DO_IO (GPIO_NUM_18)
#define I2S_DI_IO (GPIO_NUM_8) // (GPIO_NUM_19)
....
i2s_chan_config_t tx_chan_cfg = I2S_CHANNEL_DEFAULT_CONFIG(I2S_NUM_0, I2S_ROLE_MASTER);
i2s_std_config_t tx_std_cfg = {
.clk_cfg = I2S_STD_CLK_DEFAULT_CONFIG(16000),
.slot_cfg = I2S_STD_MSB_SLOT_DEFAULT_CONFIG(I2S_DATA_BIT_WIDTH_16BIT, I2S_SLOT_MODE_STEREO),
.gpio_cfg = {
.mclk = I2S_MCK_IO,
.bclk = I2S_BCK_IO,
.ws = I2S_WS_IO,
.dout = GPIO_NUM_NC,
.din = I2S_DI_IO,
.invert_flags = {
.mclk_inv = false,
.bclk_inv = false,
.ws_inv = false,
},
},
};
i2s_chan_config_t rx_chan_cfg = I2S_CHANNEL_DEFAULT_CONFIG(I2S_NUM_0, I2S_ROLE_SLAVE);

ESP_ERROR_CHECK(i2s_new_channel(&tx_chan_cfg, &tx_handle, NULL));
ESP_ERROR_CHECK(i2s_channel_init_std_mode(tx_handle, &tx_std_cfg));
ESP_ERROR_CHECK(i2s_channel_enable(tx_handle));
i2s_std_config_t rx_std_cfg = {
.clk_cfg = I2S_STD_CLK_DEFAULT_CONFIG(16000),
.slot_cfg = I2S_STD_MSB_SLOT_DEFAULT_CONFIG(I2S_DATA_BIT_WIDTH_16BIT, I2S_SLOT_MODE_STEREO),
.gpio_cfg = {
.mclk = I2S_MCK_IO,
.bclk = I2S_BCK_IO,
.ws = I2S_WS_IO,
.dout = GPIO_NUM_10,
.din = GPIO_NUM_NC,
.invert_flags = {
.mclk_inv = false,
.bclk_inv = false,
.ws_inv = false,
},
},
};
/* Initialize the channels */
ESP_ERROR_CHECK(i2s_new_channel(&rx_chan_cfg, NULL, &rx_handle));
ESP_ERROR_CHECK(i2s_channel_init_std_mode(rx_handle, &rx_std_cfg));
ESP_ERROR_CHECK(i2s_channel_enable(rx_handle));
[/Codebox]

I selected MP3 mode and played "canon.pcm," but I can’t hear any sound—only white noise comes from the speaker.
The code activates PA_CTRL for the speaker.
I also tested echo mode and logged the `mic_data` values, which are consistently all 0x00.
It appears the recording path isn’t functioning.

What do I miss?
The example code doesn't have how to initialize ES7211 even if it has es8311_codec_init().
Could you help me how to resolve thi issue?
Last edited by woogeun shin on Mon Mar 31, 2025 12:10 pm, edited 2 times in total.

ahsrabrifat
Posts: 201
Joined: Sat Jan 18, 2025 2:31 pm

Re: ESP32S3-Korovo2-v3.1 ADC and DAC

Postby ahsrabrifat » Thu Mar 27, 2025 2:06 pm

The ES7210 needs to be configured and initialized separately.

Code: Select all

#include "es7210.h"

es7210_handle_t es7210 = NULL;
es7210_config_t es7210_cfg = {
    .i2c_port = I2C_NUM_0,
    .i2c_addr = ES7210_ADDR,
    .mclk_freq = 16000,
    .i2s_format = ES7210_I2S_FORMAT_I2S,
    .bits_per_sample = 16,
    .sample_rate = 16000,
    .channel_mode = ES7210_CHANNEL_STEREO
};

// Initialize the ES7210
es7210 = es7210_init(&es7210_cfg);
if (!es7210) {
    ESP_LOGE(TAG, "Failed to initialize ES7210");
}

Who is online

Users browsing this forum: ChatGPT-User and 2 guests