EEPROM Emulation Using Flas memory

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

EEPROM Emulation Using Flas memory

3,172 次查看
SAchary11
Contributor I

Hello All,

I am using MPC5748G board for our development purpose, I need to store some of the application data in Flash memory.

Since it is a flash memory erasing has to be handled in block wise, I have gone through the document there they have mentioned that for every active data block , we need to configure one parallel non active block.

and when active block is full, the data is swapped from active block to non active, once the copying is done the non active block will be made as active and other  onewill be erased and made it as non active.

I have some queries regarding eee configuration and also one working principle of EEPROM Emulation

1. 

SAchary11_0-1659000233602.png

In the above figure you can see that I have created 3 blocks, each blocks I have assigned with different address range

But I noticed in openSDA that by default 2 blocks will be created with same address range when we open the eee components, Is it with purpose?

2. How to configure the parallel non active blocks?

3. If I make all 3blocks as active then how Background and Foreground switch will be done?

4. I have also noticed the concept of partition, Can somebody explain me regarding this, Do I need to configure this?

5. In the configuration tab I see that maximum number of Programming and erasing cycle, Where do I find the threshold value for programming and erasing?

Does it mean in one power cycle maximum number of time programming and erasing will be allowed or in whole life cycle of flash?

I am really stuck in this question, It will be helpful if you give some idea regarding the same.

 

0 项奖励
回复
4 回复数

3,160 次查看
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

 

  1. I can see on the screenshot that the blocks are not configured correctly. See the Table 3-2 on page 126 in the reference manual:

https://www.nxp.com/webapp/Download?colCode=MPC5748GRM

 

It’s responsibility of user to ensure that blocks configured in eee component correspond to physical flash blocks.

As you can see in the Table 3-2, all these blocks are in partition 2, not 1.

All these blocks belong to Mid Block Space (see “74.1.1.1 C55FMC_LOCK0 and C55FMC_SEL0 register bit mapping”).

The “Block enable mask” settings are also wrong. It should be (you can also get this from the bit mapping mentioned above):

Block #0: 0x00000001

Block #1: 0x00000002

Block #2: 0x00000100

 

  1. Nothing like this is needed.
  2. You are not allowed to configure all blocks as active. You should get error message in this case.
  3. There are partitions to support Read-While-Write operations. In other words, when you program or erase one partition, you are not allowed to access this partition but you can still read or run your code from other partitions. So, it’s necessary to inform eee driver about the partition of configured blocks.
  4. Just hold the mouse cursor over a required parameter and you will see help like this:

lukaszadrapa_0-1659345249488.png

 

Maximum if re-erasing and re-programming will take effect if one specific erase or program operation fails in runtime, the driver will try to repeat the operation as configured. Personally, I would keep these numbers low, probably default 1 or maybe little bit more. I think it doesn’t make sense to use higher number here. It can help with some sporadic errors but not if the flash is already bad.

 

Regards

Lukas

0 项奖励
回复

3,155 次查看
SAchary11
Contributor I

Hi Lucas,

SAchary11_0-1659357840167.png

 

Do you have any document which states the exact meaning of above configuration (or details of the configuration), I am not able to understand the configuration completely with the highlighted texts.

 

1. I have one queries regarding record,

As you can see my configuration, I have defined my data size of the record as 10

Let's say in the application code I will write 128 byte of data with id number 5,

does this 128 data will be stored in 13 records with same id as per configuration? or do I need to increse the data size of the Record

does it create any problem while reading 128 byte of data with same data?

Also can you please let us know what is "Number of bytes in reading"(Bit confused)

 

Can you share any document which gives the detailed overview of partition mechanism

 

 

 

0 项奖励
回复

3,147 次查看
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi Sukesh,

the documentation can be found at this path:
c:\NXP\S32DS_Power_v2.1\S32DS\software\S32_SDK_S32PA_RTM_3.0.3\doc\S32SDK_MPC5748G_UserManual.pdf

However, it's not very detailed in case of EEE. Some more details can be found in documentation of previous standalone EEE driver (this driver is a predecessor of this driver in SDK) - attached.

You can select between fixed length scheme or variable length scheme. If you select fixed length scheme with data size 10, all records will have size 10 bytes. So, you need to always write and read 10-bytes records. If you need to always store 128 bytes records, select fixed length and 128 bytes size. If you need to use different sizes, use variable length scheme and define the size for each ID separately.

The other parameters should be explained by this:

lukaszadrapa_0-1659421417177.png

 

Regards,
Lukas

0 项奖励
回复

3,143 次查看
SAchary11
Contributor I

Hi Lucas,

Thanks for the document! Have a nice day!

0 项奖励
回复