Giter Site home page Giter Site logo

swv's Introduction

swv

Nodejs library that can parse SWV trace output.

How to install SWV

Prerequisite is nodejs.

$ git clone https://github.com/phryniszak/swv.git
$ cd swv
$ npm install

It installs only one additional library minimist, needed to parse app arguments.

Parse file

Create trace file using openocd:

tpiu config internal itm.fifo uart off 170000000

and trace output:

$ node index.js --path itm.fifo

Connect to pipe

Reading via a named pipe works well on POSIX machines; e.g. Linux or macOS, but not Windows.

$ mkfifo /tmp/itm.fifo
$ node index.js --path /tmp/itm.fifo --type pipe

This will create a named pipe: /tmp/itm.fifo. Then start openocd directing output to pipe:

tpiu config internal /tmp/itm.fifo uart off 170000000

Connect to socket

Start openocd with redirecting trace output to TCP server

tpiu config internal :3344 uart off 170000000

And start app passing port number:

node index.js --port 3344 --type socket

Connect to serial port

TODO:

Merging traces

Library attempts to merge trace packet in logical chunks, but in some cases, like trace without timestamp this functionality may fail. Passing --nomerge forces library to disable merging.

Example app output

{
  _: [],
  port: 3344,
  type: 'socket',
  path: 'itm.fifo',
  host: 'localhost'
}
connected
TraceITMEvent {
  _desc: 'itm',
  _timestamp: 1480586,
  _port: 1,
  _data: 15,
  _width: 1
}
TraceITMEvent {
  _desc: 'itm',
  _timestamp: 1480638,
  _port: 2,
  _data: 15,
  _width: 1
}

ACKNOWLEDGMENTS

ITM decoder is taken from pyocd and converted from python to js with few modification. Some inspiration also from Cortex Debug

swv's People

Contributors

phryniszak avatar

Watchers

 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.