Perform chip erase.
This erases the CCFG, SCFG, various
other non-MAIN sectors used by ROM and MAIN sectors of the flash, by:
- Invalidating CCFG (all fields in Ccfg.bootCfg changed to 0)
- Erasing all MAIN sectors, except retained sectors (if any)
- Erasing various other non-MAIN sectors used by ROM
- Erasing the SCFG sector
- Erasing the CCFG sector
The command has an option to retain
selected MAIN sectors:
- Specified by the existing CCFG (before the chip erase) in:
- Ccfg.chipEraseRetain.mainSectors0_31 (1 sector per bit)
- Ccfg.chipEraseRetain.mainSectors32_255 (8 sectors per bit)
- Ccfg.chipEraseRetain.mainSectors256_511 (8 sectors per bit)
- If the CCFG is valid and the retainSelMainSectors option is specified:
- The HSM FW region will be retained no matter the value of
Ccfg.chipEraseRetain* configurations making it more difficult to
erase the HSM FW on accident.
- The option relies on sticky write/erase protection in the VIMS module.
Therefore, after use:
- SACI_CMD_FLASH_ERASE_CHIP cannot be used again during the current
SACI session
- The retained MAIN sectors are write protected during the current
SACI session
If successful, CCFG becomes
invalid:
- CCFG/SCFG restrictions do no
longer apply
- Commands that require valid
CCFG/SCFG are prohibited
Restrictions
These conditions must be true:
- Fcfg.permissions.allowChipErase = 0xA (FCFG_PERMISSION_ALLOW)
- If CCFG is valid:
- Ccfg.permissions.allowChipErase = 0xA (CCFG_PERMISSION_ALLOW)
- If SCFG is valid:
- Scfg.permissions.allowChipErase = 0xA (SCFG_PERMISSION_ALLOW)
- If the "retain selected MAIN sectors" option is used:
- CCFG must be valid (Ccfg.bootCfg.crc32 is valid)
- For flash sector not valid for the device type, the value of these
invalid sectors within Ccfg.flashProt.chipEraseRetain.mainSectors*
must be set to the register reset value of the corresponding sectors
within the VIMS:WEPR* protection registers
- SACI_CMD_FLASH_ERASE_MAIN_APP or SACI_CMD_FLASH_ERASE_CHIP must not have
executed previously in the current SACI session with the
retainSelMainSectors option
Considerations
This command modifies the CCFG/SCFG.
Certain commands are not allowed after chip erase:
- SACI_CMD_DEBUG_EXIT_SACI_HALT
- In some cases,
SACI_CMD_FLASH_ERASE_CHIP (see restrictions) resets the device and
re-entering SACI is required to re-enable those commands.
Parameter Words
Table 9-31 Parameter Words
| Words |
Bits |
Field |
Value |
Description |
| 0 |
7:0 |
cmdId |
0x09 |
Command ID |
| 15:8 |
respSeqNumber |
User
defined |
Optional response sequence number, included in the
response header |
| 16 |
retainSelMainSectors |
- |
Retain MAIN
sectors, as specified by
- Ccfg.chipEraseRetain.mainSectors0_31 (1 sector per
bit)
- Ccfg.chipEraseRetain.mainSectors32_255 (8 sectors per
bit)
- Ccfg.chipEraseRetain.mainSectors256_511 (8 sectors per
bit)
If the CCFG is
valid and the retainSelMainSectors option is specified, then the
HSM FW region will be retained regardless of the value of
Ccfg.chipEraseRetain* configurations, making it more difficult
to erase the HSM FW by accident.
|
Response Words
Table 9-32 Response Words
| Words |
Bits |
Field |
Value |
Description |
| 0 |
7:0 |
cmdId |
0x09 |
Command ID, copied from the first command
parameter word |
| 15:8 |
respSeqNumber |
User
defined |
Optional sequence number, copied from the first
command parameter word |
| 23:16 |
result |
- |
Command result.
One of the common results, or:
-
INVALID_KEY_PARAM if the key parameter is incorrect
-
FLASH_FSM_ERROR if the flash hardware FSM reported an
error
-
NOT_ALLOWED if restrictions are not met (the command has
no effect)
|
| 31:24 |
dataWordCount |
0 or 3 |
Size of additional
response data, in number of 32-bit words:
- 0 if
retainSelMainSectors = 0
- 3 if
retainSelMainSectors = 1
|
| 1 |
31:0 |
retainedMain0_31 |
- |
The initial value of
Ccfg.chipEraseRetain.mainSectors0_31 (1 sector per bit) |
| 2 |
31:0 |
retainedMain32_255 |
- |
The initial value of
Ccfg.chipEraseRetain.mainSectors32_255 (8 sectors per bit) |
| 3 |
31:0 |
retainedMain256_511 |
- |
The initial value of
Ccfg.chipEraseRetain.mainSectors256_511 (8 sectors per bit) |
Check Sequence
These checks are performed before command execution, in the indicated order:
- If any restriction is violated: Fail with result NOT_ALLOWED
- If key is invalid: Fail with result INVALID_KEY_PARAM