EEPROM emulation

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

EEPROM emulation

跳至解决方案
3,005 次查看
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?

 

 

标签 (1)
标记 (1)
0 项奖励
回复
1 解答
2,888 次查看
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 项奖励
回复
7 回复数
2,959 次查看
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 项奖励
回复
2,938 次查看
zunda1958
Contributor II
I asked about software that uses FROMs like EEPROMs, not that they have built-in EEPROMs.
0 项奖励
回复
2,937 次查看
zunda1958
Contributor II
Software to emulate EEPROM. For example, virtual EEPROM emulation software called VEE.
0 项奖励
回复
2,917 次查看
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 项奖励
回复
2,910 次查看
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 项奖励
回复
2,889 次查看
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 项奖励
回复
2,874 次查看
zunda1958
Contributor II
Thank you very much.
Understood.
0 项奖励
回复