当前位置:网站首页>RTOS 多线程下hardfault问题总结
RTOS 多线程下hardfault问题总结
2022-06-25 07:34:00 【*_仰望星空_*】
问题
使用minIni以INI文件形式保存系统参数到littlefs多线程下读写导致的hardfault问题
解决过程
0、通过RT-Thread自定义hardfault处理函数打印hardfault信息,发现hardfault发生在lvgl gui线程;
1、通过调试器将hardfault打印的lr寄存器地址减去5回溯地址找到发生hardfault的语句为STM32 HAL库的SPI 传输函数,按道理库函数应该没问题,无法理解
2、想到hardfault问题多是指针越界或堆栈溢出导致的,增大lvgl GUI线程堆栈,再次调试发现还是hardfault,不过hardfault发生在事件处理线程
3、增大事件处理线程堆栈,hardfault问题解决
总结
通过解决过程可以发现推测原因:可能是由于使用littlefs调用了HAL库,minIni调用littlefs的接口,多层函数嵌套调用需要使用很多栈空间,而给lvgl GUI线程和事件处理线程的堆栈才1K,所以给线程分配的堆栈不能太吝啬。
RTOS多线程下hardfault问题多数是由于堆栈溢出导致的。
增大lvgl gui线程后,再次调试发现hardfault发生在事件处理线程,增大事件处理线程的堆栈,hardfault问题解决
边栏推荐
- Is there any risk in making new bonds
- UEFI: repair efi/gpt bootloader
- Common action types
- Is it really safe to pay new debts? Is it risky
- 4 reasons for adopting "safe left shift"
- Super simple case: how to do hierarchical chi square test?
- 2021 "Ai China" selection
- 开户券商怎么选择?在线开户是安全么?
- Home server portal easy gate
- Stimulsoft Ultimate呈现报告和仪表板
猜你喜欢

Index analysis of DEMATEL model

Find out the possible memory leaks caused by the handler and the solutions

Bluecmsv1.6-代码审计

Scanpy (VII) spatial data analysis based on scanorama integrated scrna seq

How to calculate the independence weight index?

Exchange:管理日历权限

Nips 2014 | two stream revolutionary networks for action recognition in videos reading notes

【操作教程】TSINGSEE青犀视频平台如何将旧数据库导入到新数据库?

Unity Addressable批量管理

《树莓派项目实战》第五节 使用Nokia 5110液晶屏显示Hello World
随机推荐
Similarity calculation method
QSS 不同风格的按钮
Unity addressable batch management
《树莓派项目实战》第五节 使用Nokia 5110液晶屏显示Hello World
Find the nearest common ancestor (Sword finger offer) of two nodes in the binary tree (search tree)
Scanpy (VII) spatial data analysis based on scanorama integrated scrna seq
GPU calculation
现在网上开通股票账号安全吗?
如何成为一名软件测试高手? 月薪3K到17K,我做了什么?
What is the difference between TP5 and tp6?
Paper:Generating Hierarchical Explanations on Text Classification via Feature Interaction Detection
How to calculate the correlation coefficient and correlation degree in grey correlation analysis?
leetcode.13 --- 罗马数字转整数
检测点是否在多边形内
4 raisons inconnues d'utiliser le "déplacement sûr à gauche"
在二叉树(搜索树)中找到两个节点的最近公共祖先(剑指offer)
软件测试月薪10K如何涨到30K,只有自动化测试能做到
With the beauty of technology enabled design, vivo cooperates with well-known art institutes to create the "industry university research" plan
如何设计测试用例
In 2022, which industry will graduates prefer when looking for jobs?