当前位置:网站首页>STM32个人笔记-程序跑飞
STM32个人笔记-程序跑飞
2022-08-01 09:09:00 【Couvrir洪荒猛兽】
部分笔记来源于“STM32嵌入式开发”公众号。
程序跑分
数字越界/溢出
现象:单片机程序在函数中运行时,总是在运行到函数末尾,要跳出函数时,程序跑飞。
原因:数组越出(数组溢出)。如
uint8_t ucDataBuff[10]={0};
ucDataBuff[10]=0x1;解决方法:如果在调试程序时,发现程序总是在函数执行完毕时跑飞,多数情况是发生了数组越界(数组溢出)的错误,仔细检查函数中调用的数组是否存在越界(溢出)的情况。
中断服务函数缺失
现象:程序运行过程中总是跑飞。
原因:程序中打开了某个中断,但是却没有相应的中断服务程序,从而导致在中断发生后,找不到中断服务程序入口,从而导致程序跑飞。
解决方法:检查程序中是否存在打开了某个中断,但是没有相对应的中断服务程序。
看门狗复位
现象:在执行一段较为耗时的程序时,程序跑飞,并且总是跳到复位位置处。
原因:程序中使用了看门狗,但是没有及时喂狗,从而导致看门狗复位,使程序直接跳到复位位置。
解决方法:根据程序运行时间,尤其是一定要计算清楚最耗时的那段程序的运行时间,然后准确设置看门狗的复位时长,定时喂狗。尤其是如果有死循环的情况,一定要在死循环中记得喂狗。
边栏推荐
- pytest interface automation testing framework | parametrize source code analysis
- Data Analysis 6
- GBase 8c中怎么查询数据库配置参数,例如datestyle
- Static Pod, Pod Creation Process, Container Resource Limits
- Pod环境变量和initContainer
- 网络基础学习
- HoloView 在 jyputer lab/notebook 不显示总结
- gethostbyname \ getaddrinfo 解析域名IP地址不安全的原因
- SAP ABAP ALV+SMARTFORS 表分页 报表打印程序
- Is the real database data of TiDB stored in kv and pd?
猜你喜欢
随机推荐
pytest interface automation testing framework | parametrize source code analysis
VoLTE Basic Learning Series | Enterprise Voice Network Brief
热修复技术可谓是百花齐放
A problem with writing to the database after PHP gets the timestamp
力扣周赛304 6135. 图中的最长环 内向基环树
数据分析6
gethostbyname \ getaddrinfo 解析域名IP地址不安全的原因
centos 安装php7.4,搭建hyperf,转发RDS
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
【Untitled】
解析MySQL数据库:“SQL优化”与“索引优化”
Pytest | skip module interface test automation framework
Data Analysis 6
[Interview: Concurrency 39: Multithreading: Thread Pool] ThreadPoolExecutor Class - Submit, Stop
pytest接口自动化测试框架 | 使用函数返回值的形式传入参数值
Go supports OOP: use struct instead of class
pytest接口自动化测试框架 | 执行失败跳转pdb
Redis中间件(从搭建到弃坑)
自定义IP在PCIE中使用
Analysis of High Availability Solution Based on MySql, Redis, Mq, ES








