当前位置:网站首页>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问题解决
边栏推荐
- To achieve good software testing results, it is a prerequisite to build a good testing environment
- A solution to slow startup of Anaconda navigator
- How to calculate the fuzzy comprehensive evaluation index? How to calculate the four fuzzy operators?
- How to calculate the positive and negative ideal solution and the positive and negative ideal distance in TOPSIS method?
- Establish open data set standards and enable AI engineering implementation
- 打新债真的安全吗? 风险大吗
- leetcode.13 --- 罗马数字转整数
- Various synchronous learning notes
- Beam search and five optimization methods
- 【515. 在每个树行中找最大值】
猜你喜欢

UEFI: repair efi/gpt bootloader

Wechat applet opening customer service message function development

Find the nearest common ancestor (Sword finger offer) of two nodes in the binary tree (search tree)

InfluxDB时序数据库

About i/o -- the relationship between memory and CPU and disk

Index analysis of DEMATEL model

各种同步学习笔记

With the beauty of technology enabled design, vivo cooperates with well-known art institutes to create the "industry university research" plan

TS environment setup

Similarity calculation method
随机推荐
VOCALOID notes
开户券商怎么选择?在线开户是安全么?
Go language learning tutorial (13)
想开个户,网上股票开户安不安全?
《树莓派项目实战》第五节 使用Nokia 5110液晶屏显示Hello World
[unexpected token o in JSON at position 1 causes and solutions]
Stimulsoft Ultimate呈现报告和仪表板
How to calculate the information entropy and utility value of entropy method?
Biweekly investment and financial report: capital ambush Web3 infrastructure
What are the indicators of VIKOR compromise?
4 reasons for adopting "safe left shift"
Scanpy (VII) spatial data analysis based on scanorama integrated scrna seq
Check whether the point is within the polygon
软件确认测试有什么作用?确认测试报告的价格是多少?
Bluecmsv1.6- code audit
Wechat applet introduction record
关于I/O——内存与CPU与磁盘之间的关系
With the beauty of technology enabled design, vivo cooperates with well-known art institutes to create the "industry university research" plan
Common SRV types
打新债真的安全吗? 风险大吗