Note: Requires that CCFG.permissions.allowChipErase == ALLOWED
- Perform SWD connect and reset device (through SWD reset or pin reset) to enter SACI.
- If a user record needs to be kept, read out contents using SACI_CMD_MISC_GET_CCFG_USER_REC.
- Perform the SACI_CMD_FLASH_ERASE_CHIP command.
- If there are main sectors (logging, runtime configuration, and so on) that should not be erased these should have been identified in CCFG.flashProt.chipEraseRetain and the option retainSelMainSectors passed to the SACI_CMD_FLASH_ERASE_CHIP command.
- If applicable, write back the user record using SACI_CMD_FLASH_PROG_CCFG_USER_REC.
- Program in the image using a sequence of SACI_CMD_FLASH_PROG_MAIN_SECTOR commands or one or more SACI_CMD_FLASH_PROG_MAIN_PIPELINED commands.
- Optionally verify that the image is correctly programmed using one or more SACI_CMD_FLASH_VERIFY_MAIN_SECTORS(crc32_calculated_or_extracted_from_image).
- Program in CCFG sector using SACI_CMD_FLASH_PROG_CCFG_SECTOR(skipUserRec).
- Optionally, verify the CCFG sector using SACI_CMD_FLASH_VERIFY_CCFG_SECTOR (identity check). If the user record has CRC32 at the end of the user record, integrity can be checked too.
- The device can now be reset/rebooted with SACI_CMD_BLDR_APP_RESET_DEVICE after which the device boots into the application or any configured bootloader.