cancel
Showing results for 
Search instead for 
Did you mean: 

How much is the minimum number of pages used with EEPROM emulation(AN4894) techniques?

mefilti
Associate II

I'm implementing eeprom emulation with the STM32G0 series microprocessor. I am using the AN4894 Application note and the X-CUBE-EEPROM(4.0.0) software, but I have encountered a problem.

Let me explain how I use it first. I'm recording 128 values that are 32 bits, and this value is constantly updated. For example, every time I press the button, the value increases and records this value.

As the application note says, a minimum of 2 pages can be used.

0693W00000Hr36aQAB.png 

When I use GUARD_PAGES_NUMBER as 0, it uses 2 pages for the eeprom emulation, but the values that have been written are constantly updated, the 2-page field fills up and the change process does not occur again.

0693W00000Hr38CQAR.png 

The value of GUARD_PAGES_NUMBER is 0, 2, 4 ... it can get its values. when I use the value 2. When updating the values, when the first 2 pages are full, the last values are copied to the other 2 pages and the values are not lost.

0693W00000Hr38WQAR.png 

The protection of values is exactly what I want. But when I use it like this, at LEAST 4 PAGES are used. Each page is 2kb for the STM32G0 series, a total of 8kb is allocated for this process. Taking up 8kb of space for 128 values of 32 bits each is undesirable for my application.

In a scenario where the saved values can be changed periodically, but there is no data loss or flash field filling problem, I can use a minimum of how many pages. It is convenient for me to use no more than 2 pages.

I'm waiting for your help

4 REPLIES 4
TDK
Guru

If all of your data fits within a page (which it does here), the minimum number of pages is 2.

If you want to increase endurance beyond that point, you need at least 2 guard pages to make a difference.

If you feel a post has answered your question, please click "Accept as Solution".
mefilti
Associate II

The data to be written to the eeprom fits on one page, but it doesn't fit because the process of changing the data occurs when you press the button.

After the page is full, it needs to copy the current values to the other page and delete the old page. I have performed this operation using 4 pages, but I need to perform it using at least 2 pages.

The data to be written to the eeprom fits on one page, but it doesn't fit because the process of changing the data occurs when you press the button.

After the page is full, it needs to copy the current values to the other page and delete the old page. I have performed this operation using 4 pages, but I need to perform it using at least 2 pages.

MM..1
Chief II

You dont explain what you store and why full data changes on every press button, but normal efficient eeprom emulate is based on minimize rewrites. You can emulate with one minimum page but lifetime will lowest possible. I use more techniques , but one is based on 16bit variable marker and 16bit data . Only new changed data create new write and last is valid. When you use one page on full event you need copy actual valid vars to ram, erase and write it back. Two and more pages skips ram and is better...