Toggle navigation
首页
问答
文章
积分商城
专家
专区
更多专区...
文档中心
返回主站
搜索
提问
会员
中心
登录
注册
FinSH
RT-Thread Nano
rt-thread nano 4.1.1 finsh无法正常打开
发布于 2025-07-11 17:17:52 浏览:189
订阅该版
本人萌新,在官网下载了RT-Thread nano的下载包,根据网络教程在STM32F103C8T6上进行移植,编译时发现缺少finsh_config.h,于是从RT-Thread nano 315版本中复制了一份   但仍然无法正常打开Finsh组件,现象如下  一些相关的代码: Main.c(没有在while(1)死等): ```c #include "sys.h" #include "rtthread.h" #include "led.h" int main(void) { while(1){ rt_kprintf("MAIN\n"); LED0=0; rt_thread_mdelay(1000); LED0=1; rt_thread_mdelay(1000); } } ``` rtconfig.h(打开了HEAP,CONSOLE以及include了finsh_config.h) ```c #define RT_USING_HEAP #define RT_USING_SMALL_MEM // //
using tiny size of memory //
using tiny size of memory //#define RT_USING_TINY_SIZE // // //
Console Configuration //
Using console //
Using console #define RT_USING_CONSOLE // //
the buffer size of console <1-1024> //
the buffer size of console //
Default: 128 (128Byte) #define RT_CONSOLEBUF_SIZE 256 //
//
FinSH Configuration //
include finsh config //
Select this choice if you using FinSH #include "finsh_config.h" ``` board.c(时钟串口初始化以及output函数的实现) ```c void rt_hw_board_init(void) { //#error "TODO 1: OS Tick Configuration." /* * TODO 1: OS Tick Configuration * Enable the hardware timer and call the rt_os_tick_callback function * periodically with the frequency RT_TICK_PER_SECOND. */ SysTick_Config(SystemCoreClock / RT_TICK_PER_SECOND); #include "led.h" /* Call components board initial (use INIT_BOARD_EXPORT()) */ #ifdef RT_USING_COMPONENTS_INIT rt_components_board_init(); #endif #if defined(RT_USING_USER_MAIN) && defined(RT_USING_HEAP) rt_system_heap_init(rt_heap_begin_get(), rt_heap_end_get()); #endif } #ifdef RT_USING_CONSOLE static int uart_init(void) { //#error "TODO 2: Enable the hardware uart and config baudrate." usart_init(115200); return 0; } INIT_BOARD_EXPORT(uart_init); void rt_hw_console_output(const char *str) { //#error "TODO 3: Output the string 'str' through the uart." /* 进入临界段 */ rt_enter_critical(); while(*str!='\0') { /* 换行 */ if (*str == '\n')//RT-Thread 系统中已有的打印均以 \n 结尾,而并非 \r\n,所以在字符输出时,需要在输出 \n 之前输出 \r,完成回车与换行,否则系统打印出来的信息将只有换行 { USART_SendData(USART1, '\r'); while(USART_GetFlagStatus(USART1, USART_FLAG_TC)== RESET); } USART_SendData(USART1, *(str++)); while(USART_GetFlagStatus(USART1, USART_FLAG_TC)== RESET); } /* 退出临界段 */ rt_exit_critical(); //注意:使用进入临界段语句rt_enter_critical(); 一定要使用退出临界段语句 rt_exit_critical();否则调度器锁住,无法进行调度 } ``` usart.c(getchar函数的实现) ```c char rt_hw_console_getchar(void){ int ch = -1; if(USART_GetFlagStatus(USART1, USART_FLAG_RXNE) != RESET) { ch = (int)USART_ReceiveData(USART1); USART_ClearFlag(USART1, USART_FLAG_RXNE); } else { if(USART_GetFlagStatus(USART1, USART_FLAG_ORE) != RESET) { USART_ClearFlag(USART1, USART_FLAG_ORE); } rt_thread_mdelay(10); } return ch; } ``` finsh_config.h(1KB的栈大小) ```c /* FinSH config file */ #ifndef __MSH_CFG_H__ #define __MSH_CFG_H__ // <<< Use Configuration Wizard in Context Menu >>> #define RT_USING_FINSH #define FINSH_USING_MSH #define FINSH_USING_MSH_ONLY //
FinSH Configuration //
the priority of finsh thread <1-30> //
the priority of finsh thread //
Default: 21 #define FINSH_THREAD_PRIORITY 21 //
the stack of finsh thread <1-4096> //
the stack of finsh thread //
Default: 4096 (4096Byte) #define FINSH_THREAD_STACK_SIZE 1024 #define FINSH_USING_SYMTAB //
Enable command description //
Enable command description #define FINSH_USING_DESCRIPTION // //
// <<< end of configuration section >>> #endif ``` 下图是单片机卡死时PC指向的相近函数  第一次发帖,排版不精,望各位大佬海涵
查看更多
0
个回答
默认排序
按发布时间排序
暂无答案,快来添加答案吧
撰写答案
登录
注册新账号
关注者
0
被浏览
189
关于作者
yearshunter
这家伙很懒,什么也没写!
提问
1
回答
0
被采纳
0
关注TA
发私信
相关问题
1
求高手指点,RTThread下nanosleep()函数功能如何实现?在线等啊
2
RTT1.2.2在新塘Nano130KE3BN的移植中始终出现栈溢出的问题
3
官方能否出一个nano在mdk下移植finsh到stm32的教程
4
从裸机开始,创建一个RT-Thread Nano系统工程
5
Nano版如何启用shell
6
项目从RTT 2.x NANO移植到 RTT 3.x ENV 环境
7
nano 版本有没有集成到 IAR 中啊?
8
关于MDK5的RT-THREAD NANO中添加MSH组件的例程
9
rtt_nano版本,源代码在哪里下载啊?
10
RTT Nano 在keil 使用C++11 的问题
推荐文章
1
RT-Thread应用项目汇总
2
玩转RT-Thread系列教程
3
国产MCU移植系列教程汇总,欢迎查看!
4
机器人操作系统 (ROS2) 和 RT-Thread 通信
5
【技术三千问】之《玩转ART-Pi》,看这篇就够了!干货汇总
6
五分钟玩转RT-Thread新社区
7
关于STM32H7开发板上使用SDIO接口驱动SD卡挂载文件系统的问题总结
8
STM32的“GPU”——DMA2D实例详解
9
RT-Thread隐藏的宝藏之completion
10
【ART-PI】RT-Thread 开启RTC 与 Alarm组件
最新文章
1
STM32H723使用ETH使用记录
2
【GD32F527I-EVAL运行RTThread】使用Agile Button 处理按键输入
3
th-thread 源码学习-中断系统
4
【GD32F527I-EVAL运行RTThread】GPIO外设使用
5
庐山派K230 基于RT-Smart实现FOC云台控制并封装成micropython库与物体自动跟踪系统
热门标签
RT-Thread Studio
串口
Env
LWIP
SPI
Bootloader
AT
Hardfault
ART-Pi
CAN总线
FinSH
DMA
USB
文件系统
RT-Thread
SCons
RT-Thread Nano
线程
MQTT
STM32
FAL
rt-smart
RTC
cubemx
I2C_IIC
BSP
UART
WIZnet_W5500
PWM
ESP8266
ota在线升级
packages_软件包
GD32
flash
freemodbus
潘多拉开发板_Pandora
keil_MDK
编译报错
ADC
flashDB
rt_mq_消息队列_msg_queue
ulog
MicroPython
msh
socket
Debug
SFUD
中断
at_device
QEMU
本月问答贡献
出出啊
1532
个答案
346
次被采纳
小小李sunny
1444
个答案
290
次被采纳
张世争
822
个答案
180
次被采纳
crystal266
555
个答案
162
次被采纳
whj467467222
1222
个答案
149
次被采纳
本月文章贡献
super_gith
3
篇文章
3
次点赞
wdfk_prog
2
篇文章
19
次点赞
killer22
1
篇文章
3
次点赞
LoongYang
1
篇文章
3
次点赞
waner
1
篇文章
2
次点赞
回到
顶部
发布
问题
分享
好友
手机
浏览
扫码手机浏览
投诉
建议
回到
底部