Embedded Debug Tools
The emdbg library connects several software and hardware debugging tools together in a user friendly Python package to more easily enable advanced use cases for ARM Cortex-M microcontrollers and related devices.
The library orchestrates the launch and configuration of hardware debug and trace probes, debuggers, logic analyzers, and waveform generators and provides analysis tools, converters, and plugins to provide significant insight into the software and hardware state during or after execution.
The main focus of this project is the debugging of the PX4 Autopilot firmware running the NuttX RTOS on STM32 microcontrollers on the FMUv5x and FMUv6x hardware inside the Auterion Skynode. However, the library is modular and the tools are generic so that it can also be used for other firmware either out-of-box or with small adaptations.
emdbg is maintained by @niklaut from Auterion.
Features
- Debug Probes: SWD and ITM/DWT over SWO.
- SEGGER J-Link: BASE Compact (3MB/s), EDU Mini.
- STMicro STLink-v3 MINIE: (2MB/s).
- Orbcode ORBTrace mini: SWO (6MB/s).
- Coredump via CrashDebug with support for PX4 Hardfault logs.
- Trace Probes: ITM/DWT/ETM over TRACE.
- Orbcode ORBTrace mini: (50MB/s).
- GDB Debugger.
- Automatic management of debug probe drivers.
- Remote interfacing via GDB/MI and RPyC.
- Plugins via GDB Python API.
- User commands for PX4 and NuttX.
- Hardfault trapping with immediate backtrace.
- Real-time instrumentation using ITM/DWT.
- Visualization of entire RTOS state via perfetto.
- Nanosecond resolution with very little runtime overhead.
- Real-time instruction trace using ETM.
- Visualization of callstacks via perfetto.
- Generation of metrics from trace via PerfettoSQL.
- Patch Manager for out-of-tree modifications.
- Power Switch.
- Yocto USB Relay.
- Logic Analyzer and Waveform Generator.
- Digilent Analog Discovery 2 via Python API.
- Glasgow Digital Interface Explorer (planned).
- Serial Protocols.
- NuttX NSH command prompt.
- Hardware configuration.
A number of GDB and NSH scripting examples for test automation can be found in
the scripts folder.
Presentations
Sorted in reverse chronological order.
Utilizing Instruction Tracing to Analyze PX4 at Runtime
Presented at Auterion by Lukas von Briel on 2024-10-31.
Analyzing Cortex-M Firmware with the Perfetto Trace Processor
Presented at emBO++ by Niklas Hauser on 2024-03-15.
Debugging PX4
Presented at the PX4 Developer Summit by Niklas Hauser on 2023-10-22.
Debugging and Profiling NuttX and PX4
Presented at the NuttX International Workshop by Niklas Hauser on 2023-09-29.
Debugging Microcontrollers
Presented at Chaos Communication Camp by Niklas Hauser on 2023-08-18.
Installation
The latest version is hosted on PyPi and can be installed via pip:
pip3 install emdbg
You also need to install other command line tools depending on what you use:
- Debugger:
arm-none-eabi-gdb-py3. - Debug probes: J-Link, OpenOCD, CrashDebug.
- Analysis: graphviz
Usage
Most modules have their own command-line interface. This library therefore has
many entry points which can be called using python3 -m emdbg.{module}.
The individual command line usage is documented in each module.
The most important modules are emdbg.debug.gdb and emdbg.bench.fmu:
For example, launching GDB with TUI using a J-Link debug probe:
python3 -m emdbg.debug.gdb --elf path/to/firmware.elf --ui=tui jlink -device STM32F765II
Documentation
Most important user guides are available as Markdown files in the repository. You can browse the latest API documentation online at auterion.github.io/embedded-debug-tools.
Development
For development, checkout the repository locally, then install with the -e
flag, which symlinks the relevant files into the package path:
cd embedded-debug-tools
pip3 install -e ".[all]"
You can also work on the documentation locally via pdoc:
pdoc emdbg
# pdoc server ready at http://localhost:8080
Metadata
Release files for emdbg 1.8.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| emdbg-1.8.1.tar.gz | 417.6 kB | With provenance | Details for emdbg-1.8.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| emdbg-1.8.1-py3-none-any.whl | Python 3 | none | any | Details for emdbg-1.8.1-py3-none-any.whl |
Total release size: 882.6 kB
Release files / emdbg-1.8.1.tar.gz
| Download URL | emdbg-1.8.1.tar.gz |
|---|---|
| Size | 417.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
aa211dbb3ae75e890a9dc82e3c3ae49e595aee5b576f7d8f5575209442c0ea1d
|
|
BLAKE2b-256 checksum How to use checksums |
316f51931d51d2dc435674784e32450c7d9eebb4ed8499a477a5224e2f2fa321
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 2, 2025.
Transparency logRelease files / emdbg-1.8.1-py3-none-any.whl
| Download URL | emdbg-1.8.1-py3-none-any.whl |
|---|---|
| Size | 465.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5564595a134d3b2be2ff2f2c9c639abae3db3f531a5cbb1649db58b63aae68b9
|
|
BLAKE2b-256 checksum How to use checksums |
3c256d1ae785e4fd20a2a7b412c0cfba8611d4aaa88b6e50e0a94cae585fa897
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 2, 2025.
Transparency logSecurity for emdbg 1.8.1
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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for emdbg-1.8.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Dec 2, 2025.
Transparency logA 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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.