Forums

Storing parameters in Flash

Started by jkw_ee November 4, 2004
I have about 4KB of operational parameters to be stored in non-
volitile memory but they will be updated occasionally. I have 
experience doing this in EEPROM but this is my first encounter with 
flash. I found the flash routines in the download area but would 
appreciate a chance to talk to anyone who has experience with 
updating and erasing segments in flash. I could use the flash or tag 
on an I2C EEPROM but need to make that decision soon.

Thanks,
Jeremy
jweese@jwee...




Beginning Microcontrollers with the MSP430

working with internal flash on a msp430 is simple.
the docs in ti.com are just ok for assembler.
pay attention to the timing.
 
good luck!

jkw_ee <jkw_ee@jkw_...> wrote:

I have about 4KB of operational parameters to be stored in non-volitile memory
but they will be updated occasionally. I have experience doing this in EEPROM
but this is my first encounter with flash. I found the flash routines in the
download area but would appreciate a chance to talk to anyone who has experience
with 
updating and erasing segments in flash. I could use the flash or tag on an I2C
EEPROM but need to make that decision soon.

Thanks,
Jeremy
jweese@jwee...
			
---------------------------------
Do you Yahoo!?
 Check out the new Yahoo! Front Page.  www.yahoo.com/a




Using flash as a data store is very simple with the MSP430. Flash write 
direct from memory (ie you don't have to move the flash write code to 
RAM) works exceptionally well in my opinion, and is quicker than most 
other devices. I would steer clear of block writes. these can be 
unreliable.

I would go back through the archives on this group where this was 
discussed very heavily. Both in the context of remote code updating and 
use of bulk data storage. The discussion covered many techniques such as 
dtaa integriity, mini file systems etc.

Al

jkw_ee wrote:

> 
> I have about 4KB of operational parameters to be stored in non-
> volitile memory but they will be updated occasionally. I have 
> experience doing this in EEPROM but this is my first encounter with 
> flash. I found the flash routines in the download area but would 
> appreciate a chance to talk to anyone who has experience with 
> updating and erasing segments in flash. I could use the flash or tag 
> on an I2C EEPROM but need to make that decision soon.
> 
> Thanks,
> Jeremy
> jweese@jwee...
> 
> 
> 
> 
> 
> 
> .
> 
>  
> Yahoo! Groups Links
> 
> 
> 
>  
> 
> 
> 
> 


In addition to what others have written, be careful where you write the
data 
into FLASH to be sure it does not conflict with where the compiler puts 
code.  Since you have a lot of data to write, you will not be able to store 
all of it in info FLASH.  You will have to use some of the other 512-byte 
blocks.  Some compilers (like the IAR one I used to use) fill backward from 
the top of memory, so the lower blocks (just above the information blocks) 
would be available.  But the Rowley compiler seems to load low so you would 
want to use some upper blocks that do not conflict with vectors.

Also, if you are using an 'F149, keep in mind the first block just above 
Info Segment A is 256 bytes in size - not 512 like they say all non-info 
blocks are.  The remainder of the blocks are indeed 512 bytes each.

Lou

>I have about 4KB of operational parameters to be
stored in non-
>volitile memory but they will be updated occasionally. I have
>experience doing this in EEPROM but this is my first encounter with
>flash. I found the flash routines in the download area but would
>appreciate a chance to talk to anyone who has experience with
>updating and erasing segments in flash. I could use the flash or tag
>on an I2C EEPROM but need to make that decision soon.

_________________________________________________________________
Get ready for school! Find articles, homework help and more in the Back to 
School Guide! http://special.msn.com/network/04backtoschool.armx


On Fri, Nov 05, 2004 at 01:32:38AM +1030, onestone wrote:
> 
> Using flash as a data store is very simple with the MSP430. Flash write 
> direct from memory (ie you don't have to move the flash write code to 
> RAM) works exceptionally well in my opinion, and is quicker than most 
> other devices. 

.. and need very little current. 0.3mA approx (much less than any other
flash I have seen).

        Matthias

How I can determine what is the first position in flash to save data, to
prevent risk of erase code in flash? 

Cleber
  ----- Original Message ----- 
  From: onestone 
  To: msp430@msp4... 
  Sent: Thursday, November 04, 2004 1:02 PM
  Subject: Re: [msp430] Storing parameters in Flash


  Using flash as a data store is very simple with the MSP430. Flash write 
  direct from memory (ie you don't have to move the flash write code to 
  RAM) works exceptionally well in my opinion, and is quicker than most 
  other devices. I would steer clear of block writes. these can be 
  unreliable.

  I would go back through the archives on this group where this was 
  discussed very heavily. Both in the context of remote code updating and 
  use of bulk data storage. The discussion covered many techniques such as 
  dtaa integriity, mini file systems etc.

  Al

  jkw_ee wrote:

  > 
  > I have about 4KB of operational parameters to be stored in non-
  > volitile memory but they will be updated occasionally. I have 
  > experience doing this in EEPROM but this is my first encounter with 
  > flash. I found the flash routines in the download area but would 
  > appreciate a chance to talk to anyone who has experience with 
  > updating and erasing segments in flash. I could use the flash or tag 
  > on an I2C EEPROM but need to make that decision soon.
  > 
  > Thanks,
  > Jeremy
  > jweese@jwee...
  > 
  > 
  > 
  > 
  > 
  > 
  > .
  > 
  >  
  > . 







