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. centos6.5下忘记mysql密码

    1.此方式会使得服务器处于不安全的情况,请尽量保证在安全的环境下进行,因为,此方式,会使得任何人任意地连接MySQL数据库. 2.#vim /etc/my.cnf 在[mysqld]的段中,加上ski ...

  2. Android之APP模块编译

    一,如何把app编进系统 a.源码编译,在packages/apps目录下有安卓原生的app,以Bluetooth为例,源码根目录下有Android.mk文件: packages\apps\Bluet ...

  3. centos7命令行模式安装&&配置_br0+kvm+虚拟机+添加硬盘+快照及恢复

    KVM创建虚拟机步骤 Submitted by zhaoley on October 18, 2016 - 10:43am 测试环境: 1: 43.243.130.89, CentOS Linux r ...

  4. 详述IntelliJ IDEA插件的安装及使用方法(图解)

    intellij idea是一款非常优秀的软件开发工具,它拥有这强大的插件体系,可以帮助开发者完成很多重量级的功能.今天,我们来学习一下如何安装和卸载intellij idea的插件. Intelli ...

  5. 【197】PowerShell 通过 FTP 下载文件

    参考:使用 WGET 从FTP上下载文件 在 PowerShell 使用 wget2 工具,代码如下: wget2 ftp://user:password@192.168.14.31/1.jpg 其中 ...

  6. div 加滚动条的方法

    div 加滚动条的方法: <div style="position:absolute; height:400px; overflow:auto"></div> ...

  7. 洛谷 - P1987 - 摇钱树 - dp - 贪心

    https://www.luogu.org/problemnew/show/P1987 这道题,假如是n==k,也就是把所有的树都砍完,我就知道要贪心去做,因为树给的初始金币是固定的,每天掉金币,当然 ...

  8. 786. K-th Smallest Prime Fraction

    A sorted list A contains 1, plus some number of primes.  Then, for every p < q in the list, we co ...

  9. gets,gets_s,fgets函数

    这次就说一下,gets(),gets_s(),fgets(),::::[在某一篇博客上看到的] C的标准库gets函数不对接受字符串的buffer进行边界检测,会造成越界,从而产生bug: fgets ...

  10. hdoj【1006】【未完待续】

    题意: 时钟的三个指针在两两之间至少D°的时候是开心的,求开心时间占一天的一个百分比. 思路: 我们看到这个百分比有三位小数,精度很高. 一天有24h,24*60min,24*60*60s,那么最小单 ...