当前位置:网站首页>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问题解决
边栏推荐
- Home server portal easy gate
- 想开个户,网上股票开户安不安全?
- Rqt command
- How to interpret the information weight index?
- 如何设计测试用例
- 如何实现一个系统调用
- Scanpy(七)基于scanorama整合scRNA-seq实现空间数据分析
- Unity addressable batch management
- Paper:Generating Hierarchical Explanations on Text Classification via Feature Interaction Detection
- Basic record of getting started with PHP
猜你喜欢

Internet of things (intelligent irrigation system - Android end)

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

浏览器查看当前页面所有的监听事件

What about the exponential smoothing index?

35岁腾讯员工被裁员感叹:北京一套房,存款700多万,失业好焦虑

检测点是否在多边形内
How to calculate the characteristic vector, weight value, CI value and other indicators in AHP?

Establish open data set standards and enable AI engineering implementation

各种同步学习笔记

Home server portal easy gate
随机推荐
堆栈认知——栈溢出实例(ret2libc)
城链科技平台,正在实现真正意义上的价值互联网重构!
Nodehandle common member functions
【操作教程】TSINGSEE青犀视频平台如何将旧数据库导入到新数据库?
Can I grant database tables permission to delete column objects? Why?
打新债安不安全 有风险吗
Stimulsoft Ultimate呈现报告和仪表板
In 2022, which industry will graduates prefer when looking for jobs?
Problems caused by Gil problems and Solutions
关于I/O——内存与CPU与磁盘之间的关系
C language: count the number of characters, numbers and spaces
NIPS 2014 | Two-Stream Convolutional Networks for Action Recognition in Videos 阅读笔记
Establish open data set standards and enable AI engineering implementation
Log in to MySQL 5.7 under ubuntu18 and set the root password
Various synchronous learning notes
打新债真的安全吗? 风险大吗
InfluxDB时序数据库
Wechat applet introduction record
[summary] 1361- package JSON and package lock JSON relationship
4 reasons for adopting "safe left shift"