Keil Debug (printf) Viewer

摘要:
调试(printf)查看器主页视图窗口调试(printd)查看器调试(printe)查看器窗口显示通过ITMStimulusPort0顺序传输的数据流。启用ITMStimusPort0
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.

Debug Viewer Window

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
    ", 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.

    ITM Stimulus Port 0

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

Keil Debug (printf) Viewer第3张 Note

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

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

免责声明:文章转载自《Keil Debug (printf) Viewer》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇使用jxls技术导入Excel模版数据(转自其他博客)淘宝网Open API 入门教程下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

1-stm32工程建立(Kil自带库工程建立)

1-keil自带库工程建立 在建立之前需要安装Keil对应的芯片支持包pack①可以在keil的pack installer上安装②也可以在keil 官网上下载后导入到keil的pack installer里面STM32PACK包下载的地址http://www.keil.com/dd2/pack/ ①首先新建一个文件夹fourrotor(名字随意),然后打...

Linux 系统编程 学习:3-进程间通信1:Unix IPC(2)信号

背景 上一讲我们介绍了Unix IPC中的2种管道。 回顾一下上一讲的介绍,IPC的方式通常有: Unix IPC包括:管道(pipe)、命名管道(FIFO)与信号(Signal) System V IPC:消息队列、信号量、共享内存 Socket(支持不同主机上的两个进程IPC) 我们在这一讲介绍Unix IPC,中有关信号(Signal)的处理。...

在C#中什么时候用分号?

1、在函数体,也就是 { } 这个大括号里的东西,函数调用声明和定义自变量结束时需要加分号 函数声明:比如intmax(a,b,c); 定义自变量:比如floatx,y; 2、在一句话结束时必须加分号(分号用于结束完成的语句) 比如输入输出函数:printf("a word "); scanf("a"); 3、函数的赋值结束后必加分号 比如c=a*b;...

MAC地址记录与重复检测系统

一、通信模块如WiFi、Zigbee都会有唯一的MAC地址,这些模块在出厂前需要一套系统来确保唯一性。 此套MAC地址记录与重复检测系统已经经过KK级的出货验证,难有漏网之鱼。 二、系统设计思路: 客户端程序读取模块MAC地址,然后去pass数据库中寻找是否已经存在,如果不存在,则将此MAC存到pass数据库中,显示PASS,如果已经存在,证明已经生产过了...

符号表示

%d 十进制有符号整数    %u 十进制无符号整数    %f 浮点数    %s 字符串     (是指的输出字符串,在printf中能够输出字符串的值,后面的参数为 “数组的指针”)     举例: #include<stdio.h>struct student{ char a[20]; char id[20];             ...

Linux上shell脚本,字符串转ASCII码

  在shell脚本里,将字符串转ASCII码的方法: [keysystem@localhost ~]$ printf "%d" "'A" 65 [keysystem@localhost ~]$ printf "%d" "'0" 48   在shell脚本里,将字符串转10进制转16进制的方法: [keysystem@localhost ~]$ print...