Toggle navigation
首页
问答
文章
积分商城
专家
专区
更多专区...
文档中心
返回主站
搜索
提问
会员
中心
登录
注册
CmBacktrace
Hardfault
关于STM32F103的【rt_hw_hard_fault_exception】故障的定位
发布于 2019-10-04 16:46:53 浏览:2936
订阅该版
在使用RTT做项目的过程,遇到了一个比较棘手的问题,请大家能帮忙分析一下: 1、问题描述:程序最开始的时候运行正常,但运行几十分钟至十几个小时后,会停在`“rt_hw_hard_fault_exception”`中的while(1)中。 2、进入`“rt_hw_hard_fault_exception”`时,硬件DEBUG的相关信息见图片。 3、指针和数组溢出的问题,已经查了一遍,未发现问题; 4、最麻烦的是,当使用pc指向故障点时,直接跳转到了`“rt_hw_hard_fault_exception”`的汇编代码部分,没有思路再进一步分析了。    
查看更多
8
个回答
默认排序
按发布时间排序
ding
2019-10-04
这家伙很懒,什么也没写!
你这现象和我遇到的一样,我是STM32F429,我的程序原来在TM4上跑的很稳定,移到STM32上后非常的糟糕。
ding
2019-10-04
这家伙很懒,什么也没写!
应该是出栈时PC值异常了
ding
2019-10-04
这家伙很懒,什么也没写!
你有没有用HAL
Nanne
2019-10-04
这家伙很懒,什么也没写!
>你有没有用HAL --- 没有,我用的是标准外设。你那边的问题解决了吗?
Nanne
2019-10-04
这家伙很懒,什么也没写!
[i=s] 本帖最后由 Nanne 于 2019-10-4 22:14 编辑 [/i] 现在调试,发现程序死的时候,跟之前的现象不太一样,通过Call Stack + Locals能定位到“rt_thread_yield”。这个函数我没有主动调用过。
Nanne
2019-10-05
这家伙很懒,什么也没写!
这句话怎么理解?我在判断条件内部设置了断点,发现程序死的时候,进入了该判断条件。正常运行的时候是不进入的。执行完这个函数后,就进入hard fault了。 ```c if ((thread->stat & RT_THREAD_STAT_MASK) == RT_THREAD_READY && thread->tlist.next != thread->tlist.prev) ``` 完整函数: ```c /** * This function will let current thread yield processor, and scheduler will * choose a highest thread to run. After yield processor, the current thread * is still in READY state. * * @return RT_EOK */ rt_err_t rt_thread_yield(void) { register rt_base_t level; struct rt_thread *thread; /* disable interrupt */ level = rt_hw_interrupt_disable(); /* set to current thread */ thread = rt_current_thread; /* if the thread stat is READY and on ready queue list */ ** if ((thread->stat & RT_THREAD_STAT_MASK) == RT_THREAD_READY &&** ** thread->tlist.next != thread->tlist.prev)** { /* remove thread from thread list */ rt_list_remove(&(thread->tlist)); /* put thread to end of ready queue */ rt_list_insert_before(&(rt_thread_priority_table[thread->current_priority]), &(thread->tlist)); /* enable interrupt */ rt_hw_interrupt_enable(level); rt_schedule(); return RT_EOK; } /* enable interrupt */ rt_hw_interrupt_enable(level); return RT_EOK; } RTM_EXPORT(rt_thread_yield); ```
Nanne
2019-10-05
这家伙很懒,什么也没写!
这个是相关变量的状态截图
ding
2019-10-05
这家伙很懒,什么也没写!
还没查到问题,但可以肯定不是操作系统的问题,极有可能和中断相关。
撰写答案
登录
注册新账号
关注者
0
被浏览
2.9k
关于作者
Nanne
这家伙很懒,什么也没写!
提问
5
回答
16
被采纳
0
关注TA
发私信
相关问题
1
RTT1.0,STM32调试时会跑到HardFault【已解决】,出现新问题
2
新手请教关于hardfault怎么查
3
github最新版本库中stm32f0X分支,运行切换任务时候出现hardfault[已解决]
4
实现iap功能,bootloader使用了rtt操作系统,在跳转到app代码的时候提示出现hardfault的问题
5
ymodem在on_begin内发送can无法断开连接,而且RTT会报hardfault
6
挂载UFFS文件系统执行到退出_BuildTreeStepOne函数时hardfault异常
7
STM32F1+RTT串口接收中断进入hardfault
8
STM32F746NG随机进入hardfault(已解决)
9
[已解决]自已建了个STM32F103的MDK工程,初始化时总是进入HardFault,求教!
10
将 Cortex M3 的 hardfault 处理与 M4、M7、M0 保持一致?
推荐文章
1
RT-Thread应用项目汇总
2
玩转RT-Thread系列教程
3
国产MCU移植系列教程汇总,欢迎查看!
4
机器人操作系统 (ROS2) 和 RT-Thread 通信
5
五分钟玩转RT-Thread新社区
6
【技术三千问】之《玩转ART-Pi》,看这篇就够了!干货汇总
7
关于STM32H7开发板上使用SDIO接口驱动SD卡挂载文件系统的问题总结
8
STM32的“GPU”——DMA2D实例详解
9
RT-Thread隐藏的宝藏之completion
10
【ART-PI】RT-Thread 开启RTC 与 Alarm组件
最新文章
1
RT-Thread动态模块
2
RT-Thread项目助手v0.3 | Ubuntu与MacOS平台的RT-Thread Env
3
【FRA156测评DM-MCX】- 环境配置篇
4
【基于HPM6750+RW007的网页服务器】---SD卡文件系统
5
有关RT_thread studio使用WDT的一点经验
热门标签
RT-Thread Studio
串口
Env
LWIP
SPI
AT
Bootloader
Hardfault
CAN总线
FinSH
ART-Pi
USB
DMA
文件系统
RT-Thread
SCons
RT-Thread Nano
线程
MQTT
STM32
rt-smart
RTC
FAL
I2C_IIC
ESP8266
UART
cubemx
WIZnet_W5500
ota在线升级
PWM
BSP
flash
freemodbus
packages_软件包
潘多拉开发板_Pandora
GD32
定时器
ADC
flashDB
编译报错
socket
中断
rt_mq_消息队列_msg_queue
Debug
keil_MDK
SFUD
msh
ulog
C++_cpp
MicroPython
本月问答贡献
lchnu
3
个答案
2
次被采纳
张世争
1
个答案
2
次被采纳
a1012112796
9
个答案
1
次被采纳
三世执戟
8
个答案
1
次被采纳
聚散无由
5
个答案
1
次被采纳
本月文章贡献
jinchanchan
9
篇文章
13
次点赞
ssdd45555
3
篇文章
2
次点赞
聚散无由
1
篇文章
4
次点赞
rvcore
1
篇文章
1
次点赞
lvdongchina
1
篇文章
1
次点赞
回到
顶部
发布
问题
分享
好友
手机
浏览
扫码手机浏览
投诉
建议
回到
底部