SEGGER_RTT的使用
2016-04-19 19:00
274 查看
1.What is RTT?
With RTT it is possible to output information from the target microcontroller as well as sending input to the application at a very high speed without affecting the target's real time behavior.
SEGGER RTT can be used with any J-Link model and any supported target processor which allows background memory access, which are Cortex-M and RX targets.
RTT supports multiple channels in both directions, up to the host and down to the target, which can be used for different purposes and provide the most possible freedom to the user.
The default implementation uses one channel per direction, which are meant for printable terminal input and output. With the J-Link RTT Viewer this channel can be used for multiple "virtual" terminals, allowing to print to multiple windows (e.g. one for standard
output, one for error output, one for debugging output) with just one target buffer. An additional up (to host) channel can for example be used to send profiling or event tracing data.
2.RTT支持那类芯片
RTT can be used with any target, which is supported by J-Link and allows background memory access while the target is running.
具体介绍请查看参考:地址https://www.segger.com/jlink-rtt.html
3.接下来我们来使用使用一下。
芯片是:NRF51822 cortex-m0的内核。
下载J-link驱动并安装 。
在安装路径下面找到并安装,如下:
4.随便打开一个nrf51822的工程。
把RTT和Syscalls添加到工程里面。在Syscalls里面只要要选择对应的开发环境对用文件即可,我用的是keil所以选择
SEGGER_RTT_Syscalls_KEIL 即可。如下:
注意:添加对应的路径
5.在主函数页面里面,添加对应的头文件
以及在main()里面初始化
//segger_rtt_init
SEGGER_RTT_Init();
SEGGER_RTT_printf(0,"\r\hello,rtt\r\n");
打开:
打开:J-LINK RTT Client 和J-link RTT LOGGER,可见还没有连上
设置J-link RTT LOGGER
设置项: 分别为Device name (随便写),
调试接口:用的是SWD。
速度 :2.5M
其他的默认。
注意:output file 是打印出来的Log。文件默认放在Segger的\SEGGER\JLink_V502这个路径下面
6.编译程序,运行:
打印出来了 Hello,rtt 这是在主函数里面添加的打印代码。。OK。。。。。。
With RTT it is possible to output information from the target microcontroller as well as sending input to the application at a very high speed without affecting the target's real time behavior.
SEGGER RTT can be used with any J-Link model and any supported target processor which allows background memory access, which are Cortex-M and RX targets.
RTT supports multiple channels in both directions, up to the host and down to the target, which can be used for different purposes and provide the most possible freedom to the user.
The default implementation uses one channel per direction, which are meant for printable terminal input and output. With the J-Link RTT Viewer this channel can be used for multiple "virtual" terminals, allowing to print to multiple windows (e.g. one for standard
output, one for error output, one for debugging output) with just one target buffer. An additional up (to host) channel can for example be used to send profiling or event tracing data.
Channel | Typical Purpose |
---|---|
Up-channel 0 | Terminal output |
Down-Channel 0 | Keyboard input |
2.RTT支持那类芯片
Supported Targets
RTT can be used with any target, which is supported by J-Link and allows background memory access while the target is running.Core | RTT |
---|---|
Cortex-M0 | |
Cortex-M0+ | |
Cortex-M1 | |
Cortex-M3 | |
Cortex-M4 | |
Cortex-M7 | |
RX100 | |
RX200 | |
RX600 |
3.接下来我们来使用使用一下。
芯片是:NRF51822 cortex-m0的内核。
下载J-link驱动并安装 。
在安装路径下面找到并安装,如下:
4.随便打开一个nrf51822的工程。
把RTT和Syscalls添加到工程里面。在Syscalls里面只要要选择对应的开发环境对用文件即可,我用的是keil所以选择
SEGGER_RTT_Syscalls_KEIL 即可。如下:
注意:添加对应的路径
5.在主函数页面里面,添加对应的头文件
以及在main()里面初始化
//segger_rtt_init
SEGGER_RTT_Init();
SEGGER_RTT_printf(0,"\r\hello,rtt\r\n");
打开:
打开:J-LINK RTT Client 和J-link RTT LOGGER,可见还没有连上
设置J-link RTT LOGGER
设置项: 分别为Device name (随便写),
调试接口:用的是SWD。
速度 :2.5M
其他的默认。
注意:output file 是打印出来的Log。文件默认放在Segger的\SEGGER\JLink_V502这个路径下面
6.编译程序,运行:
打印出来了 Hello,rtt 这是在主函数里面添加的打印代码。。OK。。。。。。
相关文章推荐
- mysql-proxy安装报错
- Android——listview android:cacheColorHint,android:listSelector属性作用
- 最大熵模型介绍及实现
- 从字符串中提取数字
- sqlserver中创建链接服务器图解教程
- 12rescue
- poj 2398 Toy Storage
- HDU Labyrinth DP
- 关于如何优化eclipse启动时间
- 进程和线程(Processes and Threads)——翻译自developer.android.com
- redis自动安装脚本(只安装redis)
- CSS定位
- js 放置 cookie、获取 cookie、删除 cookie
- 略论研发评审的必要性
- 苏轼眼里看到的技术世界(一)
- 微信支付开发(7) 收货地址共享接口V2
- 略论研发评审的必要性
- 微信支付开发(7) 收货地址共享接口V2
- Qt Designer使用简易教程
- setsockopt()和getsockopt()函数—-解决地址不可复用,即Address already in use