[Tinyos-help] What do PageEEPROM's flush and sync do?
Jacob Sorber
jacob.sorber at gmail.com
Tue Feb 6 11:31:26 PST 2007
Okay, that makes sense, but now I have no idea what is happening. I am
writing data in 50 byte chunks to a single page in flash (which I erase
before writing). After each write I call sync(). The first 4 writes seem
to work as intended (when I read the page, the flash is all 1s after the
data I have written). After the 5th write, though 6 bytes of garbage are
appended (page offsets 250-255). Do you know why this might be happening.
I have verified that when I call PageEEPROM.write(), the "size" value is, in
fact, 50.
Thanks,
Jacob
On 2/6/07, David Gay <dgay42 at gmail.com> wrote:
>
> On 2/6/07, Jacob Sorber <jacob.sorber at gmail.com> wrote:
> > I am seeing some bizarre behavior, and I suspect that it is due to my
> not
> > understanding exactly what these two functions do. I have not been able
> to
> > find any documentation on the subject, so any help would be great.
>
> flush starts writing the specified page to flash and signals
> completion "immediiately" (well, before the write completes). sync
> does the same thing, but only signals completion when the write is
> complete.
>
> Note that the pages are handled like a cache, so may be flushed anyway
> because of subsequent reads or writes. But if you want to ensure data
> is written, you do need to call sync or flush.
>
> David Gay
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20070206/a532cbd3/attachment-0001.htm
More information about the Tinyos-help
mailing list