当前位置:网站首页>STM32个人笔记-程序跑飞
STM32个人笔记-程序跑飞
2022-08-01 09:09:00 【Couvrir洪荒猛兽】
部分笔记来源于“STM32嵌入式开发”公众号。
程序跑分
数字越界/溢出
现象:单片机程序在函数中运行时,总是在运行到函数末尾,要跳出函数时,程序跑飞。
原因:数组越出(数组溢出)。如
uint8_t ucDataBuff[10]={0};
ucDataBuff[10]=0x1;
解决方法:如果在调试程序时,发现程序总是在函数执行完毕时跑飞,多数情况是发生了数组越界(数组溢出)的错误,仔细检查函数中调用的数组是否存在越界(溢出)的情况。
中断服务函数缺失
现象:程序运行过程中总是跑飞。
原因:程序中打开了某个中断,但是却没有相应的中断服务程序,从而导致在中断发生后,找不到中断服务程序入口,从而导致程序跑飞。
解决方法:检查程序中是否存在打开了某个中断,但是没有相对应的中断服务程序。
看门狗复位
现象:在执行一段较为耗时的程序时,程序跑飞,并且总是跳到复位位置处。
原因:程序中使用了看门狗,但是没有及时喂狗,从而导致看门狗复位,使程序直接跳到复位位置。
解决方法:根据程序运行时间,尤其是一定要计算清楚最耗时的那段程序的运行时间,然后准确设置看门狗的复位时长,定时喂狗。尤其是如果有死循环的情况,一定要在死循环中记得喂狗。
边栏推荐
- HoloView 在 jyputer lab/notebook 不显示总结
- GO error handling
- Mysql数据库的部署以及初始化步骤
- Install GBase 8 c database, the error shows "Resource, how to solve?
- VoLTE Basic Learning Series | Enterprise Voice Network Brief
- 如何保证数据库与缓存数据一致性?
- Holoview--Introduction
- Optimal dazzle Oracle database support what kinds of type of the time and date
- 基于tika实现对文件类型进行判断
- 【无标题】
猜你喜欢
随机推荐
Analysis of High Availability Solution Based on MySql, Redis, Mq, ES
Static Pod, Pod Creation Process, Container Resource Limits
leetcode-6133:分组的最大数量
力扣每日一题-第44天-290. 单词规律
Pytest | skip module interface test automation framework
Chapter 9 of Huawei Deep Learning Course - Convolutional Neural Network and Case Practice
热修复技术可谓是百花齐放
How to get page data
Case practice --- Resnet classic convolutional neural network (Mindspore)
在GBase 8c数据库后台,使用什么样的命令来对gtm、dn节点进行主备切换的操作
优炫数据库支持Oracle哪几种时间及日期类型
Leetcode - 6135: the longest part of the figure
How does UXDB return the number of records for all tables in the current database?
Delphi MDI appliction documents maximize display, remove buttons such as maximize and minimize
navicat mysql 内存占用过高,被强制关闭
22 Grab the Seat 1 C.Grab the Seat (Geometry + Violence)
HoloView -- Tabular Datasets
[Interview: Concurrency 39: Multithreading: Thread Pool] ThreadPoolExecutor Class - Submit, Stop
pytest接口自动化测试框架 | 使用函数返回值的形式传入参数值
pytest接口自动化测试框架 | 跳过模块