ESP32 idf v5.5.4 esp_eth_mac_new_esp32() overwrites GPIO0 gpio matrix config

biterror
Posts: 33
Joined: Thu Apr 30, 2020 11:00 am

ESP32 idf v5.5.4 esp_eth_mac_new_esp32() overwrites GPIO0 gpio matrix config

Postby biterror » Fri Jun 26, 2026 8:58 pm

I'm porting a project from idf 4.4.8 to 5.5.4 and ran into problems with the i2s peripheral (using the new driver in full-duplex mode). The data output of i2s (GPIO0 in my case) was always zero, data input and clocks were working ok. It turned out that initializing ethernet after i2s kills the i2s output pin.

Code: Select all

REG_READ(GPIO_FUNC0_OUT_SEL_CFG_REG)
returns 0xa3 until I call

Code: Select all

esp_eth_mac_new_esp32(&esp32_emac_config, &mac_config);
after which it returns 0x23. If I call

Code: Select all

gpio_matrix_out(0, 0xa3, false, false);
i2s starts working again.

This is my configuration (with the built-in emac):

Code: Select all

    eth_esp32_emac_config_t esp32_emac_config = ETH_ESP32_EMAC_DEFAULT_CONFIG();
    esp32_emac_config.smi_gpio.mdc_num = IO_EMDC; // 23
    esp32_emac_config.smi_gpio.mdio_num = IO_EMDIO; // 18
    esp32_emac_config.clock_config.rmii.clock_mode = EMAC_CLK_OUT;
    esp32_emac_config.clock_config.rmii.clock_gpio = IO_PHY_CLK; // 17
    esp_eth_mac_t *mac = esp_eth_mac_new_esp32(&esp32_emac_config, &mac_config);
I have also selected RMII clock output mode and pin 17 in menuconfig. Ethernet works just fine, it just kills my GPIO0. Am I doing something wrong or is there a bug in idf version 5.5.4?

Thank you.

Who is online

Users browsing this forum: Google [Bot], Qwantbot and 4 guests