diff --git a/examples/ethernet/.build-test-rules.yml b/examples/ethernet/.build-test-rules.yml index 7a716888b3..35a00eebdb 100644 --- a/examples/ethernet/.build-test-rules.yml +++ b/examples/ethernet/.build-test-rules.yml @@ -3,6 +3,14 @@ examples/ethernet/basic: enable: - if: INCLUDE_DEFAULT == 1 + disable: + - if: IDF_TARGET == "esp32c5" + temporary: true + reason: not supported yet # TODO: [ESP32C5] IDF-8697 + disable_test: + - if: IDF_TARGET not in ["esp32"] + temporary: true + reason: lack of runners depends_components: - esp_eth - esp_netif diff --git a/examples/ethernet/basic/README.md b/examples/ethernet/basic/README.md index 742a6e1548..92ec6d1593 100644 --- a/examples/ethernet/basic/README.md +++ b/examples/ethernet/basic/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C5 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | -| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | +| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | +| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | # Ethernet Example (See the README.md file in the upper level 'examples' directory for more information about examples.) diff --git a/examples/ethernet/basic/pytest_eth_basic.py b/examples/ethernet/basic/pytest_eth_basic.py new file mode 100644 index 0000000000..52c73a360d --- /dev/null +++ b/examples/ethernet/basic/pytest_eth_basic.py @@ -0,0 +1,24 @@ +# SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD +# SPDX-License-Identifier: Unlicense OR CC0-1.0 +import platform +import subprocess + +import pytest +from pytest_embedded import Dut + + +@pytest.mark.esp32 +@pytest.mark.parametrize('config', [ + pytest.param('default_ip101', marks=[pytest.mark.ethernet_router]), + pytest.param('default_dm9051', marks=[pytest.mark.eth_dm9051]), +], indirect=True) +def test_esp_eth_basic_dm9051( + dut: Dut +) -> None: + # wait for ip received + dut_ip = dut.expect(r'esp_netif_handlers: .+ ip: (\d+\.\d+\.\d+\.\d+),').group(1) + # ping it once + param = '-n' if platform.system().lower() == 'windows' else '-c' + command = ['ping', param, '1', dut_ip] + output = subprocess.run(command, capture_output=True) + assert 'unreachable' not in str(output.stdout) diff --git a/examples/ethernet/basic/sdkconfig.ci.default_dm9051 b/examples/ethernet/basic/sdkconfig.ci.default_dm9051 new file mode 100644 index 0000000000..fbcb73ddf8 --- /dev/null +++ b/examples/ethernet/basic/sdkconfig.ci.default_dm9051 @@ -0,0 +1,5 @@ +CONFIG_EXAMPLE_USE_SPI_ETHERNET=y +CONFIG_EXAMPLE_USE_INTERNAL_ETHERNET=n +CONFIG_EXAMPLE_SPI_ETHERNETS_NUM=1 +CONFIG_EXAMPLE_USE_DM9051=y +CONFIG_EXAMPLE_ETH_SPI_CLOCK_MHZ=20 diff --git a/examples/ethernet/basic/sdkconfig.ci.default_ip101 b/examples/ethernet/basic/sdkconfig.ci.default_ip101 new file mode 100644 index 0000000000..690b9f96d2 --- /dev/null +++ b/examples/ethernet/basic/sdkconfig.ci.default_ip101 @@ -0,0 +1,11 @@ +CONFIG_EXAMPLE_USE_INTERNAL_ETHERNET=y +CONFIG_EXAMPLE_ETH_PHY_IP101=y +CONFIG_EXAMPLE_ETH_MDC_GPIO=23 +CONFIG_EXAMPLE_ETH_MDIO_GPIO=18 +CONFIG_EXAMPLE_ETH_PHY_RST_GPIO=5 +CONFIG_EXAMPLE_ETH_PHY_ADDR=1 + +CONFIG_ETH_ENABLED=y +CONFIG_ETH_USE_ESP32_EMAC=y +CONFIG_ETH_PHY_INTERFACE_RMII=y +CONFIG_ETH_RMII_CLK_INPUT=y