Closed ArvinHou closed 1 year ago
I find the ethernet link down when the code run. Does the clock of i2s conflict with the clock of Ethernet ?
/ Step 7: Set I2S clocks and start. No need to give parameters since configurations has been set in 'i2s_driver_init' / ESP_GOTO_ON_ERROR(i2s_set_clk(i2s_num, 0, 0, 0), err, TAG, "I2S set clock failed");
I think the issue is caused by ethernet use GPIO 0 LAN_REF_CLK ---> IO0
For IO0 is used as I2S mclk PIN, if possible move it to another PIN and retry.
I think the issue is caused by ethernet use GPIO 0 LAN_REF_CLK ---> IO0
For IO0 is used as I2S mclk PIN, if possible move it to another PIN and retry. I2S mclk PIN has chanded MCLK ---> IO3
someone reply me: There's only one APLL in ESP32. I2S can use APLL as a clock source and Ethernet can also use APLL to generate the RMII reference clock.If both of them want to be used together, then APLL must be set to 50MHz on the I2S side.
Set use_apll=false.But it doesn't work.Ethernet link down.
i2s_cfg.i2s_config.use_apll = false; i2s_cfg.i2s_config.fixed_mclk = 0;
Set code bellow .Ethernet link down too.
i2s_cfg.i2s_config.use_apll = true; i2s_cfg.i2s_config.fixed_mclk = 50000000;
You can check https://esp32.com/viewtopic.php?t=10674 https://www.esp32.com/viewtopic.php?t=24084 to see whether it helps.
use IO0 for ethernet and IO3 for i2s is OK. IO0 is input a 50M clock. I2S is output clock.
I'm using IDF V4.4.5 and ADF V2.5.select lyrat_v4.3 board. When I debug the network alone,it's OK. When I debug the es8388 alone,it's OK too . When I debug together,something wrong. the es8388 works OK,but the ethernet will link down. I think it's a problem with the pins,I have changed a lot of pins。
Pins used of my board:
LAN LAN_RXD0 ---> IO25 LAN_RXD1 ---> IO26 LAN_CRS_DV ---> IO27 LAN_MDC ---> IO23 LAN_MDIO ---> IO18 LAN_TXD1 ---> IO22 LAN_TXD0 ---> IO19 LAN_TX_EN ---> IO21 LAN_RESET ---> IO5 LAN_REF_CLK ---> IO0
es8388 ASDOUT ---> IO35 DSDIN ---> IO33 LRCK ---> IO14 SCLK ---> IO2 MCLK ---> IO3 SDA ---> IO15 SCL ---> IO13
There are some buttons, PA, and button in the ADF library,I also changed.
/////////////////////////////////////////////////////// the board_pins_config.h of lyrat_v4.3 :
i2c_config->sda_io_num = GPIO_NUM_15; i2c_config->scl_io_num = GPIO_NUM_13;
i2s_config->bck_io_num = GPIO_NUM_2; //SCLK i2s_config->ws_io_num = GPIO_NUM_14; //LRCK i2s_config->data_out_num = GPIO_NUM_33; //DSDIN i2s_config->data_in_num = GPIO_NUM_35; //DSDOUT
///////////////////////////////////////////////////////
the i2s_stream.c :
i2s_mclk_gpio_select(i2s->config.i2s_port, GPIO_NUM_3);
/////////////////////////////////////////////////////// the board_def.h of lyrat_v4.3 :
define FUNC_SDCARD_EN (0)
define SDCARD_OPEN_FILE_NUM_MAX 5
define SDCARD_INTR_GPIO GPIO_NUM_4//GPIO_NUM_34
define FUNC_SYS_LEN_EN (0)
define GREEN_LED_GPIO GPIO_NUM_4//GPIO_NUM_22
define FUNC_AUDIO_CODEC_EN (1)
define AUXIN_DETECT_GPIO GPIO_NUM_4//GPIO_NUM_12
define HEADPHONE_DETECT GPIO_NUM_4//GPIO_NUM_19
define PA_ENABLE_GPIO GPIO_NUM_4//GPIO_NUM_21
define FUNC_BUTTON_EN (0)
define INPUT_KEY_NUM 6
//hou
define BUTTON_REC_ID GPIO_NUM_4//GPIO_NUM_36
define BUTTON_MODE_ID GPIO_NUM_4//GPIO_NUM_39
define BUTTON_SET_ID GPIO_NUM_4//TOUCH_PAD_NUM9
define BUTTON_PLAY_ID GPIO_NUM_4//TOUCH_PAD_NUM8
define BUTTON_VOLUP_ID GPIO_NUM_4//TOUCH_PAD_NUM7
define BUTTON_VOLDOWN_ID GPIO_NUM_4//TOUCH_PAD_NUM4
the log bellow
I really don't know where is the problem ,please help me .thanks