![Infineon Technologies XC2200 User Manual Download Page 106](http://html1.mh-extra.com/html/infineon-technologies/xc2200/xc2200_user-manual_2055439106.webp)
XC2200 Derivatives
System Units (Vol. 1 of 2)
Memory Organization
User’s Manual
3-45
V2.1, 2008-08
MemoryX2K, V1.3
3.9.7
Protection Handling Examples
Some examples on how to work with the protection system.
Delivery State
The device is delivered in the “non-protected state”.
Security page 1 is erased (so it does not contain the “lock code” AA55AA55
H
).
Security page 0 is erased and so “invalid” but because SecP1 is erased this data is
anyhow not evaluated. Only its content is copied into corresponding the registers.
During startup the bits DDF and DCF are set depending on the start mode but as RPA
and WPA are inactive all accesses to the flash memory are allowed.
The data sectors of the flash memory are delivered in the erased state as well. All sectors
can be programmed. After uploading the software the customer can install write and read
protection.
First Time Password Installation
In order to install a password generally the lock code in SecP1 has to be erased. In this
case the code is not present.
After that SecP0 must be erased with “
” in order to be able to
change RPRO. Erasing SecP0 clears RPRO to “00
B
” which is an invalid state. After
finishing the erase command the IMB Core restores the IMB_FSR and IMB_IMBCTR
fields from the flash data.
Because no lock code is present in SecP1 the invalid state of RPRO has no effect on the
user visible protection. Still all parts of the flash memory can be written.
The second step is to program the information of SecP0 with the required security
information. Again the IMB Core reads immediately back the stored data and initializes
the security system. As SecP1 still does not contain the lock code the device stays in the
“non-protected” mode.
The security pages cannot be read directly by customer software. The data programmed
into SecP0 can therefore only be verified indirectly. The data of the RPRO and SnU fields
can be checked by reading the IMB_PROCON and IMB_FSR registers. The passwords
can be verified with the command “
”. If the password does not
match the bit PROER is set. But because of the erased SecP1 the flash memory stays
writable. So after erasing SecP0 the correct password can be programmed again.
After the SecP0 was verified successfully SecP1 gets programmed with the lock code
AA55AA55
H
which enables the security settings of SecP0.
Because the password validation left RPRODIS set the command “
” must be used to finally activate the new protection.