Coder Social home page Coder Social logo

mi-aiot / embedded-debug-tools Goto Github PK

View Code? Open in Web Editor NEW

This project forked from auterion/embedded-debug-tools

1.0 0.0 0.0 4.28 MB

Tools for debugging and profiling ARM Cortex-M devices as found on the PX4 Autopilot FMU boards

Home Page: https://pypi.org/project/emdbg/

License: BSD 3-Clause "New" or "Revised" License

Shell 0.09% C++ 17.98% Python 66.19% C 2.14% CMake 0.14% GDB 13.08% Meson 0.37%

embedded-debug-tools's Introduction

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.
  • 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 of memories and peripherals.
      • GPIO state visualization.
      • Backtrace generation.
      • Register state visualization using SVD files.
      • Register access watching and difference visualization.
    • Hardfault trapping with immediate backtrace.
  • Real-time instrumentation using ITM/DWT.
    • Up to 2MB/s SWO capture via STLinkv3, 3MB/s via JLink.
    • Visualization of task switching and interrupts via perfetto.
    • Latency measurement of scheduler and task priorities.
    • Heap usage tracking via malloc, free, realloc, alignmem.
    • 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.

Presentations

Debugging Microcontrollers

Presented at Chaos Communication Camp by Niklas Hauser on 2023-08-18.

Debugging and Profiling NuttX and PX4

Presented at the NuttX International Workshop by Niklas Hauser on 2023-09-29.

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

embedded-debug-tools's People

Contributors

niklaut avatar

Stargazers

Quard avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.