How can I store more than 4k bytes in NVM??

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

How can I store more than 4k bytes in NVM??

Jump to solution
1,483 Views
saireddy_saredd
Contributor III

Hallo ,

I have configured eeprom with 4k bytes and the maximum endurance achieved 310kcycles. But I need to store more than 4k bytes data in NVM.I see FlexNVM storage is 64K bytes.

How do I know how much data left in FlexNVM??

Why we need 64k bytes FlexNVM for eeprom 4k backup ??

Is there any way can store more than 4k bytes in NVM??

 

Best Regards,

Sai

@lukaszadrapa @ @vicentegomez 

0 Kudos
Reply
1 Solution
1,413 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

from mentioned application note:

lukaszadrapa_0-1652676447784.png

In short, when you write to FlexRAM memory, new record is programmed to the FlexNVM. EEE controller is checking the content, once active block in FlexNVM is going to be full, it checks content of previous blocks, it programs still valid data to new block, so old block can be erased and new block can be set as active, etc...

Always write only aligned 16bit or 32bit word to FlexRAM. Anything else will generate more records than necessary.

The partition is supposed to be set only once during lifetime of a product. You would not be able to do that anyway because EraseAllBlocks command is needed to destroy the old partition and then you could set new one. But because you need to erase everything first, it's not an option.

Regards,

Lukas

View solution in original post

0 Kudos
Reply
5 Replies
1,462 Views
saireddy_saredd
Contributor III

Hi Lukas,

Thank you very much for the information,

Currently I am working with S32K146 micro-controllers. It has 64K FlexNVM.

So, I can divide 64k in 2 groups. 48K for E-Flash(EEPROM) and rest 16K for D-flash

EEPROM with 4k bytes - It has plenty of cycles to write

saireddy_saredd_0-1652370550865.png

 

Now I have confused with D-flash write cycles- I have read in S32K datasheet and it showing 1K cycles maximum.

Does it true we can only write 1K maximum cycles in D-flash??

Do you have any SDK example projects for Read and write with P-flash or D-Flash ??

Best Regards,

Sai

 

 

 

0 Kudos
Reply
1,448 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi Sai,

yes, there's 1K cycles only. Notice that there's also a difference if the flash is programmed directly by user or if EEE is used. The reason is that EEE use slightly different programming algorithm which is capable to perform more cycles. This is hidden to user and it cannot be used by user. So, if EEE is used then overall number of cycles is higher.

The example can be found here:

c:\NXP\S32DS.3.4\S32DS\software\S32SDK_S32K1XX_RTM_4.0.2\examples\S32K146\driver_examples\system\flash_partitioning\

Regards,

Lukas

0 Kudos
Reply
1,444 Views
saireddy_saredd
Contributor III

Hi Lukas,

Thank you so much for your explanation,

How come we can achieve high endurance with emulated eeprom ??
The back up is 64K bytes for 4K bytes eeprom. So, will it divide 16 sectors and write every time in different sector (only 4k sector)?? 

Does 64K bytes reach maximum cycles at one point of time or only 4K bytes sector ??

Does 32 bits aligned data write gives better endurance than 8 bytes 4 writes?? (32bits Vs 4*8bits)

For example: If I create 64K bytes for E-flash and 0 bytes D-Flash and after 5 years I want to change the partition like 32K bytes for E-Falsh and 32K bytes for D-flash.

Is it allowed like that??

I did not find this information in any document. Please explain bit clearly

Thank you again

Best Regards,

Sai

 

0 Kudos
Reply
1,414 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

from mentioned application note:

lukaszadrapa_0-1652676447784.png

In short, when you write to FlexRAM memory, new record is programmed to the FlexNVM. EEE controller is checking the content, once active block in FlexNVM is going to be full, it checks content of previous blocks, it programs still valid data to new block, so old block can be erased and new block can be set as active, etc...

Always write only aligned 16bit or 32bit word to FlexRAM. Anything else will generate more records than necessary.

The partition is supposed to be set only once during lifetime of a product. You would not be able to do that anyway because EraseAllBlocks command is needed to destroy the old partition and then you could set new one. But because you need to erase everything first, it's not an option.

Regards,

Lukas

0 Kudos
Reply
1,468 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

You can take a look at this application note to understand how Emulated EEPROM works:

https://www.nxp.com/docs/en/application-note/AN11983.pdf

The FlexNVM can be used either directly using normal program and erase operations or you can use Emulated EEPROM feature when you write your data to FlexRAM and EEE stores the records to FlexNVM automatically.

Emulated EEPROM is usually used for data which are changed frequently/periodically. If you have a group of data which are changed frequently and group of data which are changed rarely, the best option is to separate them. You can put first group to EEE, second group to normal program flash. This can save some cycles due to nature of EEE algorithm.

Regards,

Lukas

0 Kudos
Reply