emdbg


Nameemdbg JSON
Version 1.5.2 PyPI version JSON
download
home_pageNone
SummaryEmbedded Debug Tools
upload_time2024-04-26 15:36:02
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).
    - [SEGGER J-Trace](https://www.segger.com/products/debug-probes/j-trace/models/j-trace/): (>100MB/s) (planned).
- [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://github.com/Auterion/embedded-debug-tools/blob/main/src/emdbg/debug/gdb.md#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.
- 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.
    - [Sigrok](https://sigrok.org/wiki/Main_Page) (prototyped).
    - Visualization via [perfetto](https://perfetto.dev) (prototyped).
- 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.

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

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

[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.

[![](https://i.ytimg.com/vi/1c4TqEn3MZ0/maxresdefault.jpg)](https://www.youtube.com/watch?v=1c4TqEn3MZ0)

[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.

[![](https://i3.ytimg.com/vi/_k1f4F2JVBA/maxresdefault.jpg)](https://www.youtube.com/watch?v=_k1f4F2JVBA)

### Debugging Microcontrollers

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

[![](https://static.media.ccc.de/media/conferences/camp2023/57321-4a4f8363-865f-52b7-b236-3b9b73aa2ad7_preview.jpg)](https://media.ccc.de/v/camp2023-57321-debugging_microcontrollers)

[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://github.com/Auterion/embedded-debug-tools/blob/main/src/emdbg/debug/gdb.md#installation).
- Debug probes: [J-Link](https://github.com/Auterion/embedded-debug-tools/blob/main/src/emdbg/debug/jlink.md#installation),
                [OpenOCD](https://github.com/Auterion/embedded-debug-tools/blob/main/src/emdbg/debug/openocd.md#installation),
                [CrashDebug](https://github.com/Auterion/embedded-debug-tools/blob/main/src/emdbg/debug/crashdebug.md#installation).
- Analysis: [graphviz](https://github.com/Auterion/embedded-debug-tools/blob/main/src/emdbg/analyze/callgraph.md#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 API documentation locally using the `pdoc` library:

```sh
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:

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

            

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/b0/ac/96ef3ae8b03b3fdd6237a8291d09e54c69785d47fd66a3eb79d38ac4aaab/emdbg-1.5.2.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    - [SEGGER J-Trace](https://www.segger.com/products/debug-probes/j-trace/models/j-trace/): (>100MB/s) (planned).\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://github.com/Auterion/embedded-debug-tools/blob/main/src/emdbg/debug/gdb.md#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- 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    - [Sigrok](https://sigrok.org/wiki/Main_Page) (prototyped).\n    - Visualization via [perfetto](https://perfetto.dev) (prototyped).\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### Analyzing Cortex-M Firmware with the Perfetto Trace Processor\n\nPresented at [emBO++](http://embo.io) by Niklas Hauser on 2024-03-15.\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[![](https://i.ytimg.com/vi/1c4TqEn3MZ0/maxresdefault.jpg)](https://www.youtube.com/watch?v=1c4TqEn3MZ0)\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[![](https://i3.ytimg.com/vi/_k1f4F2JVBA/maxresdefault.jpg)](https://www.youtube.com/watch?v=_k1f4F2JVBA)\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[![](https://static.media.ccc.de/media/conferences/camp2023/57321-4a4f8363-865f-52b7-b236-3b9b73aa2ad7_preview.jpg)](https://media.ccc.de/v/camp2023-57321-debugging_microcontrollers)\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://github.com/Auterion/embedded-debug-tools/blob/main/src/emdbg/debug/gdb.md#installation).\n- Debug probes: [J-Link](https://github.com/Auterion/embedded-debug-tools/blob/main/src/emdbg/debug/jlink.md#installation),\n                [OpenOCD](https://github.com/Auterion/embedded-debug-tools/blob/main/src/emdbg/debug/openocd.md#installation),\n                [CrashDebug](https://github.com/Auterion/embedded-debug-tools/blob/main/src/emdbg/debug/crashdebug.md#installation).\n- Analysis: [graphviz](https://github.com/Auterion/embedded-debug-tools/blob/main/src/emdbg/analyze/callgraph.md#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 API documentation locally using the `pdoc` library:\n\n```sh\npdoc emdbg\n# pdoc server ready at http://localhost:8080\n```\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",
    "bugtrack_url": null,
    "license": "BSD-3-Clause",
    "summary": "Embedded Debug Tools",
    "version": "1.5.2",
    "project_urls": {
        "Changelog": "https://github.com/auterion/embedded-debug-tools/blob/main/CHANGELOG.md",
        "GitHub": "https://github.com/auterion/embedded-debug-tools"
    },
    "split_keywords": [
        "embedded",
        " debug",
        " gdb",
        " stm32",
        " px4"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ec84e69efe76175af0b7e3f8c3519028e18a2236e566bb5c8f145870ba7a853f",
                "md5": "f5db1001b7366ab680c69093448a3292",
                "sha256": "ae91d664692d3c6412dbc60f32d6c8c3e10ee23c35677f5a4d1fb1371e5a3b1a"
            },
            "downloads": -1,
            "filename": "emdbg-1.5.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f5db1001b7366ab680c69093448a3292",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 455101,
            "upload_time": "2024-04-26T15:35:59",
            "upload_time_iso_8601": "2024-04-26T15:35:59.645676Z",
            "url": "https://files.pythonhosted.org/packages/ec/84/e69efe76175af0b7e3f8c3519028e18a2236e566bb5c8f145870ba7a853f/emdbg-1.5.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b0ac96ef3ae8b03b3fdd6237a8291d09e54c69785d47fd66a3eb79d38ac4aaab",
                "md5": "866ca2e14ed99d8f50ecb34bfbaeabf2",
                "sha256": "7987337c3daf44442a54b5aba0057f389651ca22ed44763b3f1b0a14fad4c78b"
            },
            "downloads": -1,
            "filename": "emdbg-1.5.2.tar.gz",
            "has_sig": false,
            "md5_digest": "866ca2e14ed99d8f50ecb34bfbaeabf2",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 408321,
            "upload_time": "2024-04-26T15:36:02",
            "upload_time_iso_8601": "2024-04-26T15:36:02.198109Z",
            "url": "https://files.pythonhosted.org/packages/b0/ac/96ef3ae8b03b3fdd6237a8291d09e54c69785d47fd66a3eb79d38ac4aaab/emdbg-1.5.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-26 15:36:02",
    "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: 0.28555s