当前位置:网站首页>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 .
边栏推荐
- The way of FPGA -- project scheme and FPGA design scheme of FPGA development process
- Uwp shadow effect
- 翻译软件Bob安装教程
- 实践 DevOps 时,可能面临的六大挑战
- WPF x:ArrayExtension
- [deeply understand tcapulusdb technology] one click installation of tmonitor background
- Synplify Pro的常用选项及命令
- 【深入理解TcaplusDB技術】TcaplusDB構造數據
- 刷题笔记(十六)--二叉树:修改与构造
- WPF listbox virtualization
猜你喜欢

Notes on topic brushing (16) -- binary tree: modification and construction

Games101 job 7- detailed explanation of implementation steps of multi thread speed up

流式细胞分析Flowjo 10介绍以及超详细图文安装激活教程

力扣刷題集結4(mysql版本)

KVM虚拟机救援模式修改root密码 —— 筑梦之路

.bmp图片的文件头解析

左手代码,右手开源,开源路上的一份子

语音断点检测(短时改进子带谱熵)

Jeu de boutons de force 4 (version MySQL)

实验二 栈和队列
随机推荐
WPF tablet
[deeply understand tcapulusdb technology] table management of document acceptance
刷题笔记(十六)--二叉树:修改与构造
ES7 create index template
力扣刷题集结4(mysql版本)
MySql踩坑记录
采样器合集
WPF ComboBox设置选项与反显
关于lg(n!)的渐进紧确界
必读书籍
WPF x:Static
GDB debugging practice (8) transfer startup parameters to the program
Pycharm下可以正常运行,Pyinstaller打包软件报出Fatal error
Verilog参数例化时自动计算位宽的函数
Pychart User Guide
[in depth understanding of tcapulusdb technology] how to realize single machine installation of tmonitor
实验二 栈和队列
Use the for loop to calculate the odd and even sums in 1-100 [method 2]
联系五心红娘脱单
Pychart can run normally, and pyinstaller package software reports fatal error