Security Protection; Table 9. Access Permission When Security Protection Is Enabled - Holtek HT32F52220 User Manual

32-bit microcontroller with arm cortex-m0+ core
Table of Contents

Advertisement

32-Bit Arm
®
Cortex
®
-M0+ MCU
HT32F52220/HT32F52230

Security Protection

The FMC provides a Security protection function to prevent an illegal code/data access of the
Flash memory. This function is useful for protecting the software / firmware from the illegal users.
The function is activated by configuring the Option Byte OB_CP [0] bit. Once the function has
been enabled, all the main Flash data access through ICP/Debug mode, programming and page
erase operation will not be allowed except via the user's application. However, the mass erase
operation will still be accepted by the FMC in order to disable this security protection function.
The following table shows the access permission of the Flash memory when the security protection
is enabled.

Table 9. Access Permission When Security Protection is Enabled

Operation
Read
Program
Page Erase
Mass Erase
Notes: 1. User application means the software that is executed or booted from the main Flash
memory with the JTAG/SW debugger being disconnected. However, the Option Byte
block and page 0 are still in protection and the Program/Page Erase operation cannot be
executed.
2. The Mass erase operation can erase the Option Byte block and disable the security
protection.
The following steps show the security protection register access sequence:
Check the OPCR register to confirm that no Flash memory operation is in progress (OPM [3:0]
equal to 0xE or 0x6). Otherwise, wait until the pervious operation has been finished.
Write the OB_CP address to the TADR register (TADR = 0x1FF0_0010).
Write the data into the WRDR register to set the OB_CP [0] field to 0.
Write the word program command to the OCMR register (CMD [3:0] = 0x4).
Commit the word program command to the FMC by setting the OPCR register (set OPM = 0xA).
Wait until all operations have been finished by checking the value of the OPCR register (OPM
[3:0] equals to 0xE).
Read and verify the Option Byte if required.
The OB_CK field in the Option Byte must be updated according to the Option Byte checksum
rule.
Apply a system reset to active the new OB_CP setting.
Rev. 1.10
Mode
User application
O
O
(Note 1)
O
(Note 1)
O
39 of 366
(Note 1)
ICP/Debug mode
X (read as 0)
X
X
O
November 09, 2018

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the HT32F52220 and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Ht32f52230

Table of Contents