STM8 EEPROM unlocking is repeatable

Publisher:小九分析仪Latest update time:2018-09-08 Source: eefocusKeywords:STM8 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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.


Keywords:STM8 Reference address:STM8 EEPROM unlocking is repeatable

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

STM8 MCU wireless 315&433 pulse width adaptation_general decoding program
The microcontroller source program is as follows: /* RFINT cannot use PA1, change the board to PC6 */ /* Includes ------------------------------------------------------------------*/ #define MAIN_C #include "ALL.h" void Delay(u16 nCount) {   /* Decrement nCount value */   while (nCount != 0)   {     nCount--;  
[Microcontroller]
IAR ARM, IAR STM8, IAR MSP430 share one IDE
After trying to install several IARs with different versions and compilers, I finally understood the conditions for IARs with different compilers to share the same IDE. I installed several IARs with different compilers together and shared the same IDE. The above compilers can compile and simulate STM32, STM8, and
[Microcontroller]
IAR ARM, IAR STM8, IAR MSP430 share one IDE
A brief discussion of I2C bus (IV) -- Example of IIC driver file for STM8
This example provides the IIC driver file source code of the STM8S103F core board. It has no problems after personal testing. The blogger uses it to drive AT24C256 and electronic compass MMC5883MA. The IIC communication rate is 100kHz, and the timing delay time can be adjusted. Paste the source code directly: IIC.
[Microcontroller]
atmega8 example: EEPROM usage
/***************************************************************** * Library Description: ATMEGA8 EEPROM usage * Version: v1.00         * Edited by: Pang Hui, Wuhu Lianda Freescale Studio                      * Modified on: August 8, 2011     *         * Note: (1) Directly use the EEPROM address to operate
[Microcontroller]
How to output hex file of STM8 project under IAR environment
HEX File After the STM8 microcontroller is programmed, it needs to be downloaded to the target hardware board, and a hex file is needed at this time. How to set IAR to compile and generate hex file s1: Right-click the project name and select , as shown in Figure 1; s2: In the Options for node "XXX" dialog box, click
[Microcontroller]
How to output hex file of STM8 project under IAR environment
Detailed explanation of the use of STM8 MCU timer 1 encoder function
Encoder Introduction The encoder used here is a point encoder, which is widely used in various instruments. Its specific parameters are not mentioned here. Its appearance is as follows: The pin functions are as follows: The one used here has a switch function, so it has 5 pins. If it does not have a switch, it o
[Microcontroller]
Detailed explanation of the use of STM8 MCU timer 1 encoder function
STM8 series MCU timer operation
1. void TIM1_DeInit(void) //Reset all register parameters of TM1 2. Enable the clock CLK_PeripheralClockConfig (CLK_Peripheral_TIM1, ENABLE) used by TIM_1 3. Set the timer period Function void TIM1_TimeBaseInit(uint16_t TIM1_Prescaler,                        TIM1_CounterMode_TypeDef TIM1_CounterMode,                  
[Microcontroller]
PIC16F873 ADC & PWM & EEPROM
/A total of 6 buttons are defined as: 1-6; RA0 is used as ADC analog sampling conversion; the 5V power supply is divided into 6 equal parts //When the corresponding key is pressed, the digital tube will display the key value, and RC2/CCP1 will output a PWM waveform with a corresponding pulse width until another ke
[Microcontroller]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号