Merge branch 'feat/gmac_s31_followup_2nd_v6.1' into 'release/v6.1'

feat(esp_eth): add ioctl for 1G PHY master/slave mode (v6.1)

See merge request espressif/esp-idf!51709
This commit is contained in:
Euripedes Rocha
2026-08-27 15:14:03 +02:00
44 changed files with 300 additions and 702 deletions

View File

@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2019-2025 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2019-2026 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -178,6 +178,8 @@ typedef enum {
ETH_CMD_S_ALL_MULTICAST, /*!< Set receive all multicast */
ETH_CMD_ADD_MAC_FILTER, /*!< Add MAC filter */
ETH_CMD_DEL_MAC_FILTER, /*!< Delete MAC filter */
ETH_CMD_S_PHY_MASTER_MODE, /*!< Set PHY master mode */
ETH_CMD_G_PHY_MASTER_MODE, /*!< Get PHY master mode */
ETH_CMD_CUSTOM_MAC_CMDS = ETH_CMD_CUSTOM_MAC_CMDS_OFFSET, // Offset for start of MAC custom commands
ETH_CMD_CUSTOM_PHY_CMDS = ETH_CMD_CUSTOM_PHY_CMDS_OFFSET, // Offset for start of PHY custom commands
@@ -383,9 +385,14 @@ esp_err_t esp_eth_transmit_ctrl_vargs(esp_eth_handle_t hdl, void *ctrl, uint32_t
* Preconditions: Ethernet driver needs to be stopped and auto-negotiation disabled.
* @li @c ETH_CMD_G_DUPLEX_MODE gets current Ethernet link duplex mode. @c data argument is pointer to memory of eth_duplex_t datatype to which the duplex mode is to be stored.
* @li @c ETH_CMD_S_PHY_LOOPBACK sets/resets PHY to/from loopback mode. @c data argument is pointer to memory of bool datatype from which the configuration option is read.
* @li @c ETH_CMD_READ_PHY_REG reads PHY register. @c data argument is pointer to @c esp_eth_phy_reg_rw_data_t containing register address and pointer to store read value.
* @li @c ETH_CMD_WRITE_PHY_REG writes PHY register. @c data argument is pointer to @c esp_eth_phy_reg_rw_data_t containing register address and pointer to value to write.
* @li @c ETH_CMD_S_ALL_MULTICAST sets/resets Ethernet interface to/from receive all multicast mode. @c data argument is pointer to memory of bool datatype from which the configuration option is read.
* @li @c ETH_CMD_ADD_MAC_FILTER adds a MAC address to the MAC filter. @c data argument is pointer to MAC address buffer with expected size of 6 bytes.
* @li @c ETH_CMD_DEL_MAC_FILTER deletes a MAC address from the MAC filter. @c data argument is pointer to MAC address buffer with expected size of 6 bytes.
* @li @c ETH_CMD_S_PHY_MASTER_MODE sets PHY master/slave mode for 1000BASE-T. @c data argument is pointer to memory of bool datatype from which the configuration option is read (true = master, false = slave).
* Preconditions: Ethernet driver needs to be stopped. Required before forcing 1000 Mbps speed when auto-negotiation is disabled.
* @li @c ETH_CMD_G_PHY_MASTER_MODE gets PHY master/slave mode for 1000BASE-T. @c data argument is pointer to memory of bool datatype to which the current configuration is to be stored (true = master, false = slave).
*
* @li Note that additional control commands may be available for specific MAC or PHY chips. Please consult specific MAC or PHY documentation or driver code.
*/

View File

@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2019-2025 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2019-2026 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -267,6 +267,40 @@ struct esp_eth_phy_s {
*
*/
esp_err_t (*del)(esp_eth_phy_t *phy);
/**
* @brief Sets PHY master/slave mode for 1000BASE-T
*
* @note This configuration is required before forcing 1000 Mbps speed mode when auto-negotiation
* is disabled. One link partner must be configured as master and the other as slave.
* @note This function pointer may be set to NULL when the PHY does not support 1000BASE-T.
*
* @param[in] phy: Ethernet PHY instance
* @param[in] master: set true to configure as master; set false to configure as slave
*
* @return
* - ESP_OK: PHY instance master/slave mode has been configured successfully
* - ESP_ERR_NOT_SUPPORTED: PHY does not support 1000BASE-T
* - ESP_FAIL: PHY instance master/slave mode configuration failed because some error occurred
*
*/
esp_err_t (*set_master_mode)(esp_eth_phy_t *phy, bool master);
/**
* @brief Gets PHY master/slave mode for 1000BASE-T
*
* @note This function pointer may be set to NULL when the PHY does not support 1000BASE-T.
*
* @param[in] phy: Ethernet PHY instance
* @param[out] master: set to true if PHY is configured as master; false if configured as slave
*
* @return
* - ESP_OK: PHY instance master/slave mode has been read successfully
* - ESP_ERR_NOT_SUPPORTED: PHY does not support 1000BASE-T
* - ESP_FAIL: PHY instance master/slave mode read failed because some error occurred
*
*/
esp_err_t (*get_master_mode)(esp_eth_phy_t *phy, bool *master);
};
/**

View File

@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2022-2026 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -162,6 +162,32 @@ esp_err_t esp_eth_phy_802_3_set_speed(phy_802_3_t *phy_802_3, eth_speed_t speed)
*/
esp_err_t esp_eth_phy_802_3_set_duplex(phy_802_3_t *phy_802_3, eth_duplex_t duplex);
/**
* @brief Set Ethernet PHY master/slave mode for 1000BASE-T
*
* @note Required before forcing 1000 Mbps speed when auto-negotiation is disabled.
*
* @param phy_802_3 IEEE 802.3 PHY object infostructure
* @param master set true to configure as master; set false to configure as slave
* @return
* - ESP_OK: Ethernet PHY master/slave mode set successfully
* - ESP_ERR_NOT_SUPPORTED: PHY does not support 1000BASE-T
* - ESP_FAIL: Set Ethernet PHY master/slave mode failed because some error occurred
*/
esp_err_t esp_eth_phy_802_3_set_master_mode(phy_802_3_t *phy_802_3, bool master);
/**
* @brief Get Ethernet PHY master/slave mode for 1000BASE-T
*
* @param phy_802_3 IEEE 802.3 PHY object infostructure
* @param master set to true if PHY is configured as master; false if configured as slave
* @return
* - ESP_OK: Ethernet PHY master/slave mode read successfully
* - ESP_ERR_NOT_SUPPORTED: PHY does not support 1000BASE-T
* - ESP_FAIL: Get Ethernet PHY master/slave mode failed because some error occurred
*/
esp_err_t esp_eth_phy_802_3_get_master_mode(phy_802_3_t *phy_802_3, bool *master);
/**
* @brief Set Ethernet PHY link status
*

View File

@@ -161,10 +161,13 @@ typedef union {
*/
typedef union {
struct {
uint32_t reserved0 : 8; /*!< Reserved */
uint32_t base1000_t : 1; /*!< 1000Base-T half duplex support */
uint32_t base1000_t_fd : 1; /*!< 1000Base-T full duplex support */
uint32_t reserved1 : 6; /*!< Reserved */
uint32_t reserved0 : 8; /*!< Reserved */
uint32_t base1000_t : 1; /*!< 1000Base-T half duplex support */
uint32_t base1000_t_fd : 1; /*!< 1000Base-T full duplex support */
uint32_t port_type : 1; /*!< Port type: multiport device(1), single-port device(0) */
uint32_t master_slave_cfg : 1; /*!< Master-slave config value: master(1), slave(0) */
uint32_t master_slave_manual : 1; /*!< Master-slave manual configuration enable */
uint32_t test_mode : 3; /*!< Transmitter test mode */
};
uint32_t val;
} gbcr_reg_t;

View File

@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2019-2025 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2019-2026 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -508,6 +508,18 @@ esp_err_t esp_eth_ioctl(esp_eth_handle_t hdl, esp_eth_io_cmd_t cmd, void *data)
ESP_GOTO_ON_FALSE(data, ESP_ERR_INVALID_ARG, err, TAG, "can't set loopback to null");
ESP_GOTO_ON_ERROR(phy->loopback(phy, *(bool *)data), err, TAG, "configuration of phy loopback mode failed");
break;
case ETH_CMD_S_PHY_MASTER_MODE:
ESP_GOTO_ON_FALSE(data, ESP_ERR_INVALID_ARG, err, TAG, "can't set master mode to null");
ESP_GOTO_ON_FALSE(phy->set_master_mode != NULL, ESP_ERR_NOT_SUPPORTED, err, TAG, "set PHY master mode not supported");
// check if driver is stopped; configuration should be changed only when transmitting/receiving is not active
ESP_GOTO_ON_FALSE(atomic_load(&eth_driver->fsm) == ESP_ETH_FSM_STOP, ESP_ERR_INVALID_STATE, err, TAG, "link configuration is only allowed when driver is stopped");
ESP_GOTO_ON_ERROR(phy->set_master_mode(phy, *(bool *)data), err, TAG, "set PHY master mode failed");
break;
case ETH_CMD_G_PHY_MASTER_MODE:
ESP_GOTO_ON_FALSE(data, ESP_ERR_INVALID_ARG, err, TAG, "no mem to store master mode value");
ESP_GOTO_ON_FALSE(phy->get_master_mode != NULL, ESP_ERR_NOT_SUPPORTED, err, TAG, "get PHY master mode not supported");
ESP_GOTO_ON_ERROR(phy->get_master_mode(phy, (bool *)data), err, TAG, "get PHY master mode failed");
break;
case ETH_CMD_READ_PHY_REG: {
uint32_t phy_addr;
ESP_GOTO_ON_FALSE(data, ESP_ERR_INVALID_ARG, err, TAG, "invalid register read/write info");

View File

@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2023-2026 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -13,7 +13,11 @@
* we can reuse the Wifi interrupt source for ethernet, since QEMU doesn't emulate Wifi (yet).
* We also map the EMAC registers to an unused address range.
*/
#if SOC_WIFI_SUPPORTED && !SOC_EMAC_SUPPORTED
#if SOC_WIFI_SUPPORTED && !SOC_EMAC_SUPPORTED
#define ETS_ETH_MAC_INTR_SOURCE ETS_WIFI_MAC_INTR_SOURCE
#define DR_REG_EMAC_BASE 0x600CD000
#endif
#if SOC_EMAC_SUPPORT_1000M
#define DR_REG_EMAC_BASE DR_REG_GMAC_BASE
#endif

View File

@@ -88,6 +88,18 @@ static esp_err_t set_duplex(esp_eth_phy_t *phy, eth_duplex_t duplex)
return esp_eth_phy_802_3_set_duplex(phy_802_3, duplex);
}
static esp_err_t set_master_mode(esp_eth_phy_t *phy, bool master)
{
phy_802_3_t *phy_802_3 = esp_eth_phy_into_phy_802_3(phy);
return esp_eth_phy_802_3_set_master_mode(phy_802_3, master);
}
static esp_err_t get_master_mode(esp_eth_phy_t *phy, bool *master)
{
phy_802_3_t *phy_802_3 = esp_eth_phy_into_phy_802_3(phy);
return esp_eth_phy_802_3_get_master_mode(phy_802_3, master);
}
static esp_err_t set_link(esp_eth_phy_t *phy, eth_link_t link)
{
phy_802_3_t *phy_802_3 = esp_eth_phy_into_phy_802_3(phy);
@@ -393,6 +405,33 @@ err:
}
/**
* @brief Check whether the PHY supports 1000BASE-T
*
* @param[in] phy_802_3 IEEE 802.3 PHY object
* @param[out] is_1000_capable set to true if PHY supports 1000BASE-T
* @return
* - ESP_OK: capability checked successfully
* - ESP_FAIL: failed to read PHY registers
*/
static esp_err_t phy_802_3_is_1000_capable(phy_802_3_t *phy_802_3, bool *is_1000_capable)
{
esp_err_t ret = ESP_OK;
esp_eth_mediator_t *eth = phy_802_3->eth;
*is_1000_capable = false;
bmsr_reg_t bmsr;
ESP_GOTO_ON_ERROR(eth->phy_reg_read(eth, phy_802_3->addr, ETH_PHY_BMSR_REG_ADDR, &(bmsr.val)), err, TAG, "read BMSR failed");
if (bmsr.ext_status) {
exsr_reg_t exsr;
ESP_GOTO_ON_ERROR(eth->phy_reg_read(eth, phy_802_3->addr, ETH_PHY_EXSR_REG_ADDR, &(exsr.val)), err, TAG, "read EXSR failed");
*is_1000_capable = exsr.base1000_t || exsr.base1000_t_fd;
}
return ESP_OK;
err:
return ret;
}
esp_err_t esp_eth_phy_802_3_set_speed(phy_802_3_t *phy_802_3, eth_speed_t speed)
{
esp_err_t ret = ESP_OK;
@@ -404,19 +443,10 @@ esp_err_t esp_eth_phy_802_3_set_speed(phy_802_3_t *phy_802_3, eth_speed_t speed)
/* Set speed */
bmcr_reg_t bmcr;
ESP_GOTO_ON_ERROR(eth->phy_reg_read(eth, phy_802_3->addr, ETH_PHY_BMCR_REG_ADDR, &(bmcr.val)), err, TAG, "read BMCR failed");
bmsr_reg_t bmsr;
ESP_GOTO_ON_ERROR(eth->phy_reg_read(eth, phy_802_3->addr, ETH_PHY_BMSR_REG_ADDR, &(bmsr.val)), err, TAG, "read BMSR failed");
bool is_1000_capable = false;
if (bmsr.ext_status) {
exsr_reg_t exsr;
ESP_GOTO_ON_ERROR(eth->phy_reg_read(eth, phy_802_3->addr, ETH_PHY_EXSR_REG_ADDR, &(exsr.val)), err, TAG, "read EXSR failed");
is_1000_capable = exsr.base1000_t || exsr.base1000_t_fd;
}
ESP_GOTO_ON_ERROR(phy_802_3_is_1000_capable(phy_802_3, &is_1000_capable), err, TAG, "check 1000BASE-T capability failed");
if (speed == ETH_SPEED_1000M) {
if (!is_1000_capable) {
ret = ESP_ERR_NOT_SUPPORTED;
goto err;
}
ESP_GOTO_ON_FALSE(is_1000_capable, ESP_ERR_NOT_SUPPORTED, err, TAG, "PHY does not support 1000BASE-T");
bmcr.speed_1000 = 1;
bmcr.speed_select = 0;
} else {
@@ -454,6 +484,47 @@ err:
return ret;
}
esp_err_t esp_eth_phy_802_3_set_master_mode(phy_802_3_t *phy_802_3, bool master)
{
esp_err_t ret = ESP_OK;
esp_eth_mediator_t *eth = phy_802_3->eth;
bool is_1000_capable = false;
ESP_GOTO_ON_ERROR(phy_802_3_is_1000_capable(phy_802_3, &is_1000_capable), err, TAG, "check 1000BASE-T capability failed");
ESP_GOTO_ON_FALSE(is_1000_capable, ESP_ERR_NOT_SUPPORTED, err, TAG, "PHY does not support 1000BASE-T");
/* Configure master/slave mode in 1000BASE-T Control register (IEEE 802.3 Clause 40) */
gbcr_reg_t gbcr;
ESP_GOTO_ON_ERROR(eth->phy_reg_read(eth, phy_802_3->addr, ETH_PHY_GBCR_REG_ADDR, &(gbcr.val)), err, TAG, "read GBCR failed");
gbcr.master_slave_manual = 1;
gbcr.master_slave_cfg = master ? 1 : 0;
ESP_GOTO_ON_ERROR(eth->phy_reg_write(eth, phy_802_3->addr, ETH_PHY_GBCR_REG_ADDR, gbcr.val), err, TAG, "write GBCR failed");
return ESP_OK;
err:
return ret;
}
esp_err_t esp_eth_phy_802_3_get_master_mode(phy_802_3_t *phy_802_3, bool *master)
{
esp_err_t ret = ESP_OK;
esp_eth_mediator_t *eth = phy_802_3->eth;
ESP_GOTO_ON_FALSE(master, ESP_ERR_INVALID_ARG, err, TAG, "master can't be null");
bool is_1000_capable = false;
ESP_GOTO_ON_ERROR(phy_802_3_is_1000_capable(phy_802_3, &is_1000_capable), err, TAG, "check 1000BASE-T capability failed");
ESP_GOTO_ON_FALSE(is_1000_capable, ESP_ERR_NOT_SUPPORTED, err, TAG, "PHY does not support 1000BASE-T");
gbcr_reg_t gbcr;
ESP_GOTO_ON_ERROR(eth->phy_reg_read(eth, phy_802_3->addr, ETH_PHY_GBCR_REG_ADDR, &(gbcr.val)), err, TAG, "read GBCR failed");
*master = gbcr.master_slave_cfg;
return ESP_OK;
err:
return ret;
}
esp_err_t esp_eth_phy_802_3_set_link(phy_802_3_t *phy_802_3, eth_link_t link)
{
esp_err_t ret = ESP_OK;
@@ -735,6 +806,8 @@ esp_err_t esp_eth_phy_802_3_obj_config_init(phy_802_3_t *phy_802_3, const eth_ph
phy_802_3->parent.loopback = loopback;
phy_802_3->parent.set_speed = set_speed;
phy_802_3->parent.set_duplex = set_duplex;
phy_802_3->parent.set_master_mode = set_master_mode;
phy_802_3->parent.get_master_mode = get_master_mode;
phy_802_3->parent.del = del;
phy_802_3->parent.set_link = set_link;
phy_802_3->parent.get_link = get_link;

View File

@@ -2,8 +2,8 @@
components/esp_eth/test_apps:
enable:
- if: IDF_TARGET in ["esp32", "esp32p4"]
reason: ESP32 and ESP32P4 have internal EMAC. SPI Ethernet runners are based on ESP32.
- if: IDF_TARGET in ["esp32", "esp32p4", "esp32s31"]
reason: ESP32, ESP32P4 and ESP32S31 have internal EMAC.
depends_components:
- esp_eth
- esp_http_client

View File

@@ -1,5 +1,5 @@
| Supported Targets | ESP32 | ESP32-P4 |
| ----------------- | ----- | -------- |
| Supported Targets | ESP32 | ESP32-P4 | ESP32-S31 |
| ----------------- | ----- | -------- | --------- |
# Ethernet Test

View File

@@ -104,117 +104,15 @@ def test_esp32p4_emac_clko(dut: IdfDut) -> None:
dut.run_all_single_board_cases(group='esp_emac_clk_out')
# ----------- LAN8720 -----------
@pytest.mark.eth_lan8720
# ----------- YT8531 ESP32S31 -----------
@pytest.mark.parametrize(
'config',
'config, target',
[
'default_lan8720',
pytest.param('default_yt8531_esp32s31', 'esp32s31', marks=[pytest.mark.eth_yt8531]),
],
indirect=True,
indirect=['target'],
)
@idf_parametrize('target', ['esp32'], indirect=['target'])
def test_esp_eth_lan8720(dut: IdfDut, eth_test_runner: 'EthTestRunner') -> None:
eth_test_runner.run_ethernet_test_apps(dut)
dut.serial.hard_reset()
eth_test_runner.run_ethernet_l2_test(dut)
# ----------- RTL8201 -----------
@pytest.mark.eth_rtl8201
@pytest.mark.parametrize(
'config',
[
'default_rtl8201',
],
indirect=True,
)
@idf_parametrize('target', ['esp32'], indirect=['target'])
def test_esp_eth_rtl8201(dut: IdfDut, eth_test_runner: 'EthTestRunner') -> None:
eth_test_runner.run_ethernet_test_apps(dut)
dut.serial.hard_reset()
eth_test_runner.run_ethernet_l2_test(dut)
# ----------- KSZ8041 -----------
@pytest.mark.eth_ksz8041
@pytest.mark.parametrize(
'config',
[
'default_ksz8041',
],
indirect=True,
)
@idf_parametrize('target', ['esp32'], indirect=['target'])
def test_esp_eth_ksz8041(dut: IdfDut, eth_test_runner: 'EthTestRunner') -> None:
eth_test_runner.run_ethernet_test_apps(dut)
dut.serial.hard_reset()
eth_test_runner.run_ethernet_l2_test(dut)
# ----------- DP83848 -----------
@pytest.mark.eth_dp83848
@pytest.mark.parametrize(
'config',
[
'default_dp83848',
],
indirect=True,
)
@idf_parametrize('target', ['esp32'], indirect=['target'])
def test_esp_eth_dp83848(dut: IdfDut, eth_test_runner: 'EthTestRunner') -> None:
eth_test_runner.run_ethernet_test_apps(dut)
dut.serial.hard_reset()
eth_test_runner.run_ethernet_l2_test(dut)
# ----------- W5500 -----------
@pytest.mark.eth_w5500
@pytest.mark.parametrize(
'config',
[
'default_w5500',
],
indirect=True,
)
@idf_parametrize('target', ['esp32'], indirect=['target'])
def test_esp_eth_w5500(dut: IdfDut, eth_test_runner: 'EthTestRunner') -> None:
eth_test_runner.run_ethernet_test_apps(dut)
dut.serial.hard_reset()
eth_test_runner.run_ethernet_l2_test(dut)
dut.serial.hard_reset()
eth_test_runner.run_ethernet_heap_alloc_test(dut)
# ----------- KSZ8851SNL -----------
@pytest.mark.eth_ksz8851snl
@pytest.mark.parametrize(
'config',
[
'default_ksz8851snl',
],
indirect=True,
)
@idf_parametrize('target', ['esp32'], indirect=['target'])
def test_esp_eth_ksz8851snl(dut: IdfDut, eth_test_runner: 'EthTestRunner') -> None:
eth_test_runner.run_ethernet_test_apps(dut)
dut.serial.hard_reset()
eth_test_runner.run_ethernet_l2_test(dut)
dut.serial.hard_reset()
eth_test_runner.run_ethernet_heap_alloc_test(dut)
# ----------- DM9051 -----------
@pytest.mark.eth_dm9051
@pytest.mark.parametrize(
'config',
[
'default_dm9051',
],
indirect=True,
)
@idf_parametrize('target', ['esp32'], indirect=['target'])
def test_esp_eth_dm9051(dut: IdfDut, eth_test_runner: 'EthTestRunner') -> None:
def test_esp32s31_ethernet(dut: IdfDut, eth_test_runner: 'EthTestRunner') -> None:
eth_test_runner.run_ethernet_test_apps(dut)
dut.serial.hard_reset()
eth_test_runner.run_ethernet_l2_test(dut)

View File

@@ -1,24 +0,0 @@
CONFIG_IDF_TARGET="esp32"
CONFIG_UNITY_ENABLE_FIXTURE=y
CONFIG_UNITY_ENABLE_IDF_TEST_RUNNER=y
CONFIG_ETH_USE_ESP32_EMAC=y
CONFIG_ESP_TASK_WDT_EN=n
# Config Ethernet Init
CONFIG_ETHERNET_SPI_SUPPORT=y
CONFIG_ETHERNET_INTERNAL_SUPPORT=n
CONFIG_ETHERNET_SPI_DEV0_DM9051=y
CONFIG_ETHERNET_SPI_DEV1_NONE=y
CONFIG_ETHERNET_SPI_CLOCK_MHZ=20
CONFIG_ETHERNET_DEFAULT_EVENT_HANDLER=n
# SPI specific test configuration
CONFIG_ETH_TEST_MAC_ADDR_UI=n
CONFIG_ETH_TEST_PHY_ADDRESS_DISABLED=y
CONFIG_ETH_TEST_STRESS_TEST_TASK_PRIO=20
# W5500 specific test configuration
# FILL_RX_BUFFER_ITERATIONS = 16384 / 1522 = 10.8
CONFIG_ETH_TEST_FILL_RX_BUFFER_ITERATIONS=11
CONFIG_ETH_TEST_10MB_LOOPBACK_DISABLED=y

View File

@@ -1,19 +0,0 @@
CONFIG_IDF_TARGET="esp32"
CONFIG_UNITY_ENABLE_FIXTURE=y
CONFIG_UNITY_ENABLE_IDF_TEST_RUNNER=y
CONFIG_ETH_USE_ESP32_EMAC=y
CONFIG_ESP_TASK_WDT_EN=n
# Config Ethernet Init
CONFIG_ETHERNET_INTERNAL_SUPPORT=y
CONFIG_ETHERNET_PHY_DP83848=y
CONFIG_ETHERNET_PHY_INTERFACE_RMII=y
CONFIG_ETHERNET_RMII_CLK_OUTPUT=y
CONFIG_ETHERNET_RMII_CLK_EXT_LOOPBACK_EN=n
CONFIG_ETHERNET_RMII_CLK_GPIO=17
CONFIG_ETHERNET_DEFAULT_EVENT_HANDLER=n
# DP83848 specific test configuration
CONFIG_ETH_TEST_FILL_RX_BUFFER_ITERATIONS=10
CONFIG_ETH_TEST_LOOPBACK_WITH_AUTONEGOTIATION_DISABLED=y

View File

@@ -1,15 +0,0 @@
CONFIG_IDF_TARGET="esp32"
CONFIG_UNITY_ENABLE_FIXTURE=y
CONFIG_UNITY_ENABLE_IDF_TEST_RUNNER=y
CONFIG_ETH_USE_ESP32_EMAC=y
CONFIG_ESP_TASK_WDT_EN=n
# Config Ethernet Init
CONFIG_ETHERNET_INTERNAL_SUPPORT=y
CONFIG_ETHERNET_PHY_KSZ80XX=y
CONFIG_ETHERNET_DEFAULT_EVENT_HANDLER=n
# KSZ8041 specific test configuration
CONFIG_ETH_TEST_FILL_RX_BUFFER_ITERATIONS=10
CONFIG_ETH_TEST_10MB_LOOPBACK_DISABLED=y

View File

@@ -1,23 +0,0 @@
CONFIG_IDF_TARGET="esp32"
CONFIG_UNITY_ENABLE_FIXTURE=y
CONFIG_UNITY_ENABLE_IDF_TEST_RUNNER=y
CONFIG_ETH_USE_ESP32_EMAC=y
CONFIG_ESP_TASK_WDT_EN=n
# Config Ethernet Init
CONFIG_ETHERNET_SPI_SUPPORT=y
CONFIG_ETHERNET_INTERNAL_SUPPORT=n
CONFIG_ETHERNET_SPI_DEV0_KSZ8851SNL=y
CONFIG_ETHERNET_SPI_DEV1_NONE=y
CONFIG_ETHERNET_SPI_CLOCK_MHZ=20
CONFIG_ETHERNET_DEFAULT_EVENT_HANDLER=n
# SPI specific test configuration
CONFIG_ETH_TEST_MAC_ADDR_UI=n
CONFIG_ETH_TEST_PHY_ADDRESS_DISABLED=y
CONFIG_ETH_TEST_STRESS_TEST_TASK_PRIO=20
# KSZ8851SNL specific test configuration
# FILL_RX_BUFFER_ITERATIONS = 12288 / 1522 = 8.1
CONFIG_ETH_TEST_FILL_RX_BUFFER_ITERATIONS=9

View File

@@ -1,21 +0,0 @@
CONFIG_IDF_TARGET="esp32"
CONFIG_UNITY_ENABLE_FIXTURE=y
CONFIG_UNITY_ENABLE_IDF_TEST_RUNNER=y
CONFIG_ETH_USE_ESP32_EMAC=y
CONFIG_ESP_TASK_WDT_EN=n
# interface configuration
CONFIG_ETHERNET_INTERNAL_SUPPORT=y
CONFIG_ETHERNET_PHY_LAN87XX=y
CONFIG_ETHERNET_PHY_INTERFACE_RMII=y
CONFIG_ETHERNET_RMII_CLK_OUTPUT=y
CONFIG_ETHERNET_RMII_CLK_EXT_LOOPBACK_EN=n
CONFIG_ETHERNET_RMII_CLK_GPIO=17
CONFIG_ETHERNET_PHY_ADDR=0
CONFIG_ETHERNET_DEFAULT_EVENT_HANDLER=n
# LAN8720 specific test configuration
CONFIG_ETH_TEST_FILL_RX_BUFFER_ITERATIONS=10
CONFIG_ETH_TEST_LOOPBACK_WITH_AUTONEGOTIATION_DISABLED=y
CONFIG_ETH_TEST_LAN8720_ERRATA_ENABLED=y

View File

@@ -1,20 +0,0 @@
CONFIG_IDF_TARGET="esp32"
CONFIG_UNITY_ENABLE_FIXTURE=y
CONFIG_UNITY_ENABLE_IDF_TEST_RUNNER=y
CONFIG_ETH_USE_ESP32_EMAC=y
CONFIG_ESP_TASK_WDT_EN=n
# Config Ethernet Init
CONFIG_ETHERNET_PHY_RTL8201=y
CONFIG_ETHERNET_INTERNAL_SUPPORT=y
CONFIG_ETHERNET_RMII_CLK_INPUT=y
CONFIG_ETHERNET_MDC_GPIO=16
CONFIG_ETHERNET_MDIO_GPIO=17
CONFIG_ETHERNET_PHY_RST_GPIO=-1
CONFIG_ETHERNET_PHY_ADDR=0
CONFIG_ETHERNET_DEFAULT_EVENT_HANDLER=n
# RTL8201 specific test configuration
CONFIG_ETH_TEST_FILL_RX_BUFFER_ITERATIONS=10
CONFIG_ETH_TEST_LOOPBACK_WITH_AUTONEGOTIATION_DISABLED=y

View File

@@ -1,25 +0,0 @@
CONFIG_IDF_TARGET="esp32"
CONFIG_UNITY_ENABLE_FIXTURE=y
CONFIG_UNITY_ENABLE_IDF_TEST_RUNNER=y
CONFIG_ETH_USE_ESP32_EMAC=y
CONFIG_ESP_TASK_WDT_EN=n
# Config Ethernet Init
CONFIG_ETHERNET_SPI_SUPPORT=y
CONFIG_ETHERNET_INTERNAL_SUPPORT=n
CONFIG_ETHERNET_SPI_DEV0_W5500=y
CONFIG_ETHERNET_SPI_DEV1_NONE=y
CONFIG_ETHERNET_SPI_CLOCK_MHZ=20
CONFIG_ETHERNET_DEFAULT_EVENT_HANDLER=n
# SPI specific test configuration
CONFIG_ETH_TEST_MAC_ADDR_UI=n
CONFIG_ETH_TEST_PHY_ADDRESS_DISABLED=y
CONFIG_ETH_TEST_STRESS_TEST_TASK_PRIO=20
# W5500 specific test configuration
# FILL_RX_BUFFER_ITERATIONS = 16384 / 1522 = 10.8
CONFIG_ETH_TEST_FILL_RX_BUFFER_ITERATIONS=11
CONFIG_ETH_TEST_LOOPBACK_DISABLED=y
CONFIG_ETH_TEST_W5500_IP6_MCAST_DEVIATION_ENABLED=y

View File

@@ -0,0 +1,21 @@
CONFIG_IDF_TARGET="esp32s31"
CONFIG_UNITY_ENABLE_FIXTURE=y
CONFIG_UNITY_ENABLE_IDF_TEST_RUNNER=y
CONFIG_ETH_USE_ESP32_EMAC=y
CONFIG_ESP_TASK_WDT_EN=n
# interface configuration
CONFIG_ETHERNET_INTERNAL_SUPPORT=y
CONFIG_ETHERNET_PHY_INTERFACE_DEFAULT=y
CONFIG_ETHERNET_PHY_YT8531=y
CONFIG_ETHERNET_DEFAULT_EVENT_HANDLER=n
# specific test configuration
# ESP32S31 has smaller internal Rx FIFO, hence more Rx buffers is used by default
CONFIG_ETH_TEST_FILL_RX_BUFFER_ITERATIONS=20
CONFIG_ETH_TEST_LOOPBACK_WITH_AUTONEGOTIATION_DISABLED=y
CONFIG_ETH_TEST_PHY_1000M_CAPABLE=y
# ESP32S31 provides only two universally administered MAC addresses in eFuse, so the internal EMAC
# gets a locally administered ETH MAC by default (see CONFIG_ESP32S31_UNIVERSAL_MAC_ADDRESSES).
CONFIG_ETH_TEST_MAC_ADDR_UI=n

View File

@@ -5,8 +5,6 @@ examples/ethernet/basic:
- if: INCLUDE_DEFAULT == 1
disable:
- if: IDF_TARGET not in ["esp32", "esp32p4", "esp32s31"]
disable_test:
- if: IDF_TARGET == "esp32s31"
temporary: true
reason: lack of runners
depends_components:
@@ -20,11 +18,10 @@ examples/ethernet/iperf:
- if: IDF_TARGET in ["esp32h21", "esp32h4"]
temporary: true
reason: not supported yet # TODO: [ESP32H21] IDF-11581 [ESP32H4] IDF-12360
- if: IDF_TARGET not in ["esp32", "esp32p4"]
- if: IDF_TARGET not in ["esp32", "esp32p4", "esp32s31"]
temporary: true
reason: lack of runners
depends_components:
- *common_components
- esp_eth
- esp_netif
- lwip

View File

@@ -62,11 +62,12 @@ menu "Example Ethernet Configuration"
config EXAMPLE_ETH_RMII_CLK_EXT_LOOPBACK_IN_GPIO
depends on EXAMPLE_ETH_RMII_CLK_EXT_LOOPBACK_EN
int "RMII CLK loopback input GPIO"
range ENV_GPIO_RANGE_MIN ENV_GPIO_RANGE_MAX
range -1 ENV_GPIO_RANGE_MAX
default 32 if IDF_TARGET_ESP32P4
default 0
help
Set GPIO number used by RMII REF CLK input to loopback internally generated RMII CLK output.
You can set -1 to use internal REF CLK routing if target supports it.
See datasheet for available GPIOs.
if SOC_EMAC_USE_MULTI_IO_MUX

View File

@@ -14,6 +14,7 @@ from pytest_embedded import Dut
pytest.param('lan8720_esp32', 'esp32', marks=[pytest.mark.eth_lan8720]),
pytest.param('defaults_esp32p4', 'esp32p4', marks=[pytest.mark.eth_ip101]),
pytest.param('defaults_esp32p4v1', 'esp32p4', marks=[pytest.mark.eth_ip101, pytest.mark.esp32p4_rev1]),
pytest.param('defaults_esp32s31', 'esp32s31', marks=[pytest.mark.eth_yt8531]),
],
indirect=['target'],
)

View File

@@ -0,0 +1,27 @@
CONFIG_IDF_TARGET="esp32s31"
CONFIG_ETH_ENABLED=y
CONFIG_ETH_USE_ESP32_EMAC=y
CONFIG_EXAMPLE_ETH_PHY_INTERFACE_RGMII=y
CONFIG_EXAMPLE_ETH_RGMII_RX_CLK_GPIO=14
CONFIG_EXAMPLE_ETH_RGMII_TX_CLK_GPIO=13
CONFIG_EXAMPLE_ETH_RGMII_PHY_REF_CLK_GPIO=-1
CONFIG_EXAMPLE_ETH_RGMII_TX_CTL_GPIO=12
CONFIG_EXAMPLE_ETH_RGMII_TXD0_GPIO=8
CONFIG_EXAMPLE_ETH_RGMII_TXD1_GPIO=9
CONFIG_EXAMPLE_ETH_RGMII_TXD2_GPIO=10
CONFIG_EXAMPLE_ETH_RGMII_TXD3_GPIO=11
CONFIG_EXAMPLE_ETH_RGMII_RX_CTL_GPIO=15
CONFIG_EXAMPLE_ETH_RGMII_RXD0_GPIO=19
CONFIG_EXAMPLE_ETH_RGMII_RXD1_GPIO=18
CONFIG_EXAMPLE_ETH_RGMII_RXD2_GPIO=17
CONFIG_EXAMPLE_ETH_RGMII_RXD3_GPIO=16
CONFIG_EXAMPLE_ETH_MDC_GPIO=5
CONFIG_EXAMPLE_ETH_MDIO_GPIO=6
CONFIG_EXAMPLE_ETH_PHY_RST_GPIO=7
CONFIG_EXAMPLE_ETH_DEINIT_AFTER_S=10
CONFIG_EXAMPLE_ETH_PHY_RST_TIMING_EN=y

View File

@@ -0,0 +1,4 @@
CONFIG_IDF_TARGET="esp32s31"
CONFIG_ETH_ENABLED=y
CONFIG_ETH_USE_ESP32_EMAC=y

View File

@@ -1,5 +1,5 @@
| Supported Targets | ESP32 | ESP32-P4 |
| ----------------- | ----- | -------- |
| Supported Targets | ESP32 | ESP32-P4 | ESP32-S31 |
| ----------------- | ----- | -------- | --------- |
# Ethernet iperf Example

View File

@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD
# SPDX-FileCopyrightText: 2022-2026 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Unlicense OR CC0-1.0
"""
Test case for iperf example.
@@ -275,3 +275,19 @@ def test_esp_eth_iperf_ksz8851snl(
log_performance: Callable[[str, object], None],
) -> None:
test_esp_eth_iperf(dut, log_performance, spi_eth=True, udp_rx_bw_lim=10)
@pytest.mark.eth_yt8531
@pytest.mark.parametrize(
'config',
[
'default_yt8531_esp32s31',
],
indirect=True,
)
@idf_parametrize('target', ['esp32s31'], indirect=['target'])
def test_esp_eth_iperf_yt8531(
dut: Dut,
log_performance: Callable[[str, object], None],
) -> None:
test_esp_eth_iperf(dut, log_performance)

View File

@@ -1,40 +1,4 @@
# Increase main task stack size
CONFIG_ESP_MAIN_TASK_STACK_SIZE=7168
# Enable filesystem for console commands history storage
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
CONFIG_PARTITION_TABLE_CUSTOM=y
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions_example.csv"
CONFIG_PARTITION_TABLE_FILENAME="partitions_example.csv"
# Enable FreeRTOS stats formatting functions, needed for 'tasks' command
CONFIG_FREERTOS_USE_TRACE_FACILITY=y
CONFIG_FREERTOS_USE_STATS_FORMATTING_FUNCTIONS=y
# --------------------------------
# Performance optimization options
# --------------------------------
# The lwIP and iperf tasks have a serial dependency (i.e., iperf must wait for lwIP to process packets),
# meaning that running in multi-core mode does not significantly improve performance. Additionally,
# IRAM optimizations have a more noticeable effect in single-core mode.
# However, while a single-core configuration can enhance iperf performance in controlled or isolated
# testing scenarios, it may not be optimal for real-world applications where the system also needs to
# handle additional, non-network-related tasks. In such cases, multi-core configurations might be better
# suited for balancing workloads and ensuring overall system responsiveness.
# Run FreeRTOS only on the first core
CONFIG_FREERTOS_UNICORE=y
# Disable watch dog
CONFIG_ESP_INT_WDT=n
CONFIG_ESP_TASK_WDT_EN=n
# Enable lwIP IRAM optimization
CONFIG_LWIP_IRAM_OPTIMIZATION=y
CONFIG_LWIP_EXTRA_IRAM_OPTIMIZATION=y
# Enable Ethernet IRAM optimization
CONFIG_ETH_IRAM_OPTIMIZATION=y
# Common / performance options live in sdkconfig.defaults
# Config Ethernet Init
CONFIG_ETHERNET_SPI_SUPPORT=y

View File

@@ -1,40 +1,4 @@
# Increase main task stack size
CONFIG_ESP_MAIN_TASK_STACK_SIZE=7168
# Enable filesystem for console commands history storage
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
CONFIG_PARTITION_TABLE_CUSTOM=y
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions_example.csv"
CONFIG_PARTITION_TABLE_FILENAME="partitions_example.csv"
# Enable FreeRTOS stats formatting functions, needed for 'tasks' command
CONFIG_FREERTOS_USE_TRACE_FACILITY=y
CONFIG_FREERTOS_USE_STATS_FORMATTING_FUNCTIONS=y
# --------------------------------
# Performance optimization options
# --------------------------------
# The lwIP and iperf tasks have a serial dependency (i.e., iperf must wait for lwIP to process packets),
# meaning that running in multi-core mode does not significantly improve performance. Additionally,
# IRAM optimizations have a more noticeable effect in single-core mode.
# However, while a single-core configuration can enhance iperf performance in controlled or isolated
# testing scenarios, it may not be optimal for real-world applications where the system also needs to
# handle additional, non-network-related tasks. In such cases, multi-core configurations might be better
# suited for balancing workloads and ensuring overall system responsiveness.
# Run FreeRTOS only on the first core
CONFIG_FREERTOS_UNICORE=y
# Disable watch dog
CONFIG_ESP_INT_WDT=n
CONFIG_ESP_TASK_WDT_EN=n
# Enable lwIP IRAM optimization
CONFIG_LWIP_IRAM_OPTIMIZATION=y
CONFIG_LWIP_EXTRA_IRAM_OPTIMIZATION=y
# Enable Ethernet IRAM optimization
CONFIG_ETH_IRAM_OPTIMIZATION=y
# Common / performance options live in sdkconfig.defaults
CONFIG_ETH_ENABLED=y
CONFIG_ETH_USE_ESP32_EMAC=y

View File

@@ -1,40 +1,4 @@
# Increase main task stack size
CONFIG_ESP_MAIN_TASK_STACK_SIZE=7168
# Enable filesystem for console commands history storage
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
CONFIG_PARTITION_TABLE_CUSTOM=y
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions_example.csv"
CONFIG_PARTITION_TABLE_FILENAME="partitions_example.csv"
# Enable FreeRTOS stats formatting functions, needed for 'tasks' command
CONFIG_FREERTOS_USE_TRACE_FACILITY=y
CONFIG_FREERTOS_USE_STATS_FORMATTING_FUNCTIONS=y
# --------------------------------
# Performance optimization options
# --------------------------------
# The lwIP and iperf tasks have a serial dependency (i.e., iperf must wait for lwIP to process packets),
# meaning that running in multi-core mode does not significantly improve performance. Additionally,
# IRAM optimizations have a more noticeable effect in single-core mode.
# However, while a single-core configuration can enhance iperf performance in controlled or isolated
# testing scenarios, it may not be optimal for real-world applications where the system also needs to
# handle additional, non-network-related tasks. In such cases, multi-core configurations might be better
# suited for balancing workloads and ensuring overall system responsiveness.
# Run FreeRTOS only on the first core
CONFIG_FREERTOS_UNICORE=y
# Disable watch dog
CONFIG_ESP_INT_WDT=n
CONFIG_ESP_TASK_WDT_EN=n
# Enable lwIP IRAM optimization
CONFIG_LWIP_IRAM_OPTIMIZATION=y
CONFIG_LWIP_EXTRA_IRAM_OPTIMIZATION=y
# Enable Ethernet IRAM optimization
CONFIG_ETH_IRAM_OPTIMIZATION=y
# Common / performance options live in sdkconfig.defaults
CONFIG_ETH_ENABLED=y
CONFIG_ETH_USE_ESP32_EMAC=y

View File

@@ -1,43 +1,7 @@
# Common / performance options live in sdkconfig.defaults
CONFIG_IDF_TARGET="esp32p4"
# Increase main task stack size
CONFIG_ESP_MAIN_TASK_STACK_SIZE=7168
# Enable filesystem for console commands history storage
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
CONFIG_PARTITION_TABLE_CUSTOM=y
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions_example.csv"
CONFIG_PARTITION_TABLE_FILENAME="partitions_example.csv"
# Enable FreeRTOS stats formatting functions, needed for 'tasks' command
CONFIG_FREERTOS_USE_TRACE_FACILITY=y
CONFIG_FREERTOS_USE_STATS_FORMATTING_FUNCTIONS=y
# --------------------------------
# Performance optimization options
# --------------------------------
# The lwIP and iperf tasks have a serial dependency (i.e., iperf must wait for lwIP to process packets),
# meaning that running in multi-core mode does not significantly improve performance. Additionally,
# IRAM optimizations have a more noticeable effect in single-core mode.
# However, while a single-core configuration can enhance iperf performance in controlled or isolated
# testing scenarios, it may not be optimal for real-world applications where the system also needs to
# handle additional, non-network-related tasks. In such cases, multi-core configurations might be better
# suited for balancing workloads and ensuring overall system responsiveness.
# Run FreeRTOS only on the first core
CONFIG_FREERTOS_UNICORE=y
# Disable watch dog
CONFIG_ESP_INT_WDT=n
CONFIG_ESP_TASK_WDT_EN=n
# Enable lwIP IRAM optimization
CONFIG_LWIP_IRAM_OPTIMIZATION=y
CONFIG_LWIP_EXTRA_IRAM_OPTIMIZATION=y
# Enable Ethernet IRAM optimization
CONFIG_ETH_IRAM_OPTIMIZATION=y
CONFIG_ETH_ENABLED=y
CONFIG_ETH_USE_ESP32_EMAC=y

View File

@@ -1,44 +1,8 @@
# Common / performance options live in sdkconfig.defaults
CONFIG_IDF_TARGET="esp32p4"
CONFIG_ESP32P4_SELECTS_REV_LESS_V3=y
# Increase main task stack size
CONFIG_ESP_MAIN_TASK_STACK_SIZE=7168
# Enable filesystem for console commands history storage
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
CONFIG_PARTITION_TABLE_CUSTOM=y
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions_example.csv"
CONFIG_PARTITION_TABLE_FILENAME="partitions_example.csv"
# Enable FreeRTOS stats formatting functions, needed for 'tasks' command
CONFIG_FREERTOS_USE_TRACE_FACILITY=y
CONFIG_FREERTOS_USE_STATS_FORMATTING_FUNCTIONS=y
# --------------------------------
# Performance optimization options
# --------------------------------
# The lwIP and iperf tasks have a serial dependency (i.e., iperf must wait for lwIP to process packets),
# meaning that running in multi-core mode does not significantly improve performance. Additionally,
# IRAM optimizations have a more noticeable effect in single-core mode.
# However, while a single-core configuration can enhance iperf performance in controlled or isolated
# testing scenarios, it may not be optimal for real-world applications where the system also needs to
# handle additional, non-network-related tasks. In such cases, multi-core configurations might be better
# suited for balancing workloads and ensuring overall system responsiveness.
# Run FreeRTOS only on the first core
CONFIG_FREERTOS_UNICORE=y
# Disable watch dog
CONFIG_ESP_INT_WDT=n
CONFIG_ESP_TASK_WDT_EN=n
# Enable lwIP IRAM optimization
CONFIG_LWIP_IRAM_OPTIMIZATION=y
CONFIG_LWIP_EXTRA_IRAM_OPTIMIZATION=y
# Enable Ethernet IRAM optimization
CONFIG_ETH_IRAM_OPTIMIZATION=y
CONFIG_ETH_ENABLED=y
CONFIG_ETH_USE_ESP32_EMAC=y

View File

@@ -1,40 +1,4 @@
# Increase main task stack size
CONFIG_ESP_MAIN_TASK_STACK_SIZE=7168
# Enable filesystem for console commands history storage
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
CONFIG_PARTITION_TABLE_CUSTOM=y
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions_example.csv"
CONFIG_PARTITION_TABLE_FILENAME="partitions_example.csv"
# Enable FreeRTOS stats formatting functions, needed for 'tasks' command
CONFIG_FREERTOS_USE_TRACE_FACILITY=y
CONFIG_FREERTOS_USE_STATS_FORMATTING_FUNCTIONS=y
# --------------------------------
# Performance optimization options
# --------------------------------
# The lwIP and iperf tasks have a serial dependency (i.e., iperf must wait for lwIP to process packets),
# meaning that running in multi-core mode does not significantly improve performance. Additionally,
# IRAM optimizations have a more noticeable effect in single-core mode.
# However, while a single-core configuration can enhance iperf performance in controlled or isolated
# testing scenarios, it may not be optimal for real-world applications where the system also needs to
# handle additional, non-network-related tasks. In such cases, multi-core configurations might be better
# suited for balancing workloads and ensuring overall system responsiveness.
# Run FreeRTOS only on the first core
CONFIG_FREERTOS_UNICORE=y
# Disable watch dog
CONFIG_ESP_INT_WDT=n
CONFIG_ESP_TASK_WDT_EN=n
# Enable lwIP IRAM optimization
CONFIG_LWIP_IRAM_OPTIMIZATION=y
CONFIG_LWIP_EXTRA_IRAM_OPTIMIZATION=y
# Enable Ethernet IRAM optimization
CONFIG_ETH_IRAM_OPTIMIZATION=y
# Common / performance options live in sdkconfig.defaults
CONFIG_ETH_ENABLED=y
CONFIG_ETH_USE_ESP32_EMAC=y

View File

@@ -1,40 +1,4 @@
# Increase main task stack size
CONFIG_ESP_MAIN_TASK_STACK_SIZE=7168
# Enable filesystem for console commands history storage
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
CONFIG_PARTITION_TABLE_CUSTOM=y
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions_example.csv"
CONFIG_PARTITION_TABLE_FILENAME="partitions_example.csv"
# Enable FreeRTOS stats formatting functions, needed for 'tasks' command
CONFIG_FREERTOS_USE_TRACE_FACILITY=y
CONFIG_FREERTOS_USE_STATS_FORMATTING_FUNCTIONS=y
# --------------------------------
# Performance optimization options
# --------------------------------
# The lwIP and iperf tasks have a serial dependency (i.e., iperf must wait for lwIP to process packets),
# meaning that running in multi-core mode does not significantly improve performance. Additionally,
# IRAM optimizations have a more noticeable effect in single-core mode.
# However, while a single-core configuration can enhance iperf performance in controlled or isolated
# testing scenarios, it may not be optimal for real-world applications where the system also needs to
# handle additional, non-network-related tasks. In such cases, multi-core configurations might be better
# suited for balancing workloads and ensuring overall system responsiveness.
# Run FreeRTOS only on the first core
CONFIG_FREERTOS_UNICORE=y
# Disable watch dog
CONFIG_ESP_INT_WDT=n
CONFIG_ESP_TASK_WDT_EN=n
# Enable lwIP IRAM optimization
CONFIG_LWIP_IRAM_OPTIMIZATION=y
CONFIG_LWIP_EXTRA_IRAM_OPTIMIZATION=y
# Enable Ethernet IRAM optimization
CONFIG_ETH_IRAM_OPTIMIZATION=y
# Common / performance options live in sdkconfig.defaults
# Config Ethernet Init
CONFIG_ETHERNET_SPI_SUPPORT=y

View File

@@ -1,40 +1,4 @@
# Increase main task stack size
CONFIG_ESP_MAIN_TASK_STACK_SIZE=7168
# Enable filesystem for console commands history storage
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
CONFIG_PARTITION_TABLE_CUSTOM=y
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions_example.csv"
CONFIG_PARTITION_TABLE_FILENAME="partitions_example.csv"
# Enable FreeRTOS stats formatting functions, needed for 'tasks' command
CONFIG_FREERTOS_USE_TRACE_FACILITY=y
CONFIG_FREERTOS_USE_STATS_FORMATTING_FUNCTIONS=y
# --------------------------------
# Performance optimization options
# --------------------------------
# The lwIP and iperf tasks have a serial dependency (i.e., iperf must wait for lwIP to process packets),
# meaning that running in multi-core mode does not significantly improve performance. Additionally,
# IRAM optimizations have a more noticeable effect in single-core mode.
# However, while a single-core configuration can enhance iperf performance in controlled or isolated
# testing scenarios, it may not be optimal for real-world applications where the system also needs to
# handle additional, non-network-related tasks. In such cases, multi-core configurations might be better
# suited for balancing workloads and ensuring overall system responsiveness.
# Run FreeRTOS only on the first core
CONFIG_FREERTOS_UNICORE=y
# Disable watch dog
CONFIG_ESP_INT_WDT=n
CONFIG_ESP_TASK_WDT_EN=n
# Enable lwIP IRAM optimization
CONFIG_LWIP_IRAM_OPTIMIZATION=y
CONFIG_LWIP_EXTRA_IRAM_OPTIMIZATION=y
# Enable Ethernet IRAM optimization
CONFIG_ETH_IRAM_OPTIMIZATION=y
# Common / performance options live in sdkconfig.defaults
CONFIG_ETH_ENABLED=y
CONFIG_ETH_USE_ESP32_EMAC=y

View File

@@ -1,40 +1,4 @@
# Increase main task stack size
CONFIG_ESP_MAIN_TASK_STACK_SIZE=7168
# Enable filesystem for console commands history storage
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
CONFIG_PARTITION_TABLE_CUSTOM=y
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions_example.csv"
CONFIG_PARTITION_TABLE_FILENAME="partitions_example.csv"
# Enable FreeRTOS stats formatting functions, needed for 'tasks' command
CONFIG_FREERTOS_USE_TRACE_FACILITY=y
CONFIG_FREERTOS_USE_STATS_FORMATTING_FUNCTIONS=y
# --------------------------------
# Performance optimization options
# --------------------------------
# The lwIP and iperf tasks have a serial dependency (i.e., iperf must wait for lwIP to process packets),
# meaning that running in multi-core mode does not significantly improve performance. Additionally,
# IRAM optimizations have a more noticeable effect in single-core mode.
# However, while a single-core configuration can enhance iperf performance in controlled or isolated
# testing scenarios, it may not be optimal for real-world applications where the system also needs to
# handle additional, non-network-related tasks. In such cases, multi-core configurations might be better
# suited for balancing workloads and ensuring overall system responsiveness.
# Run FreeRTOS only on the first core
CONFIG_FREERTOS_UNICORE=y
# Disable watch dog
CONFIG_ESP_INT_WDT=n
CONFIG_ESP_TASK_WDT_EN=n
# Enable lwIP IRAM optimization
CONFIG_LWIP_IRAM_OPTIMIZATION=y
CONFIG_LWIP_EXTRA_IRAM_OPTIMIZATION=y
# Enable Ethernet IRAM optimization
CONFIG_ETH_IRAM_OPTIMIZATION=y
# Common / performance options live in sdkconfig.defaults
# Config Ethernet Init
CONFIG_ETHERNET_PHY_RTL8201=y

View File

@@ -1,40 +1,4 @@
# Increase main task stack size
CONFIG_ESP_MAIN_TASK_STACK_SIZE=7168
# Enable filesystem for console commands history storage
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
CONFIG_PARTITION_TABLE_CUSTOM=y
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions_example.csv"
CONFIG_PARTITION_TABLE_FILENAME="partitions_example.csv"
# Enable FreeRTOS stats formatting functions, needed for 'tasks' command
CONFIG_FREERTOS_USE_TRACE_FACILITY=y
CONFIG_FREERTOS_USE_STATS_FORMATTING_FUNCTIONS=y
# --------------------------------
# Performance optimization options
# --------------------------------
# The lwIP and iperf tasks have a serial dependency (i.e., iperf must wait for lwIP to process packets),
# meaning that running in multi-core mode does not significantly improve performance. Additionally,
# IRAM optimizations have a more noticeable effect in single-core mode.
# However, while a single-core configuration can enhance iperf performance in controlled or isolated
# testing scenarios, it may not be optimal for real-world applications where the system also needs to
# handle additional, non-network-related tasks. In such cases, multi-core configurations might be better
# suited for balancing workloads and ensuring overall system responsiveness.
# Run FreeRTOS only on the first core
CONFIG_FREERTOS_UNICORE=y
# Disable watch dog
CONFIG_ESP_INT_WDT=n
CONFIG_ESP_TASK_WDT_EN=n
# Enable lwIP IRAM optimization
CONFIG_LWIP_IRAM_OPTIMIZATION=y
CONFIG_LWIP_EXTRA_IRAM_OPTIMIZATION=y
# Enable Ethernet IRAM optimization
CONFIG_ETH_IRAM_OPTIMIZATION=y
# Common / performance options live in sdkconfig.defaults
# Config Ethernet Init
CONFIG_ETHERNET_SPI_SUPPORT=y

View File

@@ -0,0 +1,10 @@
# Common / performance options live in sdkconfig.defaults
CONFIG_IDF_TARGET="esp32s31"
CONFIG_ETH_ENABLED=y
CONFIG_ETH_USE_ESP32_EMAC=y
# Config Ethernet Init
CONFIG_ETHERNET_INTERNAL_SUPPORT=y
CONFIG_ETHERNET_PHY_YT8531=y

View File

@@ -12,28 +12,11 @@
CONFIG_IDF_TARGET="esp32c2"
# Increase main task stack size
CONFIG_ESP_MAIN_TASK_STACK_SIZE=7168
# Enable filesystem for console commands history storage
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
CONFIG_PARTITION_TABLE_CUSTOM=y
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions_example.csv"
CONFIG_PARTITION_TABLE_FILENAME="partitions_example.csv"
# Enable FreeRTOS stats formatting functions, needed for 'tasks' command
CONFIG_FREERTOS_USE_TRACE_FACILITY=y
CONFIG_FREERTOS_USE_STATS_FORMATTING_FUNCTIONS=y
# Disable watch dog
CONFIG_ESP_INT_WDT=n
CONFIG_ESP_TASK_WDT_EN=n
# Disable lwIP IRAM optimization
# Disable lwIP IRAM optimization (overrides sdkconfig.defaults)
CONFIG_LWIP_IRAM_OPTIMIZATION=n
CONFIG_LWIP_EXTRA_IRAM_OPTIMIZATION=n
# Disable Ethernet IRAM optimization
# Disable Ethernet IRAM optimization (overrides sdkconfig.defaults)
CONFIG_ETH_IRAM_OPTIMIZATION=n
# Config Ethernet Init and Choose w5500

View File

@@ -2,9 +2,9 @@
examples/network/bridge:
disable:
- if: IDF_TARGET in ["esp32h21", "esp32h4", "esp32s31"]
- if: IDF_TARGET in ["esp32h21", "esp32h4"]
temporary: true
reason: not supported yet # TODO: [ESP32H21] IDF-12203 [ESP32H4] IDF-12712 [ESP32S31] IDF-14929
reason: not supported yet # TODO: [ESP32H21] IDF-12203 [ESP32H4] IDF-12712
disable_test:
- if: IDF_TARGET != "esp32"
reason: Generic functionality, no need to be run on specific targets
@@ -17,9 +17,6 @@ examples/network/bridge:
examples/network/eth2ap:
disable:
- if: SOC_WIFI_SUPPORTED != 1
- if: IDF_TARGET in ["esp32s31"]
temporary: true
reason: not support yet # TODO: [ESP32S31] IDF-14929
depends_components:
- esp_eth
- esp_wifi
@@ -27,10 +24,6 @@ examples/network/eth2ap:
examples/network/simple_sniffer:
disable:
- if: SOC_WIFI_SUPPORTED != 1
disable_test:
- if: IDF_TARGET in ["esp32s31"]
temporary: true
reason: lack of runners
depends_components:
- esp_wifi
- fatfs
@@ -39,9 +32,6 @@ examples/network/simple_sniffer:
examples/network/sta2eth:
disable:
- if: SOC_WIFI_SUPPORTED != 1
- if: IDF_TARGET in ["esp32s31"]
temporary: true
reason: not support yet # TODO: [ESP32S31] IDF-14929
depends_components:
- esp_eth
- esp_wifi
@@ -50,10 +40,6 @@ examples/network/sta2eth:
- http-server
examples/network/vlan_support:
disable:
- if: IDF_TARGET in ["esp32s31"]
temporary: true
reason: not support yet # TODO: [ESP32S31] IDF-14929
disable_test:
- if: IDF_TARGET not in ["esp32"]
reason: Runner uses esp32 ethernet kit

View File

@@ -1,5 +1,5 @@
| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-C61 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 |
| ----------------- | ----- | -------- | -------- | -------- | -------- | --------- | -------- | -------- | -------- | -------- |
| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-C61 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | ESP32-S31 |
| ----------------- | ----- | -------- | -------- | -------- | -------- | --------- | -------- | -------- | -------- | -------- | --------- |
# Bridge Example
(See the README.md file in the upper level 'examples' directory for more information about examples.)

View File

@@ -1,5 +1,5 @@
| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-C61 | ESP32-S2 | ESP32-S3 |
| ----------------- | ----- | -------- | -------- | -------- | -------- | --------- | -------- | -------- |
| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-C61 | ESP32-S2 | ESP32-S3 | ESP32-S31 |
| ----------------- | ----- | -------- | -------- | -------- | -------- | --------- | -------- | -------- | --------- |
# eth2ap Example
(See the README.md file in the upper level 'examples' directory for more information about examples. To try a more complex application about Ethernet to WiFi data forwarding, please go to [iot-solution](https://github.com/espressif/esp-iot-solution/tree/release/v1.0/examples/eth2wifi).)

View File

@@ -56,6 +56,7 @@ def _sniffer_packets_check(dut: Dut, channel: int, packet_num: int) -> None:
'esp32c61',
'esp32s2',
'esp32s3',
'esp32s31',
],
indirect=['target'],
)

View File

@@ -1,5 +1,5 @@
| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-C61 | ESP32-S2 | ESP32-S3 |
| ----------------- | ----- | -------- | -------- | -------- | -------- | --------- | -------- | -------- |
| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-C61 | ESP32-S2 | ESP32-S3 | ESP32-S31 |
| ----------------- | ----- | -------- | -------- | -------- | -------- | --------- | -------- | -------- | --------- |
# WiFi station to "Wired" interface L2 forwarder

View File

@@ -1,5 +1,5 @@
| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-C61 | ESP32-H2 | ESP32-H21 | ESP32-H4 | ESP32-P4 | ESP32-S2 | ESP32-S3 |
| ----------------- | ----- | -------- | -------- | -------- | -------- | --------- | -------- | --------- | -------- | -------- | -------- | -------- |
| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-C61 | ESP32-H2 | ESP32-H21 | ESP32-H4 | ESP32-P4 | ESP32-S2 | ESP32-S3 | ESP32-S31 |
| ----------------- | ----- | -------- | -------- | -------- | -------- | --------- | -------- | --------- | -------- | -------- | -------- | -------- | --------- |
# Ethernet VLAN Support Example

View File

@@ -52,6 +52,7 @@ env_markers =
eth_rtl8201: connected via RTL8201 ethernet transceiver
eth_ksz8041: connected via KSZ8041 ethernet transceiver
eth_dp83848: connected via DP83848 ethernet transceiver
eth_yt8531: connected via YT8531 ethernet transceiver
eth_w5500: SPI Ethernet module with two W5500
eth_ksz8851snl: SPI Ethernet module with two KSZ8851SNL
eth_dm9051: SPI Ethernet module with two DM9051