Perform chip erase.
This erases the CCFG sector 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 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) and
Ccfg.chipEraseRetain.mainSectors32_255 (8 sectors per bit)
- 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 restrictions do no longer apply
- Commands that require valid CCFG 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 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.mainSectors0_31 and
Ccfg.flashProt.chipEraseRetain.mainSectors32_255, must be set to the
register reset value of the corresponding sectors within the VIMS:WEPRA
and VIMS:WEPRB protection registers
- SACI_CMD_FLASH_ERASE_CHIP must not have executed previously in the current SACI
session with the "retain selected MAIN sectors" option
Considerations
This
command modifies CCFG. Certain commands are not allowed after chip erase:
- SACI_CMD_DEBUG_EXIT_SACI_HALT
- SACI_CMD_BLDR_EXIT_SACI_RUN
- In some cases
SACI_CMD_FLASH_ERASE_CHIP (see restrictions)
Reseting the device and reentering SACI is required to reenable those
commands.
Table 8-21 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)
|
31:17 |
reserved0 |
0x0000 |
Reserved |
1 |
31:0 |
key |
0xB7E3A08F |
Flash operation key (magic number) |
Table 8-22 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 2 |
Size of additional
response data, in number of 32-bit words:
- 0 if
retainSelMainSectors = 0
- 2 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) |
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