Skip to main content

Embedded Debug Tools

Project description

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.
  • Trace Probes: ITM/DWT/ETM over TRACE (planned).
  • 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.
      • Task information.
      • Task switching to inspect call stack.
      • Coredumping.
      • GPIO state visualization.
      • Backtrace generation.
      • Register state visualization using SVD files.
      • Register access watching and difference visualization.
  • Real-time instrumentation using ITM/DWT (prototyped).
    • Up to 2MB/s SWO capture via STLinkv3.
    • Visualization of task switching and interrupts via perfetto.
    • Latency measurement of scheduler and task priorities.
    • Nanosecond resolution with very little runtime overhead.
  • Patch Manager for out-of-tree modifications.
  • Power Switch.
    • Yocto USB Relay.
  • Logic Analyzer and Waveform Generator.
  • 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.

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:

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 API documentation locally using the pdoc library:

pdoc emdbg
# pdoc server ready at http://localhost:8080

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]"

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

emdbg-1.0.2.tar.gz (386.6 kB view details)

Uploaded Source

Built Distribution

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

emdbg-1.0.2-py3-none-any.whl (427.5 kB view details)

Uploaded Python 3

File details

Details for the file emdbg-1.0.2.tar.gz.

File metadata

  • Download URL: emdbg-1.0.2.tar.gz
  • Upload date:
  • Size: 386.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for emdbg-1.0.2.tar.gz
Algorithm Hash digest
SHA256 f4e09cb4cade7309a199ca958b7126c227768b427acf737e5f4e3337ae079b81
MD5 cebaf0439f978e95ccaa399b860ff687
BLAKE2b-256 593107605edec1a4a190ef50538acb482c8fa6be23297da072dd848ea3c73f22

See more details on using hashes here.

File details

Details for the file emdbg-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: emdbg-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 427.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for emdbg-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a70a6e550bf10c40fb67d33922499959dff7eab69137fa74773c966f28676974
MD5 90947e890cda61d12327c9ae2ee28847
BLAKE2b-256 cedcdd3f0ba0131685f3a5c8e56a7e5e206f3a0a66e1d97b2a9f8223151698d0

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