Skip to main content

Typed, async-first Python bindings for the full OpenOCD command surface

Project description

openocd-python

Typed, async-first Python bindings for the full OpenOCD command surface.

Install

pip install openocd-python

Quick Start

from openocd import Session

# Connect to a running OpenOCD instance
async with Session.connect() as ocd:
    state = await ocd.target.halt()
    pc = await ocd.registers.pc()
    mem = await ocd.memory.read_u32(0x08000000, 4)
    print(f"PC: {pc:#x}")

# Or spawn OpenOCD and connect
async with Session.start("interface/cmsis-dap.cfg -f target/stm32f1x.cfg") as ocd:
    await ocd.target.halt()
    regs = await ocd.registers.read_all()

# Synchronous API available too
with Session.start_sync("interface/cmsis-dap.cfg") as ocd:
    ocd.target.halt()
    print(f"PC: {ocd.registers.pc():#x}")

Features

  • Async-first with sync wrappers for every method
  • Typed returns — dataclasses, not raw strings
  • Full OpenOCD surface: target control, memory, registers, flash, JTAG, breakpoints, RTT
  • SVD decoding — read a peripheral register and get named bitfields
  • Process management — spawn and manage OpenOCD subprocesses
  • Dual transport — TCL RPC (primary) and telnet (fallback)

Requirements

  • Python 3.11+
  • OpenOCD installed and on PATH (or pass openocd_bin=)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openocd_python-2026.2.12.tar.gz (57.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

openocd_python-2026.2.12-py3-none-any.whl (43.8 kB view details)

Uploaded Python 3

File details

Details for the file openocd_python-2026.2.12.tar.gz.

File metadata

  • Download URL: openocd_python-2026.2.12.tar.gz
  • Upload date:
  • Size: 57.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"EndeavourOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for openocd_python-2026.2.12.tar.gz
Algorithm Hash digest
SHA256 e1b03e7b72e3a4cbfe2121ca740e37bbae277f4d3d327790db2243a1885aefdb
MD5 a887aacf6d347a6046e1de74c2ecd672
BLAKE2b-256 4c1204096023bf2ff2f9fc0192541fa3bf46e89f1cfafadfed9a4cc79cae9771

See more details on using hashes here.

File details

Details for the file openocd_python-2026.2.12-py3-none-any.whl.

File metadata

  • Download URL: openocd_python-2026.2.12-py3-none-any.whl
  • Upload date:
  • Size: 43.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"EndeavourOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for openocd_python-2026.2.12-py3-none-any.whl
Algorithm Hash digest
SHA256 cba8949de86eda6c8cb92bd1b4eeba75fdd2849d4ed4bc69ae90c2395b8a82e5
MD5 f7c449c176c806ce8f0f7c379e48a6c8
BLAKE2b-256 edee161827580ffda6bc7bec37c96c378dda039ca6d45962747ee257db54461f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page