Skip to main content

MXDBG

ESP32-S3 multi-interface debugger host library — control I2C / PWM / SPI / GPIO peripherals and flash firmware over USB CDC, with no local ESP-IDF toolchain required.

中文文档 · English Docs · Changelog · License: Apache-2.0

Features

  • One-click firmware flashing — bundled firmware binaries, no ESP-IDF / compilation needed
  • Interactive safety — confirm before flashing; choose the target when multiple ESP32s are connected
  • Multi-bus support — I2C, SPI, GPIO, PWM over the virtual serial port (USB CDC)
  • ExtBoard support — v0.1 / v0.2.1 expansion boards (level-shifted I/O, power control, expand I/O)
  • Cross-platform — Windows / macOS / Linux
  • Hardware — ESP32-S3-Pico

Installation

pip install mxdbg

Python 3.10+. The package bundles prebuilt firmware, so flashing works out of the box.

Command-Line Interface

mxdbg scan                 # list detected ESP32 devices
mxdbg info                 # show connected device version / ExtBoard
mxdbg flash                # flash firmware (confirm, choose device if multiple)
mxdbg flash -p /dev/ttyACM0 --yes   # specify port, skip confirmation

Quick Start

from mxdbg import MXDBG

dev = MXDBG()                      # auto-detect ESP32 and connect
print(dev.version)

# GPIO
dev.gpio_config(pin=33, mode=dev.gpio_mode["GPIO_MODE_OUTPUT"], pull_up=True, pull_down=False)
dev.gpio_write_read(33, 1)         # set pin 33 high

# I2C
dev.i2c_config(freq=100000, port=0)
ret, data = dev.i2c_write_read(slave_id=0x50, write_list=[0x00], read_length=1, port=0)

# SPI
dev.spi_config(freq=1000000, mode=3)
ret, data = dev.spi_write_read([0x01], 1)

# PWM
dev.pwm_config(pin=16, freq=361, duty=0.5, channel=0)
dev.pwm_run_stop(True, channel=0)

Flash Firmware (no ESP-IDF needed)

from mxdbg import MXDBG

dev = MXDBG()
ret, msg = dev.flash_firmware()    # confirm (y/N), choose device if multiple
print(ret, msg)
  • Flashing asks for confirmation first; pass confirm=False for scripts
  • When multiple ESP32 devices are detected, you choose which to flash
  • The serial port is released before flashing; the device resets afterwards — create a new MXDBG() instance before further use
  • USB-UART bridges (CH340/FT232/CP2102) and specific devices: MXDBG(port="/dev/ttyUSB0") / flash_firmware(port="...")
  • Linux: add your user to the dialout group (sudo usermod -aG dialout $USER, re-login) for serial access

APIs

API Description
i2c_config / i2c_write_read / i2c_find_slave I2C configuration, read/write, bus scan
spi_config / spi_write_read / spi_read_image SPI configuration, half/full-duplex transfer
gpio_config / gpio_write_read GPIO mode / pull-up / level
pwm_config / pwm_run_stop PWM frequency / duty cycle
usb_config USB CDC CRC toggle
power_init / power_control ExtBoard power control
expand_io_init / expand_io_config / expand_io_write_read ExtBoard expand I/O
restart / get_extboard_version Device reset / ExtBoard version

Full Documentation

License

Apache-2.0

Metadata

Release files for mxdbg 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for mxdbg 0.3.0
File Interpreter ABI Platform
mxdbg-0.3.0-py3-none-any.whl Python 3 none any Details

Release files / mxdbg-0.3.0-py3-none-any.whl

Download URL mxdbg-0.3.0-py3-none-any.whl
Size 205.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
03817774958b85c6f9faab5ddef7dc3a049e4478dbea0d67b59383d6fbbeda3a
BLAKE2b-256 checksum
How to use checksums
59d798e230265ee517b51c94b1058afee633b96122a58ea0f8b5d1108ea03892
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Security for mxdbg 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page