Debug (printf) Viewer

Home » µVision Windows » Debug (printf) Viewer

The Debug (printf) Viewer window displays data streams that are transmitted sequentially through the ITM Stimulus Port 0. Enable ITM Stimulus Port 0.

To use the Debug (printf) Viewer for tracing:

  1. Add ITM Port register definitions to your source code.

    #define ITM_Port8(n)    (*((volatile unsigned char *)(0xE0000000+4*n)))
    #define ITM_Port16(n) (*((volatile unsigned short*)(0xE0000000+4*n)))
    #define ITM_Port32(n) (*((volatile unsigned long *)(0xE0000000+4*n))) #define DEMCR (*((volatile unsigned long *)(0xE000EDFC)))
    #define TRCENA 0x01000000
  2. Add an fputc function to your source code that writes to the ITM Port 0 register. The fputc function enables printf to output messages.
    struct __FILE { int handle; /* Add whatever you need here */ };
    FILE __stdout;
    FILE __stdin; int fputc(int ch, FILE *f) {
    if (DEMCR & TRCENA) {
    while (ITM_Port32(0) == 0);
    ITM_Port8(0) = ch;
    }
    return(ch);
    }
  3. Add your debugging trace messages to your source code using printf.
    printf("AD value = 0x%04X\r\n", AD_value);
    
  4. Set the ITM Port 0 to capture the information. Clear the Port 7..0 privilege bit to access ITM Port 0 from User mode.

  5. Open the View - Serial Windows - Debug (printf) Viewer window.

 Note

http://www.keil.com/support/man/docs/jlink/jlink_trace_itm_viewer.htm

https://www.douban.com/note/248637026/

Keil Debug (printf) Viewer的更多相关文章

  1. Keil ARM-CM3 printf输出调试信息到Debug (printf) Viewer

    参考资料:http://www.keil.com/support/man/docs/jlink/jlink_trace_itm_viewer.htm 1.Target Options -> De ...

  2. ST Debug (printf) Viewer for Jlink

    Debug (printf) Viewer http://www.keil.com/support/man/docs/uv4/uv4_db_dbg_serialwin.htm Serial Windo ...

  3. MDK Debug (printf) Viewer打印数据

    1.Target Options -> Debug -> Settings(JLink) -> Debug里ort选择SW模式 2.在Target Options -> Deb ...

  4. Keil debug command SAVE 命令保存文件的解析

    简介 使用 Keil debug 很方便,把内存中的一段区域 dump 出来也很方便,例如使用命令 SAVE filepath startAddr, endAddr, typeCode .但是要查看 ...

  5. Keil stm32 printf到Debug窗口

    使用JlinkV8+Keil41.在main.c输入以下代码 #include <stdio.h> #define ITM_Port8(n) (*((volatile unsigned c ...

  6. (Keil) Debug & Simulation 操作

    0x00 printf在MCU環境下print debug error message,利用Logic Analyzer模擬MCU register or GPIO狀態. 若是要要使用printf函數 ...

  7. KEIL C51 printf格式化输出特殊用法

    作者:dragoniye   发布:2014-02-15 12:44   分类:硬件     抢沙发   /*******************************************KEI ...

  8. [Keil 学习] printf, scanf函数的用法

    C语言库函数中有一批"标准输入输出函数",它是以标准的输入输出设备(一般为终端设备)为输入输出对象的,其中用得比较多的是printf和scanf函数了. 在嵌入式设备中加入C语言的 ...

  9. 【转】keil+stm32+jlink利用swd方式进行printf输出

    出处:http://www.douban.com/note/248637026/ ----------------------------------------------------------- ...

随机推荐

  1. linux的存储结构

    在linux中存储结构如下: Linux系统中的文件存储结构 那么在linux中每个目录都是什么含义呢 在linux中相对路径和绝对路径是必须要了解的一个概念 绝对路径(absolute path): ...

  2. nable to load bean: type:com.opensymphony.xwork2.util.ValueStackFactory

    严重: Exception starting filter struts2 Unable to load bean: type:com.opensymphony.xwork2.util.ValueSt ...

  3. vs2008打开类视图,看不到类的解决方法

    去工程文件中删除ncb文件,重新打开工程

  4. B - Soldier and Badges

    Time Limit:3000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u Description Colone ...

  5. UILabel和UIButton添加下划线

    关于UILabel和UIButton有的时候需要添加下划线,一般有两种方式通过默认的 NSMutableAttributedString设置,第二种就是在drawRect中画一条下划线,本文就简单的选 ...

  6. noip 2018 Day2 T1 旅行

    暴力删边,暴力枚举 #include <bits/stdc++.h> using namespace std; #define MAXM 5010 inline int read() { ...

  7. 组合数学1.4&3.10 By cellur925

    本文引用于清华大学出版社卢开澄.卢华明<组合数学第五版>. 今天我们稍微讨论下圆排列以及$n$对夫妻的问题. 1.4圆周排列 这个问题是:从$n$个人中取$r$个在圆周上,我们用$Q(n, ...

  8. 开发者神器!Windows上最强大的虚拟桌面工具-Dexpot

    简介 : 用过Linux和Mac计算机的人都知道 , 这两个系统上都有个多桌面的功能非常使用 . 而在Windows上并没有该项功能 , 虽然目前Win10已经增加了多桌面的程序 , 但使用上仍体验不 ...

  9. Java | 基础归纳 | set

    用于存储无序(存入和取出的顺序不一定相同)元素,值不能重复.

  10. win操作系统段和分页机制