diff --git a/examples/peripherals/.build-test-rules.yml b/examples/peripherals/.build-test-rules.yml index 74c011aa178..976237d3e3f 100644 --- a/examples/peripherals/.build-test-rules.yml +++ b/examples/peripherals/.build-test-rules.yml @@ -810,9 +810,6 @@ examples/peripherals/uart/uart_echo_rs485: examples/peripherals/usb/device: disable: - if: SOC_USB_OTG_SUPPORTED != 1 - - if: IDF_TARGET == "esp32s31" - temporary: true - reason: USB device examples do not support esp32s31 yet disable_test: - if: IDF_TARGET not in ["esp32s2", "esp32p4"] temporary: true @@ -834,9 +831,6 @@ examples/peripherals/usb/device/cherryusb_serial_device: examples/peripherals/usb/device/tusb_ncm: disable: - if: SOC_USB_OTG_SUPPORTED != 1 or SOC_WIFI_SUPPORTED != 1 - - if: IDF_TARGET == "esp32s31" - temporary: true - reason: USB device examples do not support esp32s31 yet disable_test: - if: IDF_TARGET not in ["esp32s2"] temporary: true diff --git a/examples/peripherals/usb/README.md b/examples/peripherals/usb/README.md index b3000ffbb89..45da1d1a5fc 100644 --- a/examples/peripherals/usb/README.md +++ b/examples/peripherals/usb/README.md @@ -25,5 +25,6 @@ ESP BOARD USB CONNECTOR (type A) | ESP32-P4 2.0 | pin 50 | pin 49 | | ESP32-P4 1.1 | GPIO27 | GPIO26 | | ESP32-H4 | GPIO22 | GPIO21 | +| ESP32-S31 | pin 44 | pin 45 | -> Note: On the ESP32-P4, the USB 2.0 PHY pins are dedicated to USB-OTG functionality and cannot be used as general-purpose GPIOs. +> Note: On the ESP32-P4 and ESP32-S31, the USB 2.0 PHY pins are dedicated to USB-OTG functionality and cannot be used as general-purpose GPIOs. ESP32-S31 only supports the USB 2.0 PHY. diff --git a/examples/peripherals/usb/device/tusb_composite_msc_serialdevice/README.md b/examples/peripherals/usb/device/tusb_composite_msc_serialdevice/README.md index 8747380d167..5eac81ae3bd 100644 --- a/examples/peripherals/usb/device/tusb_composite_msc_serialdevice/README.md +++ b/examples/peripherals/usb/device/tusb_composite_msc_serialdevice/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32-H4 | ESP32-P4 | ESP32-S2 | ESP32-S3 | -| ----------------- | -------- | -------- | -------- | -------- | +| Supported Targets | ESP32-H4 | ESP32-P4 | ESP32-S2 | ESP32-S3 | ESP32-S31 | +| ----------------- | -------- | -------- | -------- | -------- | --------- | # TinyUSB Composite Device (MSC + Serial) Example diff --git a/examples/peripherals/usb/device/tusb_composite_msc_serialdevice/pytest_usb_device_composite.py b/examples/peripherals/usb/device/tusb_composite_msc_serialdevice/pytest_usb_device_composite.py index 47551908295..5a3a7ec9e01 100644 --- a/examples/peripherals/usb/device/tusb_composite_msc_serialdevice/pytest_usb_device_composite.py +++ b/examples/peripherals/usb/device/tusb_composite_msc_serialdevice/pytest_usb_device_composite.py @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: 2023-2025 Espressif Systems (Shanghai) CO LTD +# SPDX-FileCopyrightText: 2023-2026 Espressif Systems (Shanghai) CO LTD # SPDX-License-Identifier: CC0-1.0 from time import sleep @@ -9,9 +9,9 @@ from serial import Serial from serial.tools.list_ports import comports -@pytest.mark.temp_skip_ci(targets=['esp32s3'], reason='lack of runners with usb_device tag') +@pytest.mark.temp_skip_ci(targets=['esp32s3', 'esp32s31'], reason='lack of runners with usb_device tag') @pytest.mark.usb_device -@idf_parametrize('target', ['esp32s2', 'esp32s3', 'esp32p4'], indirect=['target']) +@idf_parametrize('target', ['esp32s2', 'esp32s3', 'esp32p4', 'esp32s31'], indirect=['target']) def test_usb_composite_device_serial_example(dut: Dut) -> None: dut.expect_exact('Hello World!') dut.expect_exact('USB Composite initialization') diff --git a/examples/peripherals/usb/device/tusb_console/README.md b/examples/peripherals/usb/device/tusb_console/README.md index 6d5900884b8..3ddeb281268 100644 --- a/examples/peripherals/usb/device/tusb_console/README.md +++ b/examples/peripherals/usb/device/tusb_console/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32-H4 | ESP32-P4 | ESP32-S2 | ESP32-S3 | -| ----------------- | -------- | -------- | -------- | -------- | +| Supported Targets | ESP32-H4 | ESP32-P4 | ESP32-S2 | ESP32-S3 | ESP32-S31 | +| ----------------- | -------- | -------- | -------- | -------- | --------- | # TinyUSB Sample Descriptor diff --git a/examples/peripherals/usb/device/tusb_console/pytest_usb_device_console.py b/examples/peripherals/usb/device/tusb_console/pytest_usb_device_console.py index 8860dbff925..0089515c548 100644 --- a/examples/peripherals/usb/device/tusb_console/pytest_usb_device_console.py +++ b/examples/peripherals/usb/device/tusb_console/pytest_usb_device_console.py @@ -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: CC0-1.0 from time import sleep @@ -9,9 +9,9 @@ from serial import Serial from serial.tools.list_ports import comports -@pytest.mark.temp_skip_ci(targets=['esp32s3'], reason='lack of runners with usb_device tag') +@pytest.mark.temp_skip_ci(targets=['esp32s3', 'esp32s31'], reason='lack of runners with usb_device tag') @pytest.mark.usb_device -@idf_parametrize('target', ['esp32s2', 'esp32s3', 'esp32p4'], indirect=['target']) +@idf_parametrize('target', ['esp32s2', 'esp32s3', 'esp32p4', 'esp32s31'], indirect=['target']) def test_usb_device_console_example(dut: Dut) -> None: dut.expect_exact('USB initialization DONE') dut.expect_exact('example: log -> UART') diff --git a/examples/peripherals/usb/device/tusb_hid/README.md b/examples/peripherals/usb/device/tusb_hid/README.md index 66e02acad94..417d8ddfda0 100644 --- a/examples/peripherals/usb/device/tusb_hid/README.md +++ b/examples/peripherals/usb/device/tusb_hid/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32-H4 | ESP32-P4 | ESP32-S2 | ESP32-S3 | -| ----------------- | -------- | -------- | -------- | -------- | +| Supported Targets | ESP32-H4 | ESP32-P4 | ESP32-S2 | ESP32-S3 | ESP32-S31 | +| ----------------- | -------- | -------- | -------- | -------- | --------- | # TinyUSB Human Interface Device Example diff --git a/examples/peripherals/usb/device/tusb_hid/pytest_usb_device_hid.py b/examples/peripherals/usb/device/tusb_hid/pytest_usb_device_hid.py index 986b293fe85..ae419997253 100644 --- a/examples/peripherals/usb/device/tusb_hid/pytest_usb_device_hid.py +++ b/examples/peripherals/usb/device/tusb_hid/pytest_usb_device_hid.py @@ -1,13 +1,13 @@ -# SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD +# SPDX-FileCopyrightText: 2022-2026 Espressif Systems (Shanghai) CO LTD # SPDX-License-Identifier: CC0-1.0 import pytest from pytest_embedded import Dut from pytest_embedded_idf.utils import idf_parametrize -@pytest.mark.temp_skip_ci(targets=['esp32s3'], reason='lack of runners with usb_device tag') +@pytest.mark.temp_skip_ci(targets=['esp32s3', 'esp32s31'], reason='lack of runners with usb_device tag') @pytest.mark.usb_device -@idf_parametrize('target', ['esp32s2', 'esp32s3', 'esp32p4'], indirect=['target']) +@idf_parametrize('target', ['esp32s2', 'esp32s3', 'esp32p4', 'esp32s31'], indirect=['target']) def test_usb_device_hid_example(dut: Dut) -> None: dut.expect_exact('USB initialization DONE') dut.expect_exact('Sending Keyboard report') diff --git a/examples/peripherals/usb/device/tusb_midi/README.md b/examples/peripherals/usb/device/tusb_midi/README.md index b2b3d9d845b..640b9ee73e4 100644 --- a/examples/peripherals/usb/device/tusb_midi/README.md +++ b/examples/peripherals/usb/device/tusb_midi/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32-H4 | ESP32-P4 | ESP32-S2 | ESP32-S3 | -| ----------------- | -------- | -------- | -------- | -------- | +| Supported Targets | ESP32-H4 | ESP32-P4 | ESP32-S2 | ESP32-S3 | ESP32-S31 | +| ----------------- | -------- | -------- | -------- | -------- | --------- | # TinyUSB MIDI Device Example diff --git a/examples/peripherals/usb/device/tusb_midi/pytest_usb_device_midi.py b/examples/peripherals/usb/device/tusb_midi/pytest_usb_device_midi.py index 9c6a5762467..df5351294b2 100644 --- a/examples/peripherals/usb/device/tusb_midi/pytest_usb_device_midi.py +++ b/examples/peripherals/usb/device/tusb_midi/pytest_usb_device_midi.py @@ -1,13 +1,13 @@ -# SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD +# SPDX-FileCopyrightText: 2022-2026 Espressif Systems (Shanghai) CO LTD # SPDX-License-Identifier: CC0-1.0 import pytest from pytest_embedded import Dut from pytest_embedded_idf.utils import idf_parametrize -@pytest.mark.temp_skip_ci(targets=['esp32s3'], reason='lack of runners with usb_device tag') +@pytest.mark.temp_skip_ci(targets=['esp32s3', 'esp32s31'], reason='lack of runners with usb_device tag') @pytest.mark.usb_device -@idf_parametrize('target', ['esp32s2', 'esp32s3', 'esp32p4'], indirect=['target']) +@idf_parametrize('target', ['esp32s2', 'esp32s3', 'esp32p4', 'esp32s31'], indirect=['target']) def test_usb_device_midi_example(dut: Dut) -> None: dut.expect_exact('USB initialization DONE') dut.expect_exact('MIDI write task init') diff --git a/examples/peripherals/usb/device/tusb_msc/README.md b/examples/peripherals/usb/device/tusb_msc/README.md index 207e1de948c..7454130be00 100644 --- a/examples/peripherals/usb/device/tusb_msc/README.md +++ b/examples/peripherals/usb/device/tusb_msc/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32-H4 | ESP32-P4 | ESP32-S2 | ESP32-S3 | -| ----------------- | -------- | -------- | -------- | -------- | +| Supported Targets | ESP32-H4 | ESP32-P4 | ESP32-S2 | ESP32-S3 | ESP32-S31 | +| ----------------- | -------- | -------- | -------- | -------- | --------- | # TinyUSB Mass Storage Device Example diff --git a/examples/peripherals/usb/device/tusb_msc/pytest_usb_device_msc.py b/examples/peripherals/usb/device/tusb_msc/pytest_usb_device_msc.py index 3503b0e62db..d037020b42a 100644 --- a/examples/peripherals/usb/device/tusb_msc/pytest_usb_device_msc.py +++ b/examples/peripherals/usb/device/tusb_msc/pytest_usb_device_msc.py @@ -1,13 +1,13 @@ -# SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD +# SPDX-FileCopyrightText: 2022-2026 Espressif Systems (Shanghai) CO LTD # SPDX-License-Identifier: CC0-1.0 import pytest from pytest_embedded import Dut from pytest_embedded_idf.utils import idf_parametrize -@pytest.mark.temp_skip_ci(targets=['esp32s3'], reason='lack of runners with usb_device tag') +@pytest.mark.temp_skip_ci(targets=['esp32s3', 'esp32s31'], reason='lack of runners with usb_device tag') @pytest.mark.usb_device -@idf_parametrize('target', ['esp32s2', 'esp32s3', 'esp32p4'], indirect=['target']) +@idf_parametrize('target', ['esp32s2', 'esp32s3', 'esp32p4', 'esp32s31'], indirect=['target']) def test_usb_device_msc_example(dut: Dut) -> None: dut.expect('Mount storage') dut.expect('TinyUSB Driver installed') diff --git a/examples/peripherals/usb/device/tusb_ncm/README.md b/examples/peripherals/usb/device/tusb_ncm/README.md index 66e6d6b2e81..0b910ddc105 100644 --- a/examples/peripherals/usb/device/tusb_ncm/README.md +++ b/examples/peripherals/usb/device/tusb_ncm/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32-S2 | ESP32-S3 | -| ----------------- | -------- | -------- | +| Supported Targets | ESP32-S2 | ESP32-S3 | ESP32-S31 | +| ----------------- | -------- | -------- | --------- | # TinyUSB Network Control Model Device Example diff --git a/examples/peripherals/usb/device/tusb_ncm/pytest_usb_device_ncm.py b/examples/peripherals/usb/device/tusb_ncm/pytest_usb_device_ncm.py index c3828531c8a..20c6966330d 100644 --- a/examples/peripherals/usb/device/tusb_ncm/pytest_usb_device_ncm.py +++ b/examples/peripherals/usb/device/tusb_ncm/pytest_usb_device_ncm.py @@ -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: CC0-1.0 import subprocess import time @@ -8,9 +8,9 @@ from pytest_embedded import Dut from pytest_embedded_idf.utils import idf_parametrize -@pytest.mark.temp_skip_ci(targets=['esp32s3'], reason='lack of runners with usb_device tag') +@pytest.mark.temp_skip_ci(targets=['esp32s3', 'esp32s31'], reason='lack of runners with usb_device tag') @pytest.mark.usb_device -@idf_parametrize('target', ['esp32s2', 'esp32s3'], indirect=['target']) +@idf_parametrize('target', ['esp32s2', 'esp32s3', 'esp32s31'], indirect=['target']) def test_usb_device_ncm_example(dut: Dut) -> None: netif_mac = dut.expect( r'Network interface HW address: ' @@ -26,6 +26,6 @@ def test_usb_device_ncm_example(dut: Dut) -> None: print('expected network interface HW address: ', netif_mac) print('ifconfig command output:\n', out_str) if netif_mac in out_str: - print("NCM device's MAC address {} was found in system network interfaces".format(netif_mac)) + print(f"NCM device's MAC address {netif_mac} was found in system network interfaces") else: raise AssertionError('NCM device not found in network interface list') diff --git a/examples/peripherals/usb/device/tusb_serial_device/README.md b/examples/peripherals/usb/device/tusb_serial_device/README.md index 10a62aced3d..aa0ebbe45ff 100644 --- a/examples/peripherals/usb/device/tusb_serial_device/README.md +++ b/examples/peripherals/usb/device/tusb_serial_device/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32-H4 | ESP32-P4 | ESP32-S2 | ESP32-S3 | -| ----------------- | -------- | -------- | -------- | -------- | +| Supported Targets | ESP32-H4 | ESP32-P4 | ESP32-S2 | ESP32-S3 | ESP32-S31 | +| ----------------- | -------- | -------- | -------- | -------- | --------- | # TinyUSB Serial Device Example diff --git a/examples/peripherals/usb/device/tusb_serial_device/pytest_usb_device_serial.py b/examples/peripherals/usb/device/tusb_serial_device/pytest_usb_device_serial.py index 0f54f382b12..82ff4f5bf41 100644 --- a/examples/peripherals/usb/device/tusb_serial_device/pytest_usb_device_serial.py +++ b/examples/peripherals/usb/device/tusb_serial_device/pytest_usb_device_serial.py @@ -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: CC0-1.0 from time import sleep @@ -9,9 +9,9 @@ from serial import Serial from serial.tools.list_ports import comports -@pytest.mark.temp_skip_ci(targets=['esp32s3'], reason='lack of runners with usb_device tag') +@pytest.mark.temp_skip_ci(targets=['esp32s3', 'esp32s31'], reason='lack of runners with usb_device tag') @pytest.mark.usb_device -@idf_parametrize('target', ['esp32s2', 'esp32s3', 'esp32p4'], indirect=['target']) +@idf_parametrize('target', ['esp32s2', 'esp32s3', 'esp32p4', 'esp32s31'], indirect=['target']) def test_usb_device_serial_example(dut: Dut) -> None: dut.expect_exact('USB initialization DONE') sleep(2) # Some time for the OS to enumerate our USB device