fix(console): fixed secondary console not working on all chips without VFS

This commit is contained in:
Marius Vikhammer
2025-08-22 09:38:46 +08:00
parent ac1fdc16d3
commit 00f4245160
28 changed files with 161 additions and 42 deletions
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
# SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: CC0-1.0
import pexpect
import pytest
@@ -41,43 +41,11 @@ def test_esp_system_console_no_output_uart(dut: Dut) -> None:
'port, flash_port, config',
[
pytest.param('/dev/serial_ports/ttyACM-esp32', '/dev/serial_ports/ttyUSB-esp32', 'serial_jtag_only', marks=JTAG_SERIAL_MARKS),
pytest.param('/dev/serial_ports/ttyACM-esp32', '/dev/serial_ports/ttyUSB-esp32', 'serial_jtag_only_no_vfs', marks=JTAG_SERIAL_MARKS),
pytest.param('/dev/serial_ports/ttyACM-esp32', '/dev/serial_ports/ttyUSB-esp32', 'console_no_vfs', marks=JTAG_SERIAL_MARKS),
],
indirect=True,
)
def test_esp_system_console_only_serial_jtag(dut: Dut) -> None:
dut.expect('2nd stage bootloader')
dut.expect('Hello World')
dut.expect('Opening /dev/console')
dut.expect('This should be printed to stdout')
dut.expect('Closing /dev/console')
dut.expect('This should be printed to stdout')
@pytest.mark.usb_serial_jtag
@pytest.mark.parametrize(
'port, flash_port, config',
[
pytest.param('/dev/serial_ports/ttyACM-esp32', '/dev/serial_ports/ttyUSB-esp32', 'serial_jtag_only_no_vfs', marks=JTAG_SERIAL_MARKS),
],
indirect=True,
)
def test_esp_system_console_only_serial_jtag_no_vfs(dut: Dut) -> None:
dut.expect('2nd stage bootloader')
dut.expect('Hello World')
@pytest.mark.generic
@pytest.mark.parametrize(
'config',
[
pytest.param('simple', marks=pytest.mark.supported_targets),
],
indirect=True
)
def test_esp_system_console_correct_open_and_close(dut: Dut) -> None:
dut.expect('2nd stage bootloader')
dut.expect('Hello World')
dut.expect('Opening /dev/console')
dut.expect('This should be printed to stdout')
dut.expect('Closing /dev/console')
dut.expect('This should be printed to stdout')
@@ -0,0 +1,3 @@
CONFIG_VFS_SUPPORT_IO=n
CONFIG_ESP_CONSOLE_UART_DEFAULT=y
CONFIG_ESP_CONSOLE_SECONDARY_USB_SERIAL_JTAG=y