Hi Andrea,

First, it sounds like you want a storage solution like LogStorage.
Unfortunately, this isn't available in TinyOS 1.x, so if you're using
BlockStorage you'll have to do it manually somehow.  The best solution would
be to do this in RAM if possible, since it sounds like your storage is
temporary anyway.

In BlockStorage, you can erase the volume you're mounted to without having
to format.  So, if you write data to the flash and want it erased, just call
BlockWrite.erase().  From what I recall, you're using tmote's, right?  In
that case, when you call BlockWrite.erase(), the sector(s) you're mounted to
get wiped clean.  The bad part is it takes ~1 second to erase a single
sector, and a lot of energy.  And, if you're erasing all the time, you'll
reach the lifetime of the flash faster so it won't last as long.

If you really wanted to implement it on flash instead of RAM, maybe what you
could do is mount() and erase() the flash when you turn on the mote, then
write your data until the current volume is filled by keeping the write
address and other address bookmarks in RAM (keep in mind the last page of
each sector is reserved in BlockStorage for the STM25P tmote flash)  Then,
once you reach the end of the volume, call BlockWrite.erase and start over
from the beginning.

Overall, this sounds like a pretty difficult thing to do in flash without
LogStorage available, but it can be done if you have a lot of time and
patience!

-David





-----Original Message-----
From: lamiaimeil [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 25, 2006 4:04 AM
To: David Moss
Subject: Question on flash


Hi David,
do you remember me? I have a question for you. I want
to use eeprom like a circular array (if possible).. I
have format flash with FormatStorage.allocate command
but I had known that I can't rewrite the same portion
on memory without reformat it.. I must write on eeprom
some data get periodically from ADC and send them to
base station. Everytime data arrive on base station I
want erase them from eeprom so I can reuse it. How can
I do? Any ideas for a nice use of eeprom? Thanks a
lot! Andrea.

Chiacchiera con i tuoi amici in tempo reale! 
 http://it.yahoo.com/mail_it/foot/*http://it.messenger.yahoo.com 


_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to