Description
Board
ESP32 based custom board (doesn't matter)
Device Description
Doesn't matter
Hardware Configuration
Doesn't matter
Version
latest development Release Candidate (RC-X)
IDE Name
VScode
Operating System
Windows 11, Linux
Flash frequency
Doesn't matter
PSRAM enabled
no
Upload speed
Doesn't matter
Description
I am using arduino as a component in an ESP-IDF project, included as a submodule. Both the RC tag and the currect branch release/3.1.x
suffer from the following problem.
ESP-IDF is v5.3.1.
With this configuration, compilation fails with
C:/DEVELOP/firmware/ipuartbridge/components/arduino/libraries/Ethernet/src/ETH.cpp: In member function 'bool ETHClass::begin(eth_phy_type_t, int32_t, int, int, int, eth_clock_mode_t)':
C:/DEVELOP/firmware/ipuartbridge/components/arduino/libraries/Ethernet/src/ETH.cpp:175:56: error: 'CONFIG_ETH_RMII_CLK_IN_GPIO' was not declared in this scope; did you mean 'CONFIG_ETH_RMII_CLK_OUT_GPIO'?
175 | #define DEFAULT_RMII_CLK_GPIO (emac_rmii_clock_gpio_t)(CONFIG_ETH_RMII_CLK_IN_GPIO)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
C:/VSCode/espressif-v5/idf/components/esp_eth/include/esp_eth_mac_esp.h:233:31: note: in expansion of macro 'DEFAULT_RMII_CLK_GPIO'
233 | .clock_gpio = DEFAULT_RMII_CLK_GPIO \
| ^~~~~~~~~~~~~~~~~~~~~
C:/DEVELOP/firmware/ipuartbridge/components/arduino/libraries/Ethernet/src/ETH.cpp:178:40: note: in expansion of macro 'ETH_ESP32_EMAC_DEFAULT_CONFIG'
178 | eth_esp32_emac_config_t mac_config = ETH_ESP32_EMAC_DEFAULT_CONFIG();
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This is because my sdkconfig
looks like this:
CONFIG_ETH_USE_ESP32_EMAC=y
CONFIG_ETH_PHY_INTERFACE_RMII=y
# CONFIG_ETH_RMII_CLK_INPUT is not set
CONFIG_ETH_RMII_CLK_OUTPUT=y
# CONFIG_ETH_RMII_CLK_OUTPUT_GPIO0 is not set
CONFIG_ETH_RMII_CLK_OUT_GPIO=17
So the value for CONFIG_ETH_RMII_CLK_IN_GPIO
is not there, and can not be due to the Kconfig.
Master branch compiles fine, because it doesn't undefine-then-redefine the value for DEFAULT_RMII_CLK_GPIO
:
// Eth.cpp...
#if CONFIG_IDF_TARGET_ESP32
#undef DEFAULT_RMII_CLK_GPIO
#define DEFAULT_RMII_CLK_GPIO (emac_rmii_clock_gpio_t)(CONFIG_ETH_RMII_CLK_IN_GPIO)
#endif
The value DEFAULT_RMII_CLK_GPIO
would be the correct one for my project, because esp-idf\components\esp_eth\include\esp_eth_mac_esp.h
defines it correctly.
The lines were introduced in e1673e4.
Sketch
Doesn't matter, compilation fails as soon as arduino is used as a component.
Debug Message
See description
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide
- I confirm I have checked existing issues, online documentation and Troubleshooting guide.