当前位置:网站首页>STM32个人笔记-程序跑飞
STM32个人笔记-程序跑飞
2022-08-01 09:09:00 【Couvrir洪荒猛兽】
部分笔记来源于“STM32嵌入式开发”公众号。
程序跑分
数字越界/溢出
现象:单片机程序在函数中运行时,总是在运行到函数末尾,要跳出函数时,程序跑飞。
原因:数组越出(数组溢出)。如
uint8_t ucDataBuff[10]={0};
ucDataBuff[10]=0x1;解决方法:如果在调试程序时,发现程序总是在函数执行完毕时跑飞,多数情况是发生了数组越界(数组溢出)的错误,仔细检查函数中调用的数组是否存在越界(溢出)的情况。
中断服务函数缺失
现象:程序运行过程中总是跑飞。
原因:程序中打开了某个中断,但是却没有相应的中断服务程序,从而导致在中断发生后,找不到中断服务程序入口,从而导致程序跑飞。
解决方法:检查程序中是否存在打开了某个中断,但是没有相对应的中断服务程序。
看门狗复位
现象:在执行一段较为耗时的程序时,程序跑飞,并且总是跳到复位位置处。
原因:程序中使用了看门狗,但是没有及时喂狗,从而导致看门狗复位,使程序直接跳到复位位置。
解决方法:根据程序运行时间,尤其是一定要计算清楚最耗时的那段程序的运行时间,然后准确设置看门狗的复位时长,定时喂狗。尤其是如果有死循环的情况,一定要在死循环中记得喂狗。
边栏推荐
- Shell执行SQL发邮件
- Redis learning
- leetcode-6133:分组的最大数量
- Flink SQL - client, how to deal with the source side and to increase the target, the SQL - client including mapping table and the JOB such as
- Install GBase 8 c database, the error shows "Resource, how to solve?
- 杰理AD14N/AD15N---串口中断问题
- sql server, FULL模式, dbcc shrinkfile(2,1) 不能收缩事务日志,还是原来的大小,是为什么?
- Chapters 6 and 7 of Huawei Deep Learning Course
- leetcode-6132: Make all elements in array equal to zero
- [Dataset] Dataset summary of various insulators, bird's nests and anti-vibration hammers
猜你喜欢
随机推荐
Flink SQL - client, how to deal with the source side and to increase the target, the SQL - client including mapping table and the JOB such as
flink sql-client,怎么处理源端与目标增加端,sql-client包括映射表与JOB如
centos 安装php7.4,搭建hyperf,转发RDS
HoloView -- Tabular Datasets
In the background of the GBase 8c database, what command is used to perform the master-slave switchover operation for the gtm and dn nodes
网络基础学习
pytest interface automation testing framework | parametrize source code analysis
企业数据虚拟化综合指南
套接字选项
Prime Ring Problem
HoloView——实时数据
Go supports OOP: use struct instead of class
The soul asks: How does MySQL solve phantom reads?
pytest接口自动化测试框架 | parametrize叠加使用
22 Niu Ke Duo School 1 I. Chiitoitsu (Probability dp)
UXDB如何返回当前数据库所有表的记录数?
codeforces每日5题(均1600)-第二十七天
22牛客多校1 I. Chiitoitsu (概率dp)
Delphi MDI appliction 文档最大化显示、去掉最大化最小化等按钮
network basic learning








