当前位置:网站首页>RT-thread使用rt-kprintf
RT-thread使用rt-kprintf
2022-06-24 19:42:00 【奋斗小鹏】
一. 简介
基于stm32硬件,使用rt-kprintf函数。rtt使用的是nano版本。
欢迎关注微信公众号 FPGA之旅
二. 使用
在这个函数中,最后输出出去的信息是通过调用rt_hw_console_output函数的

而这个函数是一个weak类型的空函数,可以直接在这里添加输出的代码,以最常见的串口为例,添加如下代码就ok了。
/* empty console output */
rt_enter_critical();
while(*str != '\0')
{
HAL_UART_Transmit(&UART1_Handler,(uint8_t *)(str++),1,1000);
}
rt_exit_critical();
如果想要看到输出RT的版本信息,有一个点是需要注意的,那就是初始化usart的位置不能放在main函数下面了,得挪挪位置。
挪到这个位置来,它是先输出版本信息,然后才能到main函数中执行,这个时候,usart还没有初始化,所以不会有信息输出。Cache_Enable函数是stm32H7类型中有的。

边栏推荐
- 【js】-【树】-学习笔记
- laravel 创建 service层
- docker安装mysql-简单无坑
- Tech Talk 活动回顾|云原生 DevOps 的 Kubernetes 技巧
- [laravel series 7.9] test
- Push markdown format information to the nailing robot
- Case analysis: using "measurement" to improve enterprise R & D efficiency | ones talk
- C#学习两年的增删改查和C#导入导出(去重)案例
- Solve the problem of port occupation
- 【nvm】
猜你喜欢

推送Markdown格式信息到钉钉机器人

案例解析:用「度量」提升企业研发效能|ONES Talk
Paddledtx v1.0 has been released, and its security and flexibility have been comprehensively improved!

【js】-【数组应用】-学习笔记

Tech Talk 活动回顾|云原生 DevOps 的 Kubernetes 技巧

Servlet
![[postgraduate entrance examination English] prepare for 2023, learn list9 words](/img/2d/9ff691c9ff50fba2df73f726db26f2.jpg)
[postgraduate entrance examination English] prepare for 2023, learn list9 words

01_ Getting started with the spingboot framework

go Cobra命令行工具入门
15 lines of code using mathematical formulas in wangeditor V5
随机推荐
Paddledtx v1.0 has been released, and its security and flexibility have been comprehensively improved!
非单文件组件
Servlet
Market trend report, technical innovation and market forecast of solar roof system in China
Recommended movies: Northeast tiger, licorice pizza
2022 simulated 100 questions and simulated examination of high-altitude installation, maintenance and demolition
【js】-【数组应用】-学习笔记
Second IPO of Huafang group: grown up in Zanthoxylum bungeanum, trapped in Zanthoxylum bungeanum
China solar window market trend report, technical dynamic innovation and market forecast
15 lines of code using mathematical formulas in wangeditor V5
Learn about redlock
Laravel scheduled task
【js】-【链表-应用】-学习笔记
剑指 Offer 13. 机器人的运动范围
laravel 添加helper文件
伪原创智能改写api百度-收录良好
Gocolly manual
Case analysis: using "measurement" to improve enterprise R & D efficiency | ones talk
2022 safety officer-a certificate examination questions and answers
EPICS record Reference 3 - - field available for all Records