I use the list file. This shows me all the code, tables etc, and free 
spaces. I also place my code where I want it to be, so that I can 
control free space. I'm not sure how the various compilers do this. I 
use assembler, it makes life so much easier. ;?}

Al

Cleber wrote:

> How I can determine what is the first position in
flash to save data, to prevent risk of erase code in flash? 
> 
> Cleber
>   ----- Original Message ----- 
>   From: onestone 
>   To: msp430@msp4... 
>   Sent: Thursday, November 04, 2004 1:02 PM
>   Subject: Re: [msp430] Storing parameters in Flash
> 
> 
>   Using flash as a data store is very simple with the MSP430. Flash write 
>   direct from memory (ie you don't have to move the flash write code to 
>   RAM) works exceptionally well in my opinion, and is quicker than most 
>   other devices. I would steer clear of block writes. these can be 
>   unreliable.
> 
>   I would go back through the archives on this group where this was 
>   discussed very heavily. Both in the context of remote code updating and 
>   use of bulk data storage. The discussion covered many techniques such as 
>   dtaa integriity, mini file systems etc.
> 
>   Al
> 
>   jkw_ee wrote:
> 
>   > 
>   > I have about 4KB of operational parameters to be stored in non-
>   > volitile memory but they will be updated occasionally. I have 
>   > experience doing this in EEPROM but this is my first encounter with 
>   > flash. I found the flash routines in the download area but would 
>   > appreciate a chance to talk to anyone who has experience with 
>   > updating and erasing segments in flash. I could use the flash or tag

>   > on an I2C EEPROM but need to make that decision soon.
>   > 
>   > Thanks,
>   > Jeremy
>   > jweese@jwee...
>   > 
>   > 
>   > 
>   > 
>   > 
>   > 
>   > .
>   > 
>   >  
>   > . 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> .
> 
>  
> Yahoo! Groups Links
> 
> 
> 
>  
> 
> 
> 
> 


Various C compilers do it in their own way. You can generally look at 
the map file. You can put your variables to store in flash in a 
separate C file, and force the loading of that particular constant 
data segment at the address of your choice, through linker directives.
One thing you have to remember is that the flash memory is erased by 
segments (generally 512 bytes, but sometimes 128, and even 256), so 
that you have to make sure that none of your code will share a 
segment with the data zone that you will have to erase and reprogram.

Michel

--- In msp430@msp4..., onestone <onestone@b...> wrote:
> I use the list file. This shows me all the code,
tables etc, and 
free 
> spaces. I also place my code where I want it to
be, so that I can 
> control free space. I'm not sure how the various compilers do this. 
I 
> use assembler, it makes life so much easier. ;?}
> 
> Al
> 
> Cleber wrote:
> 
> > How I can determine what is the first position in flash to save 
data, to prevent risk of erase code in flash? 
> > 
> > Cleber
> >   ----- Original Message ----- 
> >   From: onestone 
> >   To: msp430@msp4... 
> >   Sent: Thursday, November 04, 2004 1:02 PM
> >   Subject: Re: [msp430] Storing parameters in Flash
> > 
> > 
> >   Using flash as a data store is very simple with the MSP430. 
Flash write 
> >   direct from memory (ie you don't have to
move the flash write 
code to 
> >   RAM) works exceptionally well in my
opinion, and is quicker 
than most 
> >   other devices. I would steer clear of block
writes. these can 
be 
> >   unreliable.
> > 
> >   I would go back through the archives on this group where this 
was 
> >   discussed very heavily. Both in the context
of remote code 
updating and 
> >   use of bulk data storage. The discussion
covered many 
techniques such as 
> >   dtaa integriity, mini file systems etc.
> > 
> >   Al
> > 
> >   jkw_ee wrote:
> > 
> >   > 
> >   > I have about 4KB of operational parameters to be stored in 
non-
> >   > volitile memory but they will be
updated occasionally. I have 
> >   > experience doing this in EEPROM but this is my first 
encounter with 
> >   > flash. I found the flash routines in
the download area but 
would 
> >   > appreciate a chance to talk to anyone
who has experience with 
> >   > updating and erasing segments in flash. I could use the flash 
or tag 
> >   > on an I2C EEPROM but need to make that
decision soon.
> >   > 
> >   > Thanks,
> >   > Jeremy
> >   > jweese@s...
> >   > 
> >   > 
> >   > 
> >   > 
> >   > 
> >   > 
> >   > .
> >   > 
> >   >  
> >   > Yahoo! Groups Links
> >   > 
> >   > 
> >   > 
> >   >  
> >   > 
> >   > 
> >   > 
> >   > 
> > 
> > 
> > 
> >   .
> > 
> > 
> > 
> > 
> >         Yahoo! Groups Sponsor 
> >          
> >         Get unlimited calls to
> > 
> >         U.S./Canada
> >        
> >        
> > 
> > 
> > ------------------------------
------------
> >   Yahoo! Groups Links
> > 
> >     a.. To visit your group on the web, go to:
> >     http://groups.yahoo.com/group/msp430/
> >       
> >     b.. .
> >       
> >     c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms 
of Service. 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > .
> > 
> >  
> > Yahoo! Groups Links
> > 
> > 
> > 
> >  
> > 
> > 
> > 
> >