Giter VIP home page Giter VIP logo

itm_viewer's Introduction

⚡ Check out my (german) remote talk about embedded development. We will start with a quick kick-start and get into debugging practices. Sign up here

ITM Viewer

ITM Viewer allows you to view the messages sent through the ARM ITM data channels.

The plugin is at the start of the development and some things may not work as stable as planned, so please use it with patience :)

ITM Viewer Plugin Demo

Getting Started

This plugin parses the TCL RPC Server output of openocd. In order to activate it you must activate the tcl server.

Prerequisites

  • openocd
  • CLion

Example config for STM32F746NG-Discovery:

source [find interface/stlink-v2-1.cfg]
transport select hla_swd
set WORKAREASIZE 0x40000

source [find target/stm32f7x.cfg]

# activate tcl server
tcl_port 6666
# for configuration please see §16.6.3 http://openocd.org/doc/html/Architecture-and-Core-Commands.html 
tpiu config internal - uart off 168000000
# activate ports (configurable)
itm port 24 on
itm port 25 on
itm port 26 on
itm port 27 on

And for the corresponding configuration in the CLion plugin config: ITM Viewer Plugin Configuration

Example

A minimal C example to send message via ITM (for STM32F746):

#define LOG_DEBUG_LEVEL 24
#define LOG_INFO_LEVEL 25
#define LOG_WARN_LEVEL 26
#define LOG_ERROR_LEVEL 27

#define LOG_DEBUG(msg) println(msg, LOG_DEBUG_LEVEL)
#define LOG_INFO(msg) println(msg, LOG_INFO_LEVEL)
#define LOG_WARN(msg) println(msg, LOG_WARN_LEVEL)
#define LOG_ERROR(msg) println(msg, LOG_ERROR_LEVEL)

void print(char _char, uint8_t level) {
    while (ITM->PORT[level].u32 == 0UL) {
        __NOP();
    }
    ITM->PORT[level].u8 = (uint8_t) _char;
}

void println(const char* msg, uint8_t level) {
    if(msg == NULL || level > 31) {
        return;
    }
    for(int i = 0; i<strlen(msg); i++) {
        print(msg[i], level);
    }
    print('\n', level);
}

void itm_test(void *pvParameters) {
    while(1) {
        LOG_INFO("Hello World!");
        vTaskDelay(1000); // or HAL_Delay
    }
}

Installing

JetBrains Plugin Repository

ITM Viewer is availabe in the JetBrains Plugin Repository https://plugins.jetbrains.com/plugin/14163-itm-viewer.

Manual

The plugin uses the jetbrains gradle plugin template. In order to build it you have to pull the dependencies and build the release version:

gradle buildPlugin

To install from disk follow this guide: here

The zipped plugin is also available under Github Releases

Authors

Thanks for the awesome work with cmake-conan that helped me get started.

Also big thanks to my colleagues at cosee for helping me out with the Java stuff :)

License

This project is licensed under the MIT License - see the License file for details

itm_viewer's People

Contributors

pperle avatar ramdadam 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.