How to repeatedly write Data Flash section (S32K116)

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

How to repeatedly write Data Flash section (S32K116)

Jump to solution
2,463 Views
hirnbayfried
Contributor I

Hi there!

Scenario / partitioning:

24 k of FlexNVM used for EEE-Backup

8 k of FlexNVM used as Data Flash

-> 0,5 k FlexRAM as "regular" RAM / section program buffer

-> 1,5 k FlexRAM as EEE

How do I write this Data Flash repeatedly?

From the ref manual I get that only Program Section command is available for D-Flash.

This means that up to 0,5 k of FlexRAM could be reserved for serving as "section program buffer".

This should have no impact on the remaining 1,5 k FlexRAM, which are configured as EEE, right?

I mean, I don't have to switch EEE-mode on and off every time I want to write to D-Flash, correct?

Then after I have programmed one section of D-Flash, how do I erase it before reprogramming?

Because the only erase commands I can find for Data Flash are "Erase All Blocks" and "Erase All Blocks Unsecure". (Ref Manual 36.5.9.2 Flash commands)

"Erase Flash Sector" appears to be not applicable according to the ref manual.

Does anyone have an idea?

Or is it as easy as writing something like (*D_Flash_Addr) = 0xA5A5A5A5 and the controller does the rest (load / erase / write old content + new 32 Bit... don't think so!)?

Thanks for Your time!

Labels (1)
Tags (3)
1 Solution
1,890 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,
How did you configure 0.5k of FlexRAM as RAM and 1.5k as EEPROM.
There is no such option. If you use EEPROM, the whole 2k of FlexRAM is used as EEPROM.

pastedImage_1.png

You can use Program Phrase and Erase Flash Sector commands on DFlash.
Please see Section 36.5.11
“When required by the command, address bit 23 selects between program flash memory (=0) and data flash memory (=1).”

Regards,
Daniel

View solution in original post

3 Replies
1,891 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,
How did you configure 0.5k of FlexRAM as RAM and 1.5k as EEPROM.
There is no such option. If you use EEPROM, the whole 2k of FlexRAM is used as EEPROM.

pastedImage_1.png

You can use Program Phrase and Erase Flash Sector commands on DFlash.
Please see Section 36.5.11
“When required by the command, address bit 23 selects between program flash memory (=0) and data flash memory (=1).”

Regards,
Daniel

1,890 Views
hirnbayfried
Contributor I

Hello Daniel, thanks for Your reply!

I must have misinterpreted some information regarding using not all of EEE to keep 1:16 ratio between EEE and E-Flash.

So in my case, if we configure 24/32 k of FlexNVM as E-Flash and 2/2 k of FlexRAM as EEE, only 1,5 k of EEE should be used in order to keep 1:16.

The remaining 0,5 k of FlexRAM should not be touched in this case (to achieve the guaranteed write / erase cycles).

Since Program Phrase and Erase Flash Sector commands are available for D-Flash (which is a great relief! :smileyhappy:), I find the table directly below 36.5.9.2 Flash commands to be misleading.

0 Kudos
Reply
1,890 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hello Sascha,

the table is really misleading. It will be fixed.

Thanks for pointing this out.

Regards,

Daniel

0 Kudos
Reply