EEPROM emulation

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

EEPROM emulation

Jump to solution
1,323 Views
zunda1958
Contributor II

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.


https://community.nxp.com/t5/Kinetis-Microcontrollers/What-happens-if-a-power-failure-occurs-while-e... #M66020.

 

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?

 

 

Labels (1)
Tags (1)
0 Kudos
Reply
1 Solution
1,206 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

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

View solution in original post

0 Kudos
Reply
7 Replies
1,277 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

Can you tell us the part number you are using? not all Kinetis derivatives  support EEPROM.

BR

XiangJun Rong

0 Kudos
Reply
1,256 Views
zunda1958
Contributor II
I asked about software that uses FROMs like EEPROMs, not that they have built-in EEPROMs.
0 Kudos
Reply
1,255 Views
zunda1958
Contributor II
Software to emulate EEPROM. For example, virtual EEPROM emulation software called VEE.
0 Kudos
Reply
1,235 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

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:

xiangjun_rong_0-1713147873988.png

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

0 Kudos
Reply
1,228 Views
zunda1958
Contributor II

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.

0 Kudos
Reply
1,207 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

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

0 Kudos
Reply
1,192 Views
zunda1958
Contributor II
Thank you very much.
Understood.
0 Kudos
Reply