Hi.
In a previous response.
"If a power failure occurs while erasing a sector of Flash Read-Only Memory (FROM), or while writing to FROM, it can lead to corruption of the flash content. This is because the erase or program operation is an atomic process that, if interrupted, may leave the flash in an undefined state. Depending on when the interruption occurs, you might encounter issues such as double-bit ECC (Error Correction Code) errors, which the system cannot correct."
I found the following information.
If a portion of the FROM is used with EEPROM emulation, could the code area of the FROM (where the program is written) be affected by this system uncorrectable error?
Solved! Go to Solution.
Hi,
As you know that the KM14 does not have FlexNVM, it has only program flash, so you have to use the second method.
When you erase/program flash, the flash can not be accessed,so you have to disable interrupt or allocate vector table and ISR in RAM, the code to operate flash must be copied to internal RAM and execute from RAM.
if a power failure occurs when writing to FROM and a FROM error occurs,it does not take affect to the other flash page. error can be resolved by erasing operation.
Hope it can help you
BR
XiangJun Rong
Hi,
Can you tell us the part number you are using? not all Kinetis derivatives support EEPROM.
BR
XiangJun Rong
Hi,
As you know that there are two methods to implement the virtual EEPROM, which one is used is dependent on the flash resource.
For example for Kinetis family K64, this is the memory resource:
The K64 has FlexNVM and FlexRAM resources, which can simulate the EEPROM by hardware.
The second is the MCU has only on-chip programmable flash, if you want to implement EEPROM function, you can declare an array with the page flash size or multiple page size, which is saved in SRAM. After start-up, you can copy the array from flash, then the application can write the array as EEPROM, after a fixed cycle time, or whatever you expected, you can write the array to flash.
Hope it can help you
BR
XiangJun Rong
Thanks for the answer.
I am considering using FROM for VEE and am thinking of the kinetisKM14 series.
So, if a power failure occurs when writing to FROM and a FROM error occurs, will this affect other areas of FROM? For example, would it be impossible to fetch the program code?
Also, can FROM errors be resolved by erasing sectors?
I am thinking of checking VEE when recovering from a power failure and erasing sectors if there is an error.
Thank you in advance.
Hi,
As you know that the KM14 does not have FlexNVM, it has only program flash, so you have to use the second method.
When you erase/program flash, the flash can not be accessed,so you have to disable interrupt or allocate vector table and ISR in RAM, the code to operate flash must be copied to internal RAM and execute from RAM.
if a power failure occurs when writing to FROM and a FROM error occurs,it does not take affect to the other flash page. error can be resolved by erasing operation.
Hope it can help you
BR
XiangJun Rong