After the STM8 EEPROM is reset, if you want to write data, you must unlock it first, otherwise you will not be able to write data. Unlocking means writing to FLASH_DUKR in sequence:
The first hardware key: 0xAE
Second hardware key: 0x56
Two bytes of data.
At this time, the DUL bit in FLASH_IAPSR will become 1, indicating that the EEPROM has been successfully unlocked and can be written. If the DUL bit is not 1, the key can be written repeatedly in sequence until the DUL bit is 1.
But the manual says this:
Chinese manual:
2. If the key is entered incorrectly, the application can try to re-enter the two MASS keys to
unlock .
4. If the key is entered incorrectly, the DATA EEPROM area will remain write-protected until the next system reset.
Before the next reset, any write operations to this register will be ignored by the system.
English manual:
2. If the key available on the data bus is incorrect, the FLASH_PUKR register remains
locked until the next reset. Any new write commands sent to this address are
discarded.
4. If the key available on the data bus is incorrect, the data EEPROM area remains write
protected until the next reset. Any new write command sent to this address is ignored.
These instructions give the impression that if the first key is entered incorrectly, you can repeat it until it is unlocked, but if the first key is entered correctly and the second key is entered incorrectly, it will be permanently locked and any write operations to the register will be ignored until the next unlock after reset.
In fact, after experiments, I found that no matter the first key or the second key is wrong, I can repeat the operation until it is unlocked.
Previous article:The startup process of STM8 microcontroller
Next article:STM8L151 implements Flash/EEPROM erasing and writing in IAR
Recommended ReadingLatest update time:2024-11-16 11:45
- Popular Resources
- Popular amplifiers
- Principles and Applications of Single Chip Microcomputers and C51 Programming (3rd Edition) (Xie Weicheng, Yang Jiaguo)
- STM8 C language programming (1) - basic program and startup code analysis
- Description of the BLDC back-EMF sampling method based on the STM8 official library
- EDA Technology Practical Tutorial--Verilog HDL Edition (Sixth Edition) (Pan Song, Huang Jiye)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- [GD32L233C-START Evaluation] 2. Keil development environment construction
- Circuit Design of Robot Positioning System Based on MSP430
- 【TI Course】LED Driver
- Is the DLPLCRC900EVM a revised version?
- Schedule of the 2019 National Undergraduate Electronic Design Competition
- [NXP Rapid IoT Review] +1. Data preparation, first look at NXP Rapid IoT
- [2022 Digi-Key Innovation Design Competition] Material Unboxing - ESP32 Three Musketeers
- [Sipeed LicheeRV 86 Panel Review] D1 as a single-chip computer naked programming light - LED-Blinky
- Is this the Keil5 that STM32 needs?
- Leading domestic analog chip manufacturers are recruiting - a great opportunity to reach the pinnacle of life Location: Shanghai