当前位置:网站首页>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问题解决
边栏推荐
- 初识生成对抗网络(12)——利用Pytorch搭建WGAN-GP生成手写数字
- Exchange:管理日历权限
- How to choose an account opening broker? Is it safe to open an account online?
- The difference between personal domain name and enterprise domain name
- 现在网上开通股票账号安全吗?
- What is the file that tp6 automatically executes? What does the tp6 core class library do?
- Unit conversion - mm to pixel - pixel to MM
- 初识生成对抗网络(11)——利用Pytorch搭建WGAN生成手写数字
- Biweekly investment and financial report: capital ambush Web3 infrastructure
- DNS protocol and its complete DNS query process
猜你喜欢

Retrieval model rough hnsw

VOCALOID notes

城链科技平台,正在实现真正意义上的价值互联网重构!

How to analyze the grey prediction model?

Log in to MySQL 5.7 under ubuntu18 and set the root password

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

linux中的mysql有10061错误怎么解决

以科技赋能设计之美,vivo携手知名美院打造“产学研”计划

How to calculate the positive and negative ideal solution and the positive and negative ideal distance in TOPSIS method?

Bluecmsv1.6- code audit
随机推荐
以科技赋能设计之美,vivo携手知名美院打造“产学研”计划
Index analysis of DEMATEL model
Unit conversion - mm to pixel - pixel to MM
Home server portal easy gate
初识生成对抗网络(12)——利用Pytorch搭建WGAN-GP生成手写数字
Hyper-v:Hyper-v 第 1 代或第 2 代虚拟机
Unity Addressable批量管理
What do various optimizers SGD, adagrad, Adam and lbfgs do?
Wechat applet opening customer service message function development
How to calculate the independence weight index?
在二叉树(搜索树)中找到两个节点的最近公共祖先(剑指offer)
Software engineering review questions
[515. find the maximum value in each tree row]
About i/o -- the relationship between memory and CPU and disk
是否可以给数据库表授予删除列对象的权限?为什么?
Hyper-v:hyper-v generation 1 or generation 2 virtual machines
C language "Recursion Series": recursively realizing the n-th power of X
How to calculate the fuzzy comprehensive evaluation index? How to calculate the four fuzzy operators?
[unexpected token o in JSON at position 1 causes and solutions]
Find the nearest common ancestor (Sword finger offer) of two nodes in the binary tree (search tree)