cancel
Showing results for 
Search instead for 
Did you mean: 

using the flash as an EEPROM of STM32F3

hilwan
Associate II
Posted on November 25, 2013 at 17:50

Hi,

This is a post that was posted before in a wrong thread, this post was :

I would like to store my data in memory when the computing is done and used the data for the next use.

I don't have the EEPROM memory on my STM32F3, can i use the flash as an EEPROM?

Thanks in advance for any help.

Clive response was :

 

 

I don't have the EEPROM memory on my STM32F3, can i use the flash as an EEPROM?

Is that a design oversight, or you just don't want to attach one?

You could, however it is not designed for frequent, or multiple writing. Writing and Erasing Flash will cause the processor to stall quite significantly if you are also executing code from it.

ST has some EEPROM emulation examples, but they are not really designed for large structures.

fm response :

I don't have the EEPROM memory on my STM32F3, can i use the flash as an EEPROM?

 

In theory yes, but most probably not.

See the datasheet for FLASH erase/program times, which is in the millisecond range. For a higher data rate, you can evaluate serial SRAM/NVSRAM.

#stm32f3-discovery
19 REPLIES 19
hilwan
Associate II
Posted on November 25, 2013 at 17:56

In fact, i have 8 variables (float)  that i want to store to use them for computing each time the main is executing and i don't want to loose them even if the board is off.

I want to take a portion of the flash integrated in the STM32F3 for that purpose.

There is any example in the libraries given by ST? i didn't see that in the examples i have.

Thanks   

Posted on November 25, 2013 at 17:56

http://www.st.com/web/en/catalog/tools/PF258148

Other resources try googling part# on chip ''STM32F303VC' see Design Resouces

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
hilwan
Associate II
Posted on November 25, 2013 at 17:56

In fact, i have 8 variables (float)  that i want to store to use them for computing each time the main is executing and i don't want to loose them even if the board is off.

I want to take a portion of the flash integrated in the STM32F3 for that purpose.

There is any example in the libraries given by ST? i didn't see that in the examples i have.

Thanks   

hilwan
Associate II
Posted on November 25, 2013 at 18:00

Thanks clive and fm for you fast responses

 

Ok, but how much data and how frequently?

Writing process is done one time and can be stored for many days and reading process is each time the board is on and main is executing.

8 float data 

Posted on November 25, 2013 at 18:19

We cross-posted at 5:56, perhaps why the forum gave you an error and you ended up double posting. Most of these errors occur when it's showing you the refreshed thread. Open the thread in a new window before trying to repost.

I edited the post based on the fact you stated the size/freq, I was responding to the top post.

You might also just want to learn how to write into flash, if you can write a journeled update of the values you can reduce the erase cycles significantly.

STM32F3-Discovery_FW_V1.1.0\Project\Peripheral_Examples\FLASH_Program

STM32F30x_DSP_StdPeriph_Lib_V1.0.0\Project\STM32F30x_StdPeriph_Examples\FLASH\FLASH_Program

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
frankmeyer9
Associate II
Posted on November 25, 2013 at 19:58

That would be fine.

From the history of this thread, I assumed you want to store hundreds of kilobytes per second. In this case, you would get into trouble with the possible writing speed.

Additionally, you may note that the guaranteed number of erase/write cycles is limited. Flash is not designed for frequent change, it will ''wear out'' and become unusable. I'd bet ST guarantees 10k cycles ...

hilwan
Associate II
Posted on November 25, 2013 at 21:56

Thanks for your helpful suggestions, i'll try these examples .

Flash is not designed for frequent change :

 

In this case is better to use an external EEPROM with I2C bus for example?

In my application, i have to store data in the first time( may be one time per month)and are supposed to be read every time the program is executed.

The speed is  not an important criteria because i need speed only after data are loaded from the memory.

frankmeyer9
Associate II
Posted on November 26, 2013 at 09:09

As said, check the datasheet, and compare with your needs.

Writing once in a while is no problem - with erasing/writing once a month, you probably never hit the limit.

In contrast, I had been involved in the design of devices that required persistent storage for an implemented protocol. And 10k guaranteed erase/write cycles would have resulted in a worst-case lifetime of 2..3 weeks. That would have been unacceptable for a commercial device ...

hilwan
Associate II
Posted on December 02, 2013 at 13:02

Hi again,

With your help, now i can use the flash to write and even read. Thanks 

But, i still have a problem. In fact, i want to store float variables, unfortunately FLASH_Status FLASH_ProgramWord(uint32_t Address, uint32_t Data) function allows only integers ones. How can i manage this stuff ?

Thanks in advance for any help,

Best Regards