Keil Debug (printf) Viewer
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:
- 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 - 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);
} - Add your debugging trace messages to your source code using printf.
printf("AD value = 0x%04X\r\n", AD_value);
- Set the ITM Port 0 to capture the information. Clear the Port 7..0 privilege bit to access ITM Port 0 from User mode.
- Open the View - Serial Windows - Debug (printf) Viewer window.
Note
- ITM Stimulus Ports can be monitored in the Instruction Trace Window, where ITM Port 0 is shown as well.
- Consult Configure Cortex-M Target of the MDK-Primer for information on how to retarget the output.
http://www.keil.com/support/man/docs/jlink/jlink_trace_itm_viewer.htm
https://www.douban.com/note/248637026/
Keil Debug (printf) Viewer的更多相关文章
- Keil ARM-CM3 printf输出调试信息到Debug (printf) Viewer
参考资料:http://www.keil.com/support/man/docs/jlink/jlink_trace_itm_viewer.htm 1.Target Options -> De ...
- ST Debug (printf) Viewer for Jlink
Debug (printf) Viewer http://www.keil.com/support/man/docs/uv4/uv4_db_dbg_serialwin.htm Serial Windo ...
- MDK Debug (printf) Viewer打印数据
1.Target Options -> Debug -> Settings(JLink) -> Debug里ort选择SW模式 2.在Target Options -> Deb ...
- Keil debug command SAVE 命令保存文件的解析
简介 使用 Keil debug 很方便,把内存中的一段区域 dump 出来也很方便,例如使用命令 SAVE filepath startAddr, endAddr, typeCode .但是要查看 ...
- Keil stm32 printf到Debug窗口
使用JlinkV8+Keil41.在main.c输入以下代码 #include <stdio.h> #define ITM_Port8(n) (*((volatile unsigned c ...
- (Keil) Debug & Simulation 操作
0x00 printf在MCU環境下print debug error message,利用Logic Analyzer模擬MCU register or GPIO狀態. 若是要要使用printf函數 ...
- KEIL C51 printf格式化输出特殊用法
作者:dragoniye 发布:2014-02-15 12:44 分类:硬件 抢沙发 /*******************************************KEI ...
- [Keil 学习] printf, scanf函数的用法
C语言库函数中有一批"标准输入输出函数",它是以标准的输入输出设备(一般为终端设备)为输入输出对象的,其中用得比较多的是printf和scanf函数了. 在嵌入式设备中加入C语言的 ...
- 【转】keil+stm32+jlink利用swd方式进行printf输出
出处:http://www.douban.com/note/248637026/ ----------------------------------------------------------- ...
随机推荐
- caffe从入门到放弃
断断续续折腾ML近一年,写点博客记录这个坑.
- 输出文章段落首行空格缩进在IE和chrome显示不一致的问题
一般的编辑文章时,首行都缩进两格,而执行的操作则是一个tab键或者四个空格键,在html代码中体现的往往都是4个 然而我在输出时却发现了同样的html代码,在IE上显示的是缩进了一个字符,在chrom ...
- Cg(C for Graphic)语言表达式与控制语句(转)
摘抄“GPU Programming And Cg Language Primer 1rd Edition” 中文名“GPU编程与CG语言之阳春白雪下里巴人” 在上一章中,我们已经介绍了 Cg 语言的 ...
- IDEA2018.3.5Tomcat output 中文乱码 修改配置文件生效的解决办法
首先,我也是尝试别人介绍的方法: IDEA Windows 环境 console 乱码问题 - intellij idea 15 控制台输出中文乱码问题解决办法 - liuhai的博客 - CSDN博 ...
- Appium问题记录
1.Appium 提示覆盖安装Appium Android Input Manager for Unicode 问题 安卓手机在新版本中Appium 总是提示覆盖安装Appium Android In ...
- 微信小程序资料收集(一)
1.微信小程序用户授权 https://blog.csdn.net/qq_34827048/article/details/77990510 https://blog.csdn.net/qq_3361 ...
- Hdu 5442 Favorite Donut (2015 ACM/ICPC Asia Regional Changchun Online 最大最小表示法 + KMP)
题目链接: Hdu 5442 Favorite Donut 题目描述: 给出一个文本串,找出顺时针或者逆时针循环旋转后,字典序最大的那个字符串,字典序最大的字符串如果有多个,就输出下标最小的那个,如果 ...
- UvaLive6442(思维、结论)
结论是:按位置排序好以后,对于真正的答案,走法应该是:依次走向第0个等分点,第1个等分点……这样对于这种等分情况,是最优的调度. /* 先假设一个终点位置然后按位站好 这个位置不一定是最优所以要调 调 ...
- [洛谷p2858] 奶牛零食
题目链接: 点我 题目分析: 这是什么,区间dp吗?怎么大佬都在说区间dp的样子 完蛋区间dp都不知道是啥quq 于是使用了玄学的姿势A过了这道题 设dp[i][j][0]表示第i天,左边选了j个,当 ...
- Educational Codeforces Round 24 E
Vova again tries to play some computer card game. The rules of deck creation in this game are simple ...