UG-1262
Rev. B | Page 199 of 312
COMMAND REGISTER
Address0x40018008, Reset: 0x00000000, Name: CMD
Write this register to execute a specified command. The user key must first be written to the key register for most command requests to
be honored. See the Key Register section for details.
Table 226. Bit Descriptions for CMD
Bits Bit
Name
Settings
Description
Reset Access
[31:4] Reserved
Reserved.
0x0 R
[3:0] VALUE
Commands. Write command values to this register to begin a specific operation. All
commands except write and idle first require writing the user key to the key register.
0x0 R/W
0x0
Idle. No key is required. No command executed. If flash IP is in the sleep state, this
command wakes the flash by returning command complete and no error codes.
0x1
Abort. User key is required. Use the abort command sparingly to gain access to the flash IP
during time sensitive events. For example, a low voltage alarm can abort an ongoing flash
write or erase command to enable user code to shut down the device. The flash array can be
damaged by overuse of the abort command. If this command is issued, any command
currently in progress stops abruptly, if possible. The status indicates a command was
completed with an abort error. Abort is the only command that can be issued while another
command is already in progress, with the exception of stacking one write command on top
of a single ongoing write command. All other overlapping command combinations are
invalid unless the new command is an abort. If a write or erase is aborted, some flash IP
timing requirements can be violated and it is not possible to determine if the write or erase
completed. Read the affected locations to determine the outcome of the aborted
commands. An aborted command can result in a weak programmed flash. It is always
advisable to erase the affected region and reprogram it. Depending on how far along the
flash controller is in the process of performing a command, an abort is not always possible.
Some flash IP timing parameters must not be violated. It is difficult to predict what these
parameters are in software. Therefore, consider aborts to be a request that may have no
effect on actual command duration.
0x2
Requests flash to enter sleep mode. User key is required. When sleeping, any ICode,
DCode, or DMA transaction wakes the flash automatically. The wake-up process takes
approximately 5 μs. If user code can predict approximately 5 μs ahead of time that the
flash is required, the user can write an idle command to the CMD register to manually
wake the flash. An abort command is also respected for waking the device and returns
the appropriate status bits, indicating that the sleep command was aborted. When
awoken for any reason, the device remains awake until user code asserts a sleep command.
0x3
Sign. User key is required. Use this command to generate a signature for a block of data.
Signatures can be generated for blocks of whole pages only. Write the address of the start
page to the PAGE_ADDR0 register, write the address of the end page to the PAGE_ADDR1
register, and then write this code to the CMD register to start the signature generation.
When the command has completed, the signature is readable from the signature register.
0x4
Write. No key is required. This command takes the address and data from the KH_ADDR
register, KH_DATA0 register, and KH_DATA1 register and executes a single 64-bit write
operation targeting the specified address. More information can be found in the
Writing Flash section and the Write Protection Register section.
0x5
Checks all user space and fails if any bits in user space are cleared. User key is required.
Performs a blank check on all user space. If any bits in user space are cleared, the
command fails with a read verify status. If all of user space is 0xFF, the command
passes. This command is intended to support early customer software development.
When an unprogrammed device boots with security features preventing reads and
writes of user space, this command can be used to verify that the user space contains
no proprietary information. If this command passes, read and write protection of user
space is cleared.
0x6
Erase page. User key is required. Write the address of the page to be erased to the
PAGE_ADDR0 register, then write this code to the CMD register. When the erase has
completed, the full page is verified automatically to ensure a complete erasure. If there
is a read verify error, it is indicated in the STAT register. To erase multiple pages, wait
until a previous page erase has completed. Check the status, then issue a command to
start the next page erase.
0x7
Mass erase. User key is required. Erase all of flash user space. When the erase has
completed, the full user space is verified automatically to ensure a complete erasure. If
there is a read verify error, it is indicated in the status register.