Document Number: 002-00833 Rev. *L
Page 39 of 74
S29VS256R
S29VS128R
S29XS256R
S29XS128R
8. Sector Protection/Unprotection
The Sector Protection/Unprotection feature disables or enables programming or erase operations in one or multiple sectors and can
be implemented through software and/or hardware methods, which are independent of each other. This section describes the
various methods of protecting data stored in the memory array.
8.1
Sector Lock/Unlock Command
The Sector Lock/Unlock command sequence allows the system to protect all sectors from accidental writes or, unprotect one sector
to allow programming or erasing of the sector. When the device is first powered up, all sectors are unlocked. To lock all sectors
(enter protected mode), a Sector Lock/Unlock command must be issued to any Sector Address. Once this command is issued, only
one sector at a time can be unlocked until power is cycled. To unlock a sector, the system must write the Sector Lock/Unlock
command sequence. Two cycles are first written: addresses are x555h and x2AAh, and data is 60h. During the third cycle, the
sector address (SLA) and unlock command (60h) are written, while specifying with address A6 whether that sector should be locked
(A6 = V
IL
) or unlocked (A6 = V
IH
).
A Program or Erase operation will check the unlocked Sector Address only at the beginning of the Program or Erase operation. It is
not necessary to keep the sector being Programmed or Erased unlocked during the operation. The system can change the unlocked
Sector after programming or erasing the sector has begun. An Erase Resume or Program Resume command does not check the
value of the unlocked Sector.
If A6 is set to V
IL
,then all sectors in the array will be locked. Only one sector at a time can be unlocked.
If a Sector Lock/Unlock command is issued to a sector that is protected by the Sector Lock Range command, all sectors in the part
will be locked.
8.2
Sector Lock Range Command
This command allows a range of sectors to be protected from program or erase (locked) until a hardware reset or power is removed
from the device. Once this command is issued, all sectors are protected and the Sector Lock/Unlock command is ignored for the
selected range of sectors. Sectors outside of the selected range must be unlocked one sector at a time using the Sector Unlock
command in order to be erased/programmed.
Two cycles are first written: addresses are x555h and x2AAh, and data is 60h. During the third cycle, the sector address (SLA) and
load sector address command (61h) is written. This cycle sets the lower sector address of the range. During the fourth cycle, the
sector address (SLA) and load sector address command (61h) is written. This cycle sets the upper sector address of the range. The
addresses reference a large sector address range (128 KB). If a sector address matches the location of the four small sectors, all of
the small sectors will be protected as a group. The sectors selected by the lower and upper address, as well as all sectors between
these sectors, are protected from program and erase until a hardware reset or power is removed. If the lower and upper sector
addresses are for the same sector then only that one sector is locked. Flash address input A6 (system byte address bit a7) during
both address cycles must be zero (A6 = V
IL
) for the addresses to be accepted as valid.
If the first sector address cycle contains an address which is higher than the second sector address cycle, then the command
sequence will be invalid. If A6 is set to one (A6 = V
IH
) on either address cycle, the command sequence will disable subsequent
Sector Lock Range commands.
A valid Sector Lock Range command sequence is accepted only once after a Hardware Reset or initial power up. Additional Sector
Lock Range commands will be ignored.
If a Sector Unlock command tries to unlock a Sector within the Sector Lock Range, the Sector will remain in locked state. Similarly, if
a Sector that is currently unlocked by the Sector Unlock command is overlapped by a subsequent Sector Lock Range, that sector
will be locked and program erase operations to that region will be ignored.
This command is generally used by trusted boot code. After power on reset boot code has the option to check for any need to
update sectors before locking them for the remainder of power on time. Once boot code is satisfied with the content of sectors to be
protected the Sector Lock Range command is used to lock sectors against any program or erase during normal system operation.
This adds an extra layer of protection for critical data that must be protected against accidental or malicious corruption. Yet,
maintains flexibility for trusted boot code to perform occasional updates of the data. It is important to issue the Sector Lock Range
command even if no sectors are to be protected so that sectors that should remain available for update cannot be later locked by
accidental or malicious code behavior.