< id="diy_" type="text/css">>
< id="diy_" type="text/css">>
<>
#modmenu{
height:30px;line-height:30px;background-color:#fcfcfc;
padding-bottom:0px !important;margin-bottom:15px !important;
padding-left:15px !important;
}
#modmenu a{
font-size:12px;
}
#modmenu .pipe{
margin:0 4px;
}
.thread-content{
margin-bottom:0px;
margin-top:0px;
}
.thread_action{
height: 30px;
line-height: 30px;
background-color: #fcfcfc;
padding-left:15px;
}
.thread_action a{
background:none !important;font-size:12px;color:#369;
margin-right:10px;
}
.t_fsz{
min-height: auto !important;
}
.action-button-div .button-a i {
display: inline-block;
/* width: 15px; */
/* height: 15px; */
position: relative;
top: 0px;
right: 0px;
}
>
【经验分享】STM32F103C8T6 程序上电跑飞
[复制链接]
文章
| 文章封面: |
|
| 文章简介: |
STM32F103C8T6 程序上电跑飞 |
前言
某客户反应说他们做回来的板子测试发现程序上电就跑飞了,下载都正常。检查了一个礼拜都不知道哪里出了问题,感觉无从下手。
一 问题排查
1.1 检查电路板
排除虚焊漏焊现象,查看晶体起震波形正常,查看 BOOT 引脚配置正常。
1.2 检查软件代码
客户使用了老的标准库,反应说代码在别的板子上验证过,运行正常。
1.3 IDE 检查
客户使用 KEIL MDK V5.X 版本,下载代码正常,连接 ST-LINK/v2 仿真 DEBUG程序跑飞。停在了一段空白的地址空间中。
二 测试流程
2.1 编写测试代码
在老版本的标准库的基础上,做了一个 LED 闪烁的 DEMO 程序,方便直观的观察现象。测试后,问题同样,代码跑飞。
2.2 重新梳理工程
在 STM32Cube 架构上重新新建工程,确认发现客户使用的晶体频率已经超过了 16MHz 的上限马上更换一个合适的晶体后并修改时钟驱动代码后,程序运行正常。LED 开始稳定闪烁。
三 小结
虽然很多工程师已经很熟悉老的标准库的使用,但还是应该推荐客户选择使用 STM32Cube 来进行开发,这样这个问题在一开始就会避免。
|
<>
.action-create-time{display: none}
>
<>
.comment_placehoder{
display: none;width: 100%;position: absolute;
left: -10px;right: 0px;bottom: 70px;top: 50px;background-size: 1000px 104px;
filter: alpha(opacity=80);opacity: 0.8;z-index:100;
background-color: #ffffff;
background: linear-gradient(to right,#ffffff 8%,#efefef 20%,#ffffff 33%);
animation-duration: 1s;
animation-fill-mode: forwards;
animation-iteration-count: infinite;
animation-name: placeHolderShimmer;
animation-timing-function: linear;
}
/** Skeleton Screen加载占位 **/
@keyframes placeHolderShimmer{
0%{background-position: -468px 0}
100%{background-position: 468px 0}
}
>
<>
#SEO-Official_latest_resources ul li {
display: flex;
align-items: center;
}
#SEO-Official_latest_resources ul li a {
display: inline-block;
width: 100%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
margin-left: 3px;
}
.download-ul li {
height: 60px;
line-height: 60px;
border-bottom: 1px solid #e5e5e5;
padding: 0 10px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.download-ul li span {
display: inline-block;
width: 20px;
height: 20px;
background-color: #edfaff;
text-align: center;
line-height: 20px;
color: var(--st-light-blue);
}
>
<>
.pcb{
width:100%;
}
>