当前位置:网站首页>STM32 cannot download the program again after downloading it once, and the program cannot run.
STM32 cannot download the program again after downloading it once, and the program cannot run.
2022-06-21 22:37:00 【No martial arts, no Jianghu knowledge】
Preface
As a result of taking over a new project in the laboratory , It is necessary to rewrite the program based on the original hardware , So I started to use the original main control board , But in the process of use, it is found that Jlink After downloading the program once, the chip cannot be read , Can't download the program , The chip also stopped running the program , After a day's tossing , Finally, the problem was solved perfectly , So make a note of the problem , For your reference .
1. The phenomenon
Use J-link After downloading the program once, you cannot download the program again , Chip stop .
2. Various solutions
2.1 Solution one . modify BOOT0 Pin
After looking for a lot of information on the Internet, I found that some posts said it might be a chip SWCLK and SWDIO The state of the pin has been changed .
General chip SWCLK and SWDIO All pins are connected to one 10k Resistance grounding of , To achieve FLASH start-up .
The solution is :
1. take BOOT0 pull up
2. Press the manual reset button
3. take BOOT0 At ground
After I did this, I found that I couldn't read the program , But in BOOT0 You can read the chip when you pull it up , But I can't download the program .
2.2 Solution two . use ST-link Utility
use ST-link Utility To erase the program in the chip , link :
https://blog.csdn.net/weixin_49805374/article/details/116604048?utm_medium=distribute.pc_relevant.none-task-blog-baidujs_title-1&spm=1001.2101.3001.4242

But during the operation, it is found that , The chip simply cannot be connected to ST-link Utility, After many attempts, it is found that the chip can be connected by pressing the reset key during the process of connecting the chip , In the process of erasing the data of the chip, the key reset device is also required , And then I was surprised to find that Jlink Can read chip data , And you can download the program , I thought the problem was solved in this way , however Found behind The program can only be downloaded once , And the program can not run after downloading , And no access to hardware emulation , You can only enter the simulation after pressing the reset key , And the program is running to systikclock() Then it got stuck , So I doubt the problem of Shi Jingzhen , After inspection, it was found that the original plate was welded with 25M Crystal oscillator .
3. The real solution
The reason for the problem is that the board is welded with 25M Crystal oscillator , and STM32 In the official firmware 8M The crystal of , So in stm32 Just modify it in the official firmware of .
3.1 modify STM32 Crystal oscillator parameters in official firmware
3.1.1 stay stm32f4xx.h in take HSE_VALUE The parameter of is changed to 25000000

3.1.2 stay system_stm32f4xx.c No 316 Yes PLL_M It is amended as follows 25

So this perfectly solves the problem .
边栏推荐
- C# DataTable转换为Entity(反射&&泛型)
- 力扣:零钱兑换
- Apache ShardingSphere 5.1.2 发布|全新驱动 API + 云原生部署,打造高性能数据网关
- Wonderful review Figure 1 learn about Huawei cloud special dry goods
- Matlab2020a使用App Designer如何导出exe
- KVM virtual machine online disk expansion -- the road to dream
- WPF 依赖属性
- Fedora 36 compiling and installing opencv 4.6.0 -- the road to building a dream
- The concept of multiprocess and Multithread
- Learn vector -- how to use common interfaces
猜你喜欢

flutter系列之:flutter中的IndexedStack

. File header parsing of BMP pictures

项目流程管理工具OmniPlan Pro 4

力扣刷題集結4(mysql版本)
![[in depth understanding of tcapulusdb technology] tcapulusdb business data backup](/img/7f/6d42dc96348001dd6ebd724a44a123.png)
[in depth understanding of tcapulusdb technology] tcapulusdb business data backup

nuxt ssr打包和部署

Introduction to software architecture

Notes on question brushing (17) -- binary search tree: about attribute problems

Learn vector -- how to use common interfaces

【深入理解TcaplusDB技术】如何实现Tmonitor单机安装
随机推荐
UEFI dual system + dual hard disk installation
Uwp shadow effect
Beijing accelerates ecological construction, Medtronic Internet and Moore thread complete product compatibility and mutual certification
WPF ComboBox设置选项与反显
实践 DevOps 时,可能面临的六大挑战
[deeply understand tcapulusdb technology] tmonitor system upgrade
KVM virtual machine rescue mode modifying root password -- the road to building a dream
Games101 job 7- detailed explanation of implementation steps of multi thread speed up
An Chaoyun was selected as one of the "top ten cloud computing solution providers" in the Asia Pacific region by cioreview in 2022
必读书籍
WPF 选择文件夹
将字符串按长度截取成数组
An example of CPU instruction rearrangement leading to errors
WPF 手写板
WPF data binding: data source target
C# WindowFromPoint在64位程序中无效
Use the while loop to calculate the odd and even sums in 1-100 [method 1]
Use the for loop to calculate n! Value of
Correspondence between rtx3090 and pytorch versions
Pychart can run normally, and pyinstaller package software reports fatal error