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/ ----------------------------------------------------------- ...
随机推荐
- C:根据日期判断是一年的第几天、星期几
W = [Y-1] + [(Y-1)/4] - [(Y-1)/100] + [(Y-1)/400] + D Y是年份数,D是这一天在这一年中的累积天数,也就是这一天在这一年中是第几天. 最好用的是蔡勒 ...
- In-App Purchase Programming Guide----(六) ----Working with Subscriptions
Working with Subscriptions Apps that use subscriptions have some additional behaviors and considerat ...
- curl测试dns解析时间及tcp连接时间
1.用Linux下的curl命令测量网络请求(分号是分隔符,可以是其他符号): curl -o /dev/null -s -w %{time_connect}:%{time_starttransfer ...
- C#文件读写参考
string s = ""; string[] files = Directory.GetFiles(@"E:\u3d_warcraft\logic\logic\Batt ...
- jqGrid 编辑完数据后能返回到当前位置的方法
jqGrid 是一个js的jquery组件,虽然不轻便,但功能还是蛮强大的,也比较方便使用.在数据加载后,经常需要对其中的记录进行编辑,修改完后再返回时需要看到修改后的数据,一般采取重新加载的方法re ...
- Swift3.0 控制流
常用的一些判断方式 //for in let numberList = [, , , , ] //获取第一个元素 !拆包 print(numberList.first!)//1 //获取最后一个元素 ...
- POJ3468【线段树lazy操作】
上午理论AC,打到现在快吐了... 一个那么**Lazy操作打成这样,query操作和update操作都有问题,妈蛋,发现是mid<=s+1-真是蠢到家,明明是mid+1<=s卧槽连左和右 ...
- 天空盒的制作方法 Max来生成天空盒的六张图片
在虚拟现实技术中,需要产品展示,场景漫游等,只要想在内部有一个虚拟的3D天空,那么都要用到天空球:天空球目前基本做法主要有两种:分别是正方形的和球形的. 目前360度全景图主要用的是球形的,针对目前已 ...
- noi.ac 邀请赛1 By cellur925
A. array 考场:上来就想暴力,首先第一个子任务肯定没问题,怎么搞都行.然后第二个子任务用个数组记下新修的值就行了.第三个子任务用一下等差数列求和公式帮助求解,每次都重新算(因为每次改变全部元素 ...
- 题解报告:NYOJ #737 石子合并(一)(区间dp)
描述 有N堆石子排成一排,每堆石子有一定的数量.现要将N堆石子并成为一堆.合并的过程只能每次将相邻的两堆石子堆成一堆,每次合并花费的代价为这两堆石子的和,经过N-1次合并后成为一堆.求出总的代价最小值 ...