当前位置:网站首页>How to solve the problem of flash write protection in STM32?
How to solve the problem of flash write protection in STM32?
2022-06-25 21:12:00 【HQYJ_】
This paper introduces how to solve STM32 chip Flash The program cannot be downloaded due to write protection , Problems that cannot be debugged online ; If you have the same problem , I hope this article can help ;
First of all, let me give you some tutorial materials , I hope it will be helpful for you to learn ,
You can also add learning groups :780619431
SPI Communication protocol driven norFlash
be based on STM32-WiFi Intelligent car robot development practice
( STM32+LoRa make LPWA The Internet of things system )
ZigBee+STM32 How to build a smart classroom project
Online dictionary integrated practice of embedded project ( series “ Click under the title to start learning ”)
stm32 How to use DMA Handling data
( Zero base Electronics Design )
1 FLASH Write protection for
If the Flash Write protection is set , Then there's no way to Flash Programming and erasing .
Developing STM32 When , If that happens , In general, simulators support Flash To unlock , image jlink,stlink And other emulators support this function .
2 Error message
In the use of MDK When debugging , There is an error Flash Timeout.Reset Target and try it again, The details are shown in the following figure ;
After some tossing , It didn't solve the problem , Because the simulator used is stlink, So I downloaded stlink utility Try to solve the problem ;
3 stlink utility
3.1 Basic function
stlink utility yes ST Official free software , Support STM32 ST-LINK The program includes a command line interface (CLI) The graphical user interface (GUI). The tool also provides many other functions , As follows ;
It can be done to STM32 Internal memory (Flash,RAM,OTP And other memories ), Programming with external memory ;
Verify program content ( The checksum , Check during and after programming , Compare with documents, etc )
Also can realize STM32 Programming Automation ;
There are other functions ;
3.2 Unlock Flash
stay stlink With the target board connected , open stlink utility, On the menu bar Target Choose connect, Because at this time Flash It's locked , So also see the corresponding error prompt Can not read memory Disable Read Out Protection and retry, The details are shown in the following figure ;
OK, Next, just touch write protection , So in the menu bar target Open in Option Bytes… Options , Or directly through the shortcut keys ctrl+B open , Please make sure that you are currently connected properly stlink And target board , Otherwise, an error will be reported ;
With the right connection , open Option Bytes…, Found here Read Out Protection The options are enable, This expression can't pass swd Read STM32 Inside Flash The program .
Key points : take Read Out Protection Option set to disable, Click on Apply, Now Flash It has been successfully unlocked . But at the same time , Inside Flash It has been erased ;
This may be possible. STM32 It's about the protection mechanism of , Prevent programs from being copied , Then decompile and crack it , This can also raise the threshold of cracking . The specific display is shown in the figure below ;
After completing the above steps , In the menu bar Target Choose Disconnect, Or through the shortcut keys ctrl+D Disconnect from the target board ; Re enter MDK, The target board can be debugged normally , Simulation , And the burning of the program .
3.3 Write protect
In the menu bar target Open in Option Bytes… Options , We also see that there are Flash sector protection Options ; choice Select all after , Find out all Page It's all protected , Just choose apply Options can be used to Flash Write protect ; The details are as follows ;
4 summary
about Flash The problem of write protection can be combined with STM32 Refer to the manual for corresponding study , Its internal Flash Provide corresponding protection mechanism , This article is just a combination of ST Official tools stlink utility Solve the common simple problem .
边栏推荐
- The SH runtime directly reported an error syntax error near unexpected token ` $'. \r‘
- IPtables
- Compile 6relayd using the cross compiler
- ZABBIX foundation details
- Is it safe for Xiaobai to open a stock account online?
- The correct way to clear the cache of the computer. The computer will not get stuck immediately after changing. practical
- Multi database and multi table backup and restore of MySQL under Linux
- Cloud native 04: use envoy + open policy agent as the pre agent
- [nailing scenario capability package] smart office phone
- Interviewer: why does TCP shake hands three times and break up four times? Most people can't answer!
猜你喜欢
How to play one to many in JPA?

Jingxi Pinpin wechat applet -signstr parameter encryption
How does zhiting home cloud and home assistant access homekit respectively? What is the difference between them?

Illustrated with pictures and texts, 700 pages of machine learning notes are popular! Worth learning
Tencent music knowledge map search practice
Cloud native 04: use envoy + open policy agent as the pre agent

js (1)

IPv4 and IPv6 (powercert animated videos)

Must see the summary! In depth learning era, you should read 10 articles to understand image classification!
[distributed system design profile (1)] raft
随机推荐
Must see the summary! In depth learning era, you should read 10 articles to understand image classification!
Xshell mouse configuration
Exploration of advanced document editor design in online Era
SaaS privatization deployment scheme
Is it safe for Xiaobai to open a stock account online?
js(3)
同花顺app是正规的吗?到底安不安全
Explain memcached principle in detail
Section 13: simplify your code with Lombok
What is a server? (Powercert animated videos)
Basic process of configuring utf8 in idea
Yunzhisheng atlas supercomputing platform: computing acceleration practice based on fluid + alluxio (Part I)
Data query of server SQL. The most important chapter in database learning
Cvpr2019 | the latest cvpr2019 papers are the first to read!
Common optimization of e-commerce server system architecture
Is it safe for qiniu school to open an account in 2022?
Docker failed to remotely access 3306 after installing MySQL
This is a simple and cool way to make large screen chart linkage. Smartbi will teach you
Nine built-in objects of JSP and four scopes of Servlet
Openocd adds third-party device support: ht32f52352 Cortex-M0+