Make pytest-embedded plugin work with JTAG.
Actively maintained. Last release 1 day ago, commits in 13 of the last 26 weeks. A safe choice.
$
pip install pytest-embedded-jtagREADME as published on PyPI with version 2.11.1.
pytest-embedded-jtag
A pytest-embedded service for hardware debugging via OpenOCD and GDB.
Service Activation
Activate this service by passing jtag to --embedded-services:
pytest --embedded-services serial,jtag --app-path /path/to/app
Extra Functionalities
openocdFixture: Launches and manages an OpenOCD background process. Supports sending commands over the OpenOCD Telnet port.gdbFixture: Launches and manages a GDB process connected to the target debugger.- Output Duplication: Duplicates both OpenOCD and GDB output streams into
dut.pexpect_procfor unified log matching.
CLI Options
--openocd-prog-path: Path to the OpenOCD executable. Default:"openocd".--openocd-cli-args: Arguments passed to OpenOCD. Default:"-f board/esp32-wrover-kit-3.3v.cfg".--gdb-prog-path: Path to the architecture-specific GDB executable. Default:"xtensa-esp32-elf-gdb".--gdb-cli-args: Arguments passed to GDB. Default:"--quiet".--no-gdb: Set toTrueto skip creating the GDB instance when only OpenOCD is needed. Default:False.
Quick Example
from pytest_embedded import Dut
from pytest_embedded_jtag import Gdb, OpenOcd
def test_jtag_debugging(dut: Dut, openocd: OpenOcd, gdb: Gdb):
gdb.write('target remote :3333')
gdb.expect('Remote debugging using :3333')
gdb.write('monitor reset halt')
dut.expect('Target halted')