User-Selected Words - WCH CH32V003 Series Reference Manual

Table of Contents

Advertisement

CH32V003 Reference Manual
2)
Check the FLASH_CTLR register FLOCK bit, if it is 1, you need to execute the "fast programming mode
unlock" operation.
3)
Check the BSY bit of the FLASH_STATR register to confirm that there are no other programming
operations in progress.
4)
Set the PAGE_ER bit of FLASH_CTLR register to '1' to enable the fast page erase (64 bytes) mode
function.
5)
Write the first address of the fast erase page to the FLASH_ADDR register.
6)
Set the STAT bit of FLASH_CTLR register to '1' to initiate a fast page erase (64 bytes) action.
7)
Wait for the BSY bit to become '0' or the EOP bit of FLASH_STATR register to be '1' to indicate the end
of erase, and clear the EOP bit to 0.
8)
Query FLASH_STATR register to see if there is an error, or read the erase page address data checksum.
9)
Continue fast page erase can repeat steps 5-8, end erase will PAGE_ER bit clear 0.

16.5 User-selected words

The user-selected word is solidified in FLASH and will be reloaded into the corresponding register after system
reset, and can be erased and programmed by the user at will. The user select word information block has a
total of 8 bytes (4 bytes for write protection, 1 byte for read protection, 1 byte for configuration options, and
2 bytes for storing user data), and each bit has its inverse code bit for checksum during loading. The following
describes the structure and meaning of the select word information.
[31:24]
Select word byte 1
inverse code
Address
Bit
0x1FFFF800
0x1FFFF804
0x1FFFF808
0x1FFFF80C
Name/Byte
RDPR
RST_MOD
USER
[4:3]
V1.3
Table 16-3 32-bit selection word format division
[23:16]
Select word byte 1
Table 16-4 User selection word information structure
[31:24]
nUSER
nData1
nWRPR1
nWRPR3
Read protection control bit to configure whether the code
in the flash memory can be read out.
0xA5: if this byte is 0xA5 (nRDP must be 0x5A), it
means that the current code is in a non-read protected
state and can be read out.
Other values: indicates code read protection status, not
readable, pages 0-31 (4K) will be automatically write
protected and not controlled by WRPR0.
PD7 multiplexed as external pin reset.
00: Ignoring pin states within 128us after turning on the
multiplexing function.
01: Ignoring pin states within 1ms after turning on the
E
multiplexing function.
10: Ignoring pin states within 12ms after turning on the
multiplexing function.
11: Multiplexing function off, PD7 for I/O function.
[15:8]
Select word byte 0
inverse code
[23:16]
[15:8]
USER
nRDPR
Data1
nData0
WRPR1
nWRPR0
WRPR3
nWRPR2
Description
176
http://wch.cn
[7:0]
Select word byte 0
[7:0]
RDPR
Data0
WRPR0
WRPR2
Reset value
0x01
11

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents

Save PDF