GithubHelp home page GithubHelp logo

hybridgroup / pycortexmdebug Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bnahill/pycortexmdebug

0.0 2.0 0.0 136 KB

A set of GDB/Python-based utilities to make life debugging ARM Cortex M processors a bit easier

License: GNU General Public License v3.0

Python 100.00%

pycortexmdebug's Introduction

PyCortexMDebug

A set of GDB/Python-based utilities to make life debugging ARM Cortex-M processors a bit easier

It will consist of several modules which will hopefully become integrated as they evolve. Presently, there is only one:

SVD

ARM defines an SVD (System View Description) file format in its CMSIS standard as a means for Cortex-M-based chip manufacturers to provide a common description of peripherals, registers, and register fields. You can download SVD files for different manufacturers here.

I originally tested primarily with ST parts, then Freescale for a while. Now many vendor parts have been tested, each with their own quirks. If you run into a file that doesn't parse right, either make an issue and ask for help or fix it and push a patch.

The implementation consists of two components -- An lxml-based parser module (svd.py) and a GDB file (svd_gdb). I haven't yet worked out a perfect workflow for this, though it's quite easy to use when you already tend to have a GDB initialization file for starting up OpenOCD and the like. However your workflow works, just make sure to, in GDB:

source gdb_svd.py
svd_load [your_svd_file].svd

These files can be huge so it might take a second or two. Anyways, after that, you can do

svd

to list available peripherals with descriptions. Or you can do

svd [some_peripheral_name]

to see all of the registers (with their values) for a given peripheral. For more details, run

svd [some_peripheral_name] [some_register_name]

to see all of the field values with descriptions.

You can add format modifiers like:

  • svd/x will display values in hex
  • svd/o will display values in octal
  • svd/t or svd/b will display values in binary
  • svd/a will display values in hex and try to resolve symbols from the values

All field values are displayed at the correct lengths as provided by the SVD files. Also, tab completion exists for nearly everything! When in doubt, run svd help.

TODO

Update this with instructions that match what it can actually do now...

DWT

The ARM Data Watchpoint and Trace Unit (DWT) offers data watchpoints and a series of gated cycle counters. For now, I only support the raw cycle counter but facilities are in place to make use of others. As this is independent of the specific device under test, commands are simple and you can configure a clock speed to get real time values from counters.

dwt configclk 48000000

will set the current core clock speed. Then

dwt cyccnt reset
dwt cyccnt enable

will reset and start the cycle counter. At any point

dwt cycnt

will then indicate the number of cycles and amount of time that has passed.

ITM/ETM support

This is not implemented yet. I want to have more complete support for some of the nicer debug and trace features on Cortex-M processors. Parts of this will probably be dependent on OpenOCD and possibly on specific interfaces. I'll try to avoid this where possible but can't make any promises.

pycortexmdebug's People

Contributors

bnahill avatar carlnorum avatar tannewt avatar dkm avatar wose avatar tom-van avatar augustofg avatar schultetwin avatar grevaillot avatar looran avatar

Watchers

James Cloos avatar  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.