From 025e7b7bd9b9b84e1f87889f2bd2c575f50a612d Mon Sep 17 00:00:00 2001 From: Ondrej Kosta Date: Fri, 9 Aug 2024 15:53:08 +0200 Subject: [PATCH] docs(esp_eth): added warning to not use ESP32 as ETH CLK source with WiFi --- components/esp_eth/Kconfig | 14 +++++++------- components/esp_eth/include/esp_eth_mac.h | 8 ++++---- docs/en/api-reference/network/esp_eth.rst | 6 ++++-- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/components/esp_eth/Kconfig b/components/esp_eth/Kconfig index 7b896711af..86e7813883 100644 --- a/components/esp_eth/Kconfig +++ b/components/esp_eth/Kconfig @@ -59,13 +59,11 @@ menu "Ethernet" bool "Output RMII clock from GPIO0 (Experimental!)" default n help - GPIO0 can be set to output a pre-divided PLL clock (test only!). - Enabling this option will configure GPIO0 to output a 50MHz clock. - In fact this clock doesn't have directly relationship with EMAC peripheral. - Sometimes this clock won't work well with your PHY chip. You might need to - add some extra devices after GPIO0 (e.g. inverter). - Note that outputting RMII clock on GPIO0 is an experimental practice. - If you want the Ethernet to work with WiFi, don't select GPIO0 output mode for stability. + GPIO0 can be set to output a pre-divided PLL clock. Enabling this option will configure + GPIO0 to output a 50MHz clock. In fact this clock doesn't have directly relationship with + EMAC peripheral. Sometimes this clock may not work well with your PHY chip. + WARNING: If you want the Ethernet to work with WiFi, don’t select ESP32 as RMII CLK output + as it would result in clock instability! if !ETH_RMII_CLK_OUTPUT_GPIO0 config ETH_RMII_CLK_OUT_GPIO @@ -74,6 +72,8 @@ menu "Ethernet" default 17 help Set the GPIO number to output RMII Clock. + WARNING: If you want the Ethernet to work with WiFi, don’t select ESP32 as RMII CLK output + as it would result in clock instability! endif # !ETH_RMII_CLK_OUTPUT_GPIO0 endif # ETH_RMII_CLK_OUTPUT diff --git a/components/esp_eth/include/esp_eth_mac.h b/components/esp_eth/include/esp_eth_mac.h index dfc1af2c73..70980df469 100644 --- a/components/esp_eth/include/esp_eth_mac.h +++ b/components/esp_eth/include/esp_eth_mac.h @@ -349,6 +349,8 @@ typedef enum { /** * @brief RMII Clock GPIO number Options * + * @warning If you want the Ethernet to work with WiFi, don’t select ESP32 as RMII CLK output as it would result in clock instability. + * */ typedef enum { /** @@ -362,10 +364,8 @@ typedef enum { /** * @brief Output RMII Clock from internal APLL Clock available at GPIO0 * - * @note GPIO0 can be set to output a pre-divided PLL clock (test only!). Enabling this option will configure GPIO0 to output a 50MHz clock. - * In fact this clock doesn’t have directly relationship with EMAC peripheral. Sometimes this clock won’t work well with your PHY chip. - * You might need to add some extra devices after GPIO0 (e.g. inverter). Note that outputting RMII clock on GPIO0 is an experimental practice. - * If you want the Ethernet to work with WiFi, don’t select GPIO0 output mode for stability. + * @note GPIO0 can be set to output a pre-divided PLL clock. Enabling this option will configure GPIO0 to output a 50MHz clock. + * In fact this clock doesn’t have directly relationship with EMAC peripheral. Sometimes this clock may not work well with your PHY chip. * */ EMAC_APPL_CLK_OUT_GPIO = 0, diff --git a/docs/en/api-reference/network/esp_eth.rst b/docs/en/api-reference/network/esp_eth.rst index 2762c64a09..e1eba2babc 100644 --- a/docs/en/api-reference/network/esp_eth.rst +++ b/docs/en/api-reference/network/esp_eth.rst @@ -148,8 +148,10 @@ Ethernet driver is composed of two parts: MAC and PHY. * Disable or power down the crystal oscillator (as the case *b* in the picture). * Force the PHY device in reset status (as the case *a* in the picture). **This could fail for some PHY device** (i.e. it still outputs signal to GPIO0 even in reset state). - **No matter which RMII clock mode you select, you really need to take care of the signal integrity of REF_CLK in your hardware design!** - Keep the trace as short as possible. Keep it away from RF devices. Keep it away from inductor elements. + .. warning:: + If you want the **Ethernet to work with WiFi**, don’t select ESP32 as source of ``REF_CLK`` as it would result in ``REF_CLK`` instability. Either disable WiFi or use a PHY or an external oscillator as the ``REF_CLK`` source. + + **No matter which RMII clock mode you select, you really need to take care of the signal integrity of REF_CLK in your hardware design!** Keep the trace as short as possible. Keep the trace as short as possible. Keep it away from RF devices. Keep it away from inductor elements. .. note:: ESP-IDF only supports the RMII interface (i.e. always select ``CONFIG_ETH_PHY_INTERFACE_RMII`` in Kconfig option :ref:`CONFIG_ETH_PHY_INTERFACE`).