当前位置:网站首页>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 .
边栏推荐
- JS__ This, arguments, cloning, ternary operator__ Duyi
- 启牛学堂证券开户安全嘛?
- Getting started and using postman
- Is it safe for Xiaobai to open a stock account online?
- Kubernetes related knowledge - surprise interview
- Cvpr2021 collection of papers | cvpr2021 latest papers | cvpr2021 review results | cvpr2021 admission results
- SaaS privatization deployment scheme
- Causes and solutions of unreliable JS timer execution
- A simple file searcher
- Code program related problems troubleshooting directory
猜你喜欢

Working principle and experimental analysis of DHCP

Rounding related calculation

Install JDK, MySQL and nexus under Linux (tar package installation)

IPv4 and IPv6 (powercert animated videos)
![[important notice] developer document update (12.13-12.19)](/img/49/6a54235409ec95fa50bcc14ef1d405.jpg)
[important notice] developer document update (12.13-12.19)

Alicloud disk mounted locally

Sqlmap for interface security testing
Online yaml to XML tool
Boomfilter learning
Exploration of advanced document editor design in online Era
随机推荐
Talking about the foundation of function test today
Cvpr2020 | the latest cvpr2020 papers are the first to see, with all download links attached!
IPtables
股市小白通过网上进行股票开户安全吗?
Molecular dynamics - basic characteristics of molecular force field
Common optimization of e-commerce server system architecture
Nine built-in objects of JSP and four scopes of Servlet
The latest promo! 1 minute to understand the charm of the next generation data platform
js(3)
Exploration of advanced document editor design in online Era
What is DNS (domain name server)? (Powercert animated videos)
Lesson 1 Preparation
Interview shock: talk about thread life cycle and transformation process?
Must see the summary! In depth learning era, you should read 10 articles to understand image classification!
Explain memcached principle in detail
Why doesn't anyone read your hard-working blog? Do you really understand the skills of framing, typesetting and drawing?
UDP Vs TCP (Powercert animated videos)
Lantern Festival, learning at the right time! Novice training camp attacks again, learning buff continues to fill up
IPv4 and IPv6 (powercert animated videos)
COMP9024