cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to manipulate datas stored only on the flash memory?

jean_prieur
Associate III
Posted on August 19, 2013 at 18:36

Hello,

I'm a newbie with microcontrolers and their memories. I want to manipulate several big tables (around 50kBytes), that mean I want to access to theses data and change their values.

Of course the RAM memory of my STM32F407 is not enough to store all theses tables.

Is it possible to simply declare these tables in the flash memory, and to ensure that operations are performed on the flash memory ?

Thanks !

Jean
5 REPLIES 5
Posted on August 19, 2013 at 19:00

You'd need to manage the erase/write operation on flash manually.

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

Clive's described the, ''how'' - but perhaps we should visit the, ''why?''

Manipulating data w/in flash is far more demanding - and vastly more time/resource consuming - than impacting identical data - stored on chip in sram.  And certain M4's here have nearly 200K of sram.

Minus supporting/amplifying argument - suspect that those ''manipulations'' are better done w/in internal or external sram - and the flash be used for ''post manipulation'' data storage...

dthedens23
Associate II
Posted on August 20, 2013 at 00:21

I would second that.

The internal flash is not meant to be continuously erased and reprogramed.

This is better suited to external SPI parts that can handle a million erase cycles.

Better to cache the data in RAM (with an F4) then write back to SPI EEPROM when changes are detected.

jean_prieur
Associate III
Posted on August 20, 2013 at 12:50

Thanks for theses details, you answered my doubts.

Because I need to operate on my tables quite frequently (like each 5ms) I think I can't work on the flask memory - so I need to find solution to reduce the tables memory space. Maybe with a linked list.

Another question: I read that in microcontrolers, the software is stored and works on the flash memory. This means, if I have a 192kb of ram in my uC, this is close to 192kb of ram memory for my variables ?

emalund
Associate III
Posted on August 20, 2013 at 15:04

I would second that.

 

The internal flash is not meant to be continuously erased and reprogramed.

 

 

not meant to, it will even 'die' after, dependong on chip. after 1000 or 10000 erases.

Erik