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.15.tar.gz (65.5 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.15-py3-none-any.whl (48.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: openocd_python-2026.2.15.tar.gz
  • Upload date:
  • Size: 65.5 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.15.tar.gz
Algorithm Hash digest
SHA256 500ef78ab1e7789f473760c4d778c74063d006d71175afa1e386f808716ee318
MD5 8b6fd39761f4e3fc391e7cd6938a61cf
BLAKE2b-256 8906b1c1022575b6d1df2a815b328c5e9e7d1453bdc2bdedad6ecd6c175e1abc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: openocd_python-2026.2.15-py3-none-any.whl
  • Upload date:
  • Size: 48.4 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.15-py3-none-any.whl
Algorithm Hash digest
SHA256 04de1d7afdde40bc21983271fff07400ec8d1f3592399a7e517ba2c05b2ecf4a
MD5 fa678305a3677301876e2928e277c465
BLAKE2b-256 23924671b4a5e206a0a2c1367c58402cac49d27d2ea020c14561f0faedb6b18c

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