Reading Kinetis K64 Internal Flash Causes HardFault

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading Kinetis K64 Internal Flash Causes HardFault

No ratings

Reading Kinetis K64 Internal Flash Causes HardFault

Symptoms

As we know: Flash must be programmed after an erase operation. Violation of this rule will cause programming fail and even hardfault(when AHB reading) on Kinetis K64 parts.

Customer accidently uses SDK’s API programming same sector twice(over-programming) without an erase operation. Then when perform AHB reading of this sector(include using JFLash to read this sector), an Hardfault occurs.

Diagnosis

K64 flash has internal ECC on each sector. When over-programming happens, ECC will be crushed and trigger Hardfault when AHB reading of this sector.

Solution

Using SDK API FLASH_VerifyErase to check if this sector is erased. Call FLASH_VerifyErase every time before you want to program the flash.

This problem will impact all Kinetis device which has FTFE flash module.

 

Thanks for Alex Yang provide the material.

Version history
Revision #:
1 of 2
Last update:
‎01-27-2021 05:54 AM
Updated by: