当前位置:网站首页>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问题解决
边栏推荐
- How to analyze the coupling coordination index?
- Establish open data set standards and enable AI engineering implementation
- Day 5 script and UI System
- 【操作教程】TSINGSEE青犀视频平台如何将旧数据库导入到新数据库?
- Hyper-v:hyper-v generation 1 or generation 2 virtual machines
- Measure the current temperature
- 在二叉树(搜索树)中找到两个节点的最近公共祖先(剑指offer)
- Software engineering review questions
- Biweekly investment and financial report: capital ambush Web3 infrastructure
- Scanpy (VII) spatial data analysis based on scanorama integrated scrna seq
猜你喜欢
How is the ISM model analyzed?
Beam search and five optimization methods
Incluxdb time series database
How to calculate the D value and W value of statistics in normality test?
《树莓派项目实战》第五节 使用Nokia 5110液晶屏显示Hello World
What are the indicators of entropy weight TOPSIS method?
Daily question brushing record (III)
C language "recursive series": recursive implementation of 1+2+3++ n
城链科技平台,正在实现真正意义上的价值互联网重构!
微信小程序_7,项目练习,本地生活
随机推荐
[unexpected token o in JSON at position 1 causes and solutions]
Use Adobe Acrobat pro to resize PDF pages
如何设计测试用例
浏览器查看当前页面所有的监听事件
关于I/O——内存与CPU与磁盘之间的关系
Super simple case: how to do hierarchical chi square test?
Retrieval model rough hnsw
How to calculate the independence weight index?
Daily question brushing record (III)
配置、软件配置项、软件配置管理项辨析
How to calculate the positive and negative ideal solution and the positive and negative ideal distance in TOPSIS method?
检测点是否在多边形内
【强化学习笔记】强化学习中的常见符号
Is it safe to open an account online? Xiaobai asks for guidance
进击的技术er,遇见实习岗位信息
Establish open data set standards and enable AI engineering implementation
Software engineering review questions
想开个户,网上股票开户安不安全?
Scanpy (VII) spatial data analysis based on scanorama integrated scrna seq
Jdbc-dao layer implementation