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. 廖雪峰python3练习题一

    数据类型和变量 题目: 答案: print(123) print(456.789) print('\'Hello,world\'') print('\'Hello,\\\'Adam\\\'\'') p ...

  2. HDU 1995 汉诺塔V (水题)

    题意:.. 析:2^n-i 代码如下: #pragma comment(linker, "/STACK:1024000000,1024000000") #include <c ...

  3. E20180403-hm

    accompany vt. 陪伴,陪同; 附加,补充; 与…共存; 为…伴奏 synchronous adj. 同时存在[发生]的,同步的 asynchronous adj. 异步的; particu ...

  4. SDUT2161:Simple Game(NIM博弈+巴什博弈)

    传送门 题意 n堆石子,每次可以取一堆至三堆任意非零石子数,取完者赢,问最后谁能赢 分析 以前我们做过NIM博弈是对一堆进行操作,现在换成了三堆,其实对于n堆都一样一堆的情况 如果最后二进制每位数的1 ...

  5. bzoj 3238: [Ahoi2013]差异【SAM+树形dp】

    首先只有lcp(i,j)需要考虑 因为SAM的parent树是后缀的前缀的最长公共后缀(--),所以把这个串倒过来建SAM,这样就变成了求两个前缀的最长公共后缀,长度就是这两个前缀在parent树上的 ...

  6. 笔记-JavaWeb学习之旅2

    数据库的基本概念 1.数据库:DataBase 简称 DB,用于存储和管理数据的仓库 特点: 1.持久化存储数据的,其实数据库就是一个文件系统, 2.方便存储和管理数据 3.使用了统一操作数据库 -- ...

  7. JQuery动态添加表格,然后动态删除不成功问题

    背景: 自己做了一个测试网页,想动态添加表格,然后删除,按照网上的教程写完,发现点击"删除参数"按钮没用 源码: function addtr() { var trinfo = & ...

  8. hdu 1558 Segment set 计算几何+并查集★

    #include <cstdio> #include <iostream> #include <string.h> using namespace std; ; # ...

  9. SQL - 单引号和双引号的区别

    原文转载至:SQL中的单引号和双引号有区别吗? 在标准 SQL 中,字符串使用的是单引号. 如果字符串本身也包括单引号,则使用两个单引号(注意,不是双引号,字符串中的双引号不需要另外转义). 但在其它 ...

  10. mybaits 连接数据库汉字保存乱码??

    查看数据库连接地址: jdbc.url=jdbc:mysql://localhost:3306/az?useUnicode=true&characterEncoding=utf-8 多了一个a ...