A. Schulz

solved: kinetis sector erase succeeds with some data not deleted

Discussion created by A. Schulz on Mar 2, 2018
Latest reply on Mar 19, 2018 by Jing Pan

MKE18f512 ; Call on FLASH_Erase from "fsl_flash.c" doesn't erase first 96 bits of sector. After power cycle, sector can be erased but next sector erase leaves first 96 bits not erased too.


FLASH_Erase always returns with "kStatus_FLASH_Success".

Algorithm checks a sector for all 0xff. If not, sector gets erased and checked again -> check fails.


This shouldn't be possible according to manual.


Disabling Interrupts (__disable_irq()) nor running completely in RAM changes anything.

Flash config is default startup (Flash_Config = {0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFF7DFE})


Attached file is the main in a generated default project in MCUxpresso V10.0.0 (no clock change).


How can i solve this problem?


Jings reply solved issue.