Hi developers,

while using the LogStorage component of the at45db chip,
in circular mode with a volume consisting of n pages,
I observed the following:

I. After erasing the chip, writing n-1 pages,
and triggering a reset of the mote, no further writing
or reading is possible.
The reason seems to be procedure locateLastRecord()
in tinyos-main/tos/chips/at45db/LogStorageP.nc.


496 void locateLastRecord() {
497   if (firstPage == lastPage)
498     {
499       /* We walked all the way back to the last page, and it's not
500          valid. The log-volume invariant is not holding. Fail out. */
501          endRequest(FAIL);
502          return;
503     }
      ...

For a dirty workaround I replaced
      if (firstPage == lastPage)
with
      if ( (firstPage == lastPage) && (metadata.pos/PAGE_SIZE != lastPage) )
but this probably violates some assumptions or invariants.


II. After erasing the chip and writing x pages,
the following number y of pages can be read:
  If x <  n, then  y = x.
  If x >= n, then  y = n - 2.
That means that if I write at least n pages, then I lose
the n-th and (n-1)-th "newest" ones.


I am aware that these observation
are possibly due to errors
in my test application but
maybe you can give me some hint --
I am grateful for any help.

Best regards,
Michael Rink
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to