emdbg


Nameemdbg JSON
Version 1.7.0 PyPI version JSON
download
home_pageNone
SummaryEmbedded Debug Tools
upload_time2024-11-29 16:07:36
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseBSD-3-Clause
keywords embedded debug gdb stm32 px4
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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](https://github.com/niklaut) from
[Auterion](https://auterion.com).

## Features

- Debug Probes: SWD and ITM/DWT over SWO.
    - [SEGGER J-Link](https://www.segger.com/products/debug-probes/j-link/): BASE Compact (3MB/s), EDU Mini.
    - [STMicro STLink-v3 MINIE](https://www.st.com/en/development-tools/stlink-v3minie.html): (2MB/s).
    - [Orbcode ORBTrace mini](https://orbcode.org/orbtrace-mini): SWO (6MB/s).
    - Coredump via [CrashDebug](https://github.com/adamgreen/CrashDebug) with support for PX4 Hardfault logs.
- Trace Probes: ITM/DWT/ETM over TRACE.
    - [Orbcode ORBTrace mini](https://orbcode.org/orbtrace-mini): (50MB/s).
- [GDB Debugger](https://developer.arm.com/Tools%20and%20Software/GNU%20Toolchain).
    - Automatic management of debug probe drivers.
    - Remote interfacing via [GDB/MI](https://github.com/cs01/pygdbmi) and RPyC.
    - Plugins via [GDB Python API](https://sourceware.org/gdb/onlinedocs/gdb/Python-API.html).
    - [User commands for PX4 and NuttX](https://auterion.github.io/embedded-debug-tools/emdbg/debug/gdb.html#user-commands).
    - Hardfault trapping with immediate backtrace.
- [Real-time instrumentation using ITM/DWT](https://github.com/Auterion/embedded-debug-tools/blob/main/ext/orbetto).
    - Visualization of entire RTOS state via [perfetto](https://perfetto.dev).
    - Nanosecond resolution with very little runtime overhead.
- [Real-time instruction trace using ETM](https://github.com/Auterion/embedded-debug-tools/blob/main/ext/orbetto/src/TRACE.md).
    - Visualization of callstacks via [perfetto](https://perfetto.dev).
    - Generation of [metrics from trace via PerfettoSQL](https://github.com/Auterion/embedded-debug-tools/blob/main/ext/orbetto/metrics/METRICS.md).
- Patch Manager for out-of-tree modifications.
- Power Switch.
    - Yocto USB Relay.
- Logic Analyzer and Waveform Generator.
    - [Digilent Analog Discovery 2](https://digilent.com/reference/test-and-measurement/analog-discovery-2/start) via Python API.
    - [Glasgow Digital Interface Explorer](https://glasgow-embedded.org/) (planned).
- Serial Protocols.
    - NuttX NSH command prompt.
- Hardware configuration.
    - [FMUv5x and FMUv6x](https://docs.px4.io/main/en/flight_controller/autopilot_pixhawk_standard.html).

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](https://auterion.com) by [Lukas von Briel](https://www.linkedin.com/in/lvb2000) on 2024-10-31.

<a href="https://www.youtube.com/watch?v=sJ5pnPrWA30"><img src="https://i.ytimg.com/vi/sJ5pnPrWA30/maxresdefault.jpg" width="100%"/></a>

[Slides with Notes](https://salkinium.com/talks/auterion24_instruction_tracing.pdf).

### Analyzing Cortex-M Firmware with the Perfetto Trace Processor

Presented at [emBO++](https://embo.io) by Niklas Hauser on 2024-03-15.

<a href="https://www.youtube.com/watch?v=FIStxUz2ERY&t=108s"><img src="https://i.ytimg.com/vi/FIStxUz2ERY/maxresdefault.jpg" width="100%"/></a>

[Slides with Notes](https://salkinium.com/talks/embo24_perfetto.pdf).

### Debugging PX4

Presented at the [PX4 Developer Summit](https://events.linuxfoundation.org/px4-developer-summit) by Niklas Hauser on 2023-10-22.

<a href="https://www.youtube.com/watch?v=1c4TqEn3MZ0"><img src="https://i.ytimg.com/vi/1c4TqEn3MZ0/maxresdefault.jpg" width="100%"/></a>

[Slides with Notes](https://salkinium.com/talks/px4summit23_debugging_px4.pdf).

### Debugging and Profiling NuttX and PX4

Presented at the [NuttX International Workshop](https://events.nuttx.apache.org/index.php/nuttx-international-workshop-2023) by Niklas Hauser on 2023-09-29.

<a href="https://www.youtube.com/watch?v=_k1f4F2JVBA"><img src="https://i3.ytimg.com/vi/_k1f4F2JVBA/maxresdefault.jpg" width="100%"/></a>

### Debugging Microcontrollers

Presented at [Chaos Communication Camp](https://events.ccc.de/camp/2023/) by Niklas Hauser on 2023-08-18.

<a href="https://media.ccc.de/v/camp2023-57321-debugging_microcontrollers"><img src="https://static.media.ccc.de/media/conferences/camp2023/57321-4a4f8363-865f-52b7-b236-3b9b73aa2ad7_preview.jpg" width="100%"/></a>

[Slides with Notes](https://salkinium.com/talks/cccamp23_debugging_microcontrollers.pdf).

## Installation

The latest version is hosted on PyPi and can be installed via pip:

```sh
pip3 install emdbg
```

You also need to install other command line tools depending on what you use:

- Debugger: [`arm-none-eabi-gdb-py3`](https://auterion.github.io/embedded-debug-tools/emdbg/debug/gdb.html#installation).
- Debug probes: [J-Link](https://auterion.github.io/embedded-debug-tools/emdbg/debug/jlink.html#installation),
                [OpenOCD](https://auterion.github.io/embedded-debug-tools/emdbg/debug/openocd.html#installation),
                [CrashDebug](https://auterion.github.io/embedded-debug-tools/emdbg/debug/crashdebug.html#installation).
- Analysis: [graphviz](https://auterion.github.io/embedded-debug-tools/emdbg/analyze/callgraph.html#installation)


## 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:

```sh
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](https://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:

```sh
cd embedded-debug-tools
pip3 install -e ".[all]"
```

You can also work on the documentation locally via `pdoc`:

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

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "emdbg",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "embedded, debug, gdb, stm32, px4",
    "author": null,
    "author_email": "Auterion <success@auterion.com>",
    "download_url": "https://files.pythonhosted.org/packages/6e/85/81280c12aa7b619d8d357346af0a5ffeb239c202918a6fe25c926dc1d98e/emdbg-1.7.0.tar.gz",
    "platform": null,
    "description": "# Embedded Debug Tools\n\nThe emdbg library connects several software and hardware debugging tools\ntogether in a user friendly Python package to more easily enable advanced use\ncases for ARM Cortex-M microcontrollers and related devices.\n\nThe library orchestrates the launch and configuration of hardware debug and\ntrace probes, debuggers, logic analyzers, and waveform generators and provides\nanalysis tools, converters, and plugins to provide significant insight into the\nsoftware and hardware state during or after execution.\n\nThe main focus of this project is the debugging of the PX4 Autopilot firmware\nrunning the NuttX RTOS on STM32 microcontrollers on the FMUv5x and FMUv6x\nhardware inside the Auterion Skynode. However, the library is modular and the\ntools are generic so that it can also be used for other firmware either\nout-of-box or with small adaptations.\n\nemdbg is maintained by [@niklaut](https://github.com/niklaut) from\n[Auterion](https://auterion.com).\n\n## Features\n\n- Debug Probes: SWD and ITM/DWT over SWO.\n    - [SEGGER J-Link](https://www.segger.com/products/debug-probes/j-link/): BASE Compact (3MB/s), EDU Mini.\n    - [STMicro STLink-v3 MINIE](https://www.st.com/en/development-tools/stlink-v3minie.html): (2MB/s).\n    - [Orbcode ORBTrace mini](https://orbcode.org/orbtrace-mini): SWO (6MB/s).\n    - Coredump via [CrashDebug](https://github.com/adamgreen/CrashDebug) with support for PX4 Hardfault logs.\n- Trace Probes: ITM/DWT/ETM over TRACE.\n    - [Orbcode ORBTrace mini](https://orbcode.org/orbtrace-mini): (50MB/s).\n- [GDB Debugger](https://developer.arm.com/Tools%20and%20Software/GNU%20Toolchain).\n    - Automatic management of debug probe drivers.\n    - Remote interfacing via [GDB/MI](https://github.com/cs01/pygdbmi) and RPyC.\n    - Plugins via [GDB Python API](https://sourceware.org/gdb/onlinedocs/gdb/Python-API.html).\n    - [User commands for PX4 and NuttX](https://auterion.github.io/embedded-debug-tools/emdbg/debug/gdb.html#user-commands).\n    - Hardfault trapping with immediate backtrace.\n- [Real-time instrumentation using ITM/DWT](https://github.com/Auterion/embedded-debug-tools/blob/main/ext/orbetto).\n    - Visualization of entire RTOS state via [perfetto](https://perfetto.dev).\n    - Nanosecond resolution with very little runtime overhead.\n- [Real-time instruction trace using ETM](https://github.com/Auterion/embedded-debug-tools/blob/main/ext/orbetto/src/TRACE.md).\n    - Visualization of callstacks via [perfetto](https://perfetto.dev).\n    - Generation of [metrics from trace via PerfettoSQL](https://github.com/Auterion/embedded-debug-tools/blob/main/ext/orbetto/metrics/METRICS.md).\n- Patch Manager for out-of-tree modifications.\n- Power Switch.\n    - Yocto USB Relay.\n- Logic Analyzer and Waveform Generator.\n    - [Digilent Analog Discovery 2](https://digilent.com/reference/test-and-measurement/analog-discovery-2/start) via Python API.\n    - [Glasgow Digital Interface Explorer](https://glasgow-embedded.org/) (planned).\n- Serial Protocols.\n    - NuttX NSH command prompt.\n- Hardware configuration.\n    - [FMUv5x and FMUv6x](https://docs.px4.io/main/en/flight_controller/autopilot_pixhawk_standard.html).\n\nA number of GDB and NSH scripting examples for test automation can be found in\nthe `scripts` folder.\n\n\n## Presentations\n\nSorted in reverse chronological order.\n\n### Utilizing Instruction Tracing to Analyze PX4 at Runtime\n\nPresented at [Auterion](https://auterion.com) by [Lukas von Briel](https://www.linkedin.com/in/lvb2000) on 2024-10-31.\n\n<a href=\"https://www.youtube.com/watch?v=sJ5pnPrWA30\"><img src=\"https://i.ytimg.com/vi/sJ5pnPrWA30/maxresdefault.jpg\" width=\"100%\"/></a>\n\n[Slides with Notes](https://salkinium.com/talks/auterion24_instruction_tracing.pdf).\n\n### Analyzing Cortex-M Firmware with the Perfetto Trace Processor\n\nPresented at [emBO++](https://embo.io) by Niklas Hauser on 2024-03-15.\n\n<a href=\"https://www.youtube.com/watch?v=FIStxUz2ERY&t=108s\"><img src=\"https://i.ytimg.com/vi/FIStxUz2ERY/maxresdefault.jpg\" width=\"100%\"/></a>\n\n[Slides with Notes](https://salkinium.com/talks/embo24_perfetto.pdf).\n\n### Debugging PX4\n\nPresented at the [PX4 Developer Summit](https://events.linuxfoundation.org/px4-developer-summit) by Niklas Hauser on 2023-10-22.\n\n<a href=\"https://www.youtube.com/watch?v=1c4TqEn3MZ0\"><img src=\"https://i.ytimg.com/vi/1c4TqEn3MZ0/maxresdefault.jpg\" width=\"100%\"/></a>\n\n[Slides with Notes](https://salkinium.com/talks/px4summit23_debugging_px4.pdf).\n\n### Debugging and Profiling NuttX and PX4\n\nPresented at the [NuttX International Workshop](https://events.nuttx.apache.org/index.php/nuttx-international-workshop-2023) by Niklas Hauser on 2023-09-29.\n\n<a href=\"https://www.youtube.com/watch?v=_k1f4F2JVBA\"><img src=\"https://i3.ytimg.com/vi/_k1f4F2JVBA/maxresdefault.jpg\" width=\"100%\"/></a>\n\n### Debugging Microcontrollers\n\nPresented at [Chaos Communication Camp](https://events.ccc.de/camp/2023/) by Niklas Hauser on 2023-08-18.\n\n<a href=\"https://media.ccc.de/v/camp2023-57321-debugging_microcontrollers\"><img src=\"https://static.media.ccc.de/media/conferences/camp2023/57321-4a4f8363-865f-52b7-b236-3b9b73aa2ad7_preview.jpg\" width=\"100%\"/></a>\n\n[Slides with Notes](https://salkinium.com/talks/cccamp23_debugging_microcontrollers.pdf).\n\n## Installation\n\nThe latest version is hosted on PyPi and can be installed via pip:\n\n```sh\npip3 install emdbg\n```\n\nYou also need to install other command line tools depending on what you use:\n\n- Debugger: [`arm-none-eabi-gdb-py3`](https://auterion.github.io/embedded-debug-tools/emdbg/debug/gdb.html#installation).\n- Debug probes: [J-Link](https://auterion.github.io/embedded-debug-tools/emdbg/debug/jlink.html#installation),\n                [OpenOCD](https://auterion.github.io/embedded-debug-tools/emdbg/debug/openocd.html#installation),\n                [CrashDebug](https://auterion.github.io/embedded-debug-tools/emdbg/debug/crashdebug.html#installation).\n- Analysis: [graphviz](https://auterion.github.io/embedded-debug-tools/emdbg/analyze/callgraph.html#installation)\n\n\n## Usage\n\nMost modules have their own command-line interface. This library therefore has\nmany entry points which can be called using `python3 -m emdbg.{module}`.\nThe individual command line usage is documented in each module.\nThe most important modules are `emdbg.debug.gdb` and `emdbg.bench.fmu`:\n\nFor example, launching GDB with TUI using a J-Link debug probe:\n\n```sh\npython3 -m emdbg.debug.gdb --elf path/to/firmware.elf --ui=tui jlink -device STM32F765II\n```\n\n\n## Documentation\n\nMost important user guides are available as Markdown files in the repository.\nYou can browse the latest API documentation online at\n[auterion.github.io/embedded-debug-tools](https://auterion.github.io/embedded-debug-tools).\n\n\n## Development\n\nFor development, checkout the repository locally, then install with the `-e`\nflag, which symlinks the relevant files into the package path:\n\n```sh\ncd embedded-debug-tools\npip3 install -e \".[all]\"\n```\n\nYou can also work on the documentation locally via `pdoc`:\n\n```sh\npdoc emdbg\n# pdoc server ready at http://localhost:8080\n```\n",
    "bugtrack_url": null,
    "license": "BSD-3-Clause",
    "summary": "Embedded Debug Tools",
    "version": "1.7.0",
    "project_urls": {
        "Changelog": "https://github.com/auterion/embedded-debug-tools/blob/main/CHANGELOG.md",
        "Docs": "https://auterion.github.io/embedded-debug-tools/emdbg.html",
        "GitHub": "https://github.com/auterion/embedded-debug-tools"
    },
    "split_keywords": [
        "embedded",
        " debug",
        " gdb",
        " stm32",
        " px4"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3f766fa6e878373c10adef59fbdc72916f4023758be4dae3145f93998a2cf28f",
                "md5": "69881560ca5c6afad4215c29900f2055",
                "sha256": "9490b542d2502752764b3dab1db20963be9c82e6551b6817651fe1d1a36151c7"
            },
            "downloads": -1,
            "filename": "emdbg-1.7.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "69881560ca5c6afad4215c29900f2055",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 460540,
            "upload_time": "2024-11-29T16:07:32",
            "upload_time_iso_8601": "2024-11-29T16:07:32.597615Z",
            "url": "https://files.pythonhosted.org/packages/3f/76/6fa6e878373c10adef59fbdc72916f4023758be4dae3145f93998a2cf28f/emdbg-1.7.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6e8581280c12aa7b619d8d357346af0a5ffeb239c202918a6fe25c926dc1d98e",
                "md5": "f67b02ab0e62bdb94fb37f5f66d8e20a",
                "sha256": "cea573063557fc2ff75c39489054008efd87dacbd14104a095d0379821541524"
            },
            "downloads": -1,
            "filename": "emdbg-1.7.0.tar.gz",
            "has_sig": false,
            "md5_digest": "f67b02ab0e62bdb94fb37f5f66d8e20a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 413785,
            "upload_time": "2024-11-29T16:07:36",
            "upload_time_iso_8601": "2024-11-29T16:07:36.869108Z",
            "url": "https://files.pythonhosted.org/packages/6e/85/81280c12aa7b619d8d357346af0a5ffeb239c202918a6fe25c926dc1d98e/emdbg-1.7.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-29 16:07:36",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "auterion",
    "github_project": "embedded-debug-tools",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "emdbg"
}
        
Elapsed time: 9.14109